var eint=false;var tSel=null;function isReady(){return eint}function eintInit(){eint=true}function setActiveThumb(tid){if(tSel!==null){document.getElementById("t_"+tSel).sendToActionScript(tSel)}tSel=tid}function showConfirm(title,txt,func,param){$("body").append('<div id="layerconfirm" class="jqmWindow confirmPopup"><div class="titlebox"><span>'+title+'</span><a onclick="closeConfirm();return false;" href="#" title="Close"></a></div><div class="contentbox"><div class="textbox"><p>'+txt+'</p></div><div class="buttonbox"><a href="#" onclick="'+func+"('"+param+'\');return false;" class="okbtn">OK</a><a href="#" onclick="closeConfirm();return false;" class="cancelbtn">Cancel</a></div></div></div>');$("#layerconfirm").jqm({modal:true});$("#layerconfirm").jqmShow()}function closeConfirm(){$("#layerconfirm").jqmHide();$("#layerconfirm").remove()}function getSelectionRange(){var sel=window.getSelection();var ran;if(sel&&sel!=""){if(sel.getRangeAt){ran=sel.getRangeAt(0)}else{ran=document.createRange();ran.setStart(sel.anchorNode,sel.anchorOffset);ran.setEnd(sel.focusNode,sel.focusOffset)}return ran}return false}function getSelectedText(fld){var txt="";if(window.getSelection){var sel=window.getSelection();var ran=getSelectionRange();if(ran){if(ran.startContainer.parentNode.attributes.id&&ran.endContainer.parentNode.attributes.id){var sCont=ran.startContainer.parentNode.attributes.id.value;var eCont=ran.endContainer.parentNode.attributes.id.value;if(sCont==eCont&&fld==sCont){txt=sel}}}}else{if(document.selection){txt=document.selection.createRange().text}else{return}}return txt}function GetCaretPosition(elem){var text=document.getElementById(elem).value;var s=0;var e=0;if(window.getSelection){s=document.getElementById(elem).selectionStart;e=document.getElementById(elem).selectionEnd}else{if(document.selection){var ran=document.selection.createRange();var dpl=ran.duplicate();if(ran.text.length>0){dpl.moveToElementText(document.getElementById(elem));dpl.setEndPoint("EndToEnd",ran);s=dpl.text.length-ran.text.length;e=s+ran.text.length}}else{return}}return[s,e]}function setCaretPosition(id,pos){var elem=document.getElementById(id);if(!pos){var pos=0;elem.focus()}else{if(window.getSelection){if(elem.selectionStart){elem.focus();elem.setSelectionRange(pos,pos)}else{elem.focus()}}else{if(document.selection){var ran=elem.createTextRange();ran.move("character",pos);ran.select()}else{return}}}}function setPayment(info){$("#spinner").jqmShow();$.ajax({type:"GET",cache:false,url:"jx.php?setPayment="+info+"&rnd"+Math.ceil(Math.random()*1000)+"&"+$("#billing_info_form").serialize(),dataType:"json",success:function(data,statusText){var ok=false;if(statusText=="success"){$("input[name=token]").val(data.token);if(data.status&&data.status==1){if(data.ptype=="PP"){$("#paypalform").submit();ok=true}else{if(data.ptype=="CO"){$("#COcard_holder_name").val(data.company);$("#COcard_holder_name_last").val(data.company_last);$("#COstreet_address").val(data.add1);$("#COstreet_address2").val(data.add2);$("#COcity").val(data.city);$("#COzip").val(data.zip);$("#COcountry").val(data.country);$("#coform").submit();ok=true}}}else{if(data.msg){$("#spinner").jqmHide();$.jGrowl(data.msg,{header:"Payment"});ok=true}}}if(ok==false){$("#spinner").jqmHide();$.jGrowl("Sorry but we cannot process your payment right now. Please try again later",{header:"Payment"})}}})}function refreshCaptcha(){$(".captcha").attr("src","/captcha.php?rnd="+Math.random()*10000)}function refreshCaptchaLight(){$(".captchalayer").attr("src","/captcha.php?c=l&rnd="+Math.random()*10000)}function adminDwn(url){$("#dlnfrm").attr("src",url+"&size="+$("input[name='priceOption']:checked").val())}function closeAll(){if(openedC==0){cancelAuthorEdit()}else{if(openedC>0){cancelCommentEdit(openedC)}}}function quote(msg,user){var txt;var fld;if(msg=="author"){fld="authorcommenttext"}else{fld="commenttxt"+msg}var sel=""+getSelectedText(fld);if(sel.length>0){txt=sel}else{txt=$("#"+fld).text()}if($("#new_comment").val()=="Add comment..."){$("#new_comment").val('[quote="'+user+'"]'+txt+"[/quote]")}else{$("#new_comment").val($("#new_comment").val()+'[quote="'+user+'"]'+txt+"[/quote]")}$("#new_comment").DefaultValue("Add comment...");$("#new_comment").focus();setCaretPosition(fld)}function editDescription(id){closeAll();var xxx=$("#authorcommentwrapper").outerHeight();$.ajax({type:"GET",cache:false,url:"jx.php?loaddescription="+id+"&h="+xxx+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:handleResponse,complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function cancelAuthorEdit(){$("#authorcommentedit").remove();$("#authorcommentwrapper").removeClass("bigbg");$("#authorcommentbar").removeClass("hide");$("#authorcommenttext").removeClass("hide");if($.browser.msie){$("#authorcommentwrapper").parent().removeClass("big")}openedC=-1}function handleResponse(data,statusText){if(statusText=="success"){if(data.status&&data.status==1){openedC=0;$("#authorcommentbar").addClass("hide");$("#authorcommenttext").addClass("hide");$("#authorcommentwrapper").addClass("bigbg");$("#authorcommentwrapper").append(data.txt);$("input[name=token]").val($("#editdescriptiontoken").val());if($.browser.msie){$("#authorcommentwrapper").parent().addClass("big")}}}else{$.jGrowl("Error! Could not contact the server!",{header:"Edit Description"})}}function saveDescription(id){var poptions={beforeSubmit:function(){$("#spinner").jqmShow()},success:showSaveResponse,type:"post",dataType:"json",url:"jx.php?savedescription="+id+"&rnd"+Math.ceil(Math.random()*1000)};$("#formsavedescription").ajaxSubmit(poptions);return false}function showSaveResponse(responseText,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(responseText.token);if(responseText.status&&responseText.status==1){$("#authorcommenttext").html(responseText.txt);cancelAuthorEdit();$.jGrowl("Description saved",{header:"Edit Description"})}else{$.jGrowl(responseText.txt,{header:"Edit Description"})}}else{cancelAuthorEdit();$.jGrowl("Error! Could not contact the server!",{header:"Edit Description"})}}function editComment(id){closeAll();var x=id.split("|");var xxx=$("#commentwrapper"+x[0]).outerHeight();$.ajax({type:"GET",cache:false,url:"jx.php?loadcomment="+id+"&h="+xxx+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:handleComResponse,complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function handleComResponse(data,statusText){if(statusText=="success"){if(data.status&&data.status==1&&data.id>0){editcom=data.id;openedC=data.id;$("#commentbar"+data.id).addClass("hide");$("#commenttxt"+data.id).addClass("hide");$("#commentwrapper"+data.id).addClass("bigbg");$("#commentwrapper"+data.id).append(data.txt);$("input[name=token]").val($("#editcommenttoken").val());if($.browser.msie){$("#commentwrapper"+data.id).parent().addClass("big")}}}else{$.jGrowl("Error! Could not contact the server!",{header:"Edit Comment"})}}function cancelCommentEdit(id){editcom="0";openedC=-1;$("#commentedit"+id).remove();$("#commentwrapper"+id).removeClass("bigbg");$("#commentbar"+id).removeClass("hide");$("#commenttxt"+id).removeClass("hide");if($.browser.msie){$("#commentwrapper"+id).parent().removeClass("big")}}function saveComment(id){var poptions={beforeSubmit:function(){$("#spinner").jqmShow()},success:showSaveComResponse,type:"post",dataType:"json",url:"jx.php?savecomment="+id+"&rnd"+Math.ceil(Math.random()*1000)};$("#formsavecomment").ajaxSubmit(poptions);return false}function showSaveComResponse(responseText,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(responseText.token);if(responseText.status&&responseText.status==1&&responseText.id>0){$("#commenttxt"+responseText.id).html(responseText.txt);cancelCommentEdit(responseText.id);$.jGrowl("Comment saved",{header:"Edit Comment"})}else{$.jGrowl(responseText.txt,{header:"Edit Comment"})}}else{cancelCommentEdit(editcom);$.jGrowl("Error! Could not contact the server!",{header:"Edit Comment"})}}function delComment(id){$("#"+id).submit();return false}function purchase(price,credits){$(".showpcred").html(price+" Credit"+((price!=1)?"s":""));if(price>credits){$("#purchaseDownload").addClass("hide");$("#purchaseCredits").removeClass("hide")}else{$("#purchaseCredits").addClass("hide");$("#purchaseDownload").removeClass("hide")}}function purchaseAndDownload(foo){$("#FormpurchaseForm").submit()}function newFavFolder(id){var poptions={beforeSubmit:function(){$("#spinner").jqmShow()},success:showSaveFavFolderResponse,type:"post",dataType:"json",url:"jx.php?savefavfolder="+id+"&rnd"+Math.ceil(Math.random()*1000)};$("#formnewfavfolder").ajaxSubmit(poptions);return false}function showSaveFavFolderResponse(responseText,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(responseText.token);if(responseText.status&&responseText.status==1){if(responseText.close==1){$("#layerfavorites").jqmHide()}$.jGrowl("Favorite saved",{header:"Add Favorite"});$("#new_fav_folder_name").val("");$("#new_fav_folder_words").val("");$("#new_fav_folder_words").DefaultValue("enter keywords...");$("#new_fav_folder_name").DefaultValue("enter name...");if(responseText.new_id>0){$("#existFavFolders").parent().find("ul").remove();$("#existFavFolders").parent().find("input").remove();$("#existFavFolders").append('<option value="'+(responseText.new_id)+'">'+(responseText.new_name)+"</option>");$("#existFavFolders").singleSelect({layerStackIndex:2,fieldName:"exist_fav_folders",noneSelected:"select folder",inputClass:"favSelect",listClass:"favSelectOptions"})}$("#foldersnoexist").addClass("hide");$("#foldersexist").removeClass("hide")}else{$.jGrowl(responseText.txt,{header:"Add Favorite"});if(responseText.close==1){$("#layerfavorites").jqmHide()}}}else{$("#layerfavorites").jqmHide();$.jGrowl("Error! Could not contact the server!",{header:"Add Favorite"})}}function newFav(id){var poptions={beforeSubmit:function(){$("#spinner").jqmShow()},success:showSaveFavResponse,type:"post",dataType:"json",url:"jx.php?savefav="+id+"&rnd"+Math.ceil(Math.random()*1000)};$("#formfavwfolder").ajaxSubmit(poptions);return false}function showSaveFavResponse(responseText,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(responseText.token);if(responseText.status&&responseText.status==1){if(responseText.close==1){$("#layerfavorites").jqmHide()}$.jGrowl("Favorite saved",{header:"Add Favorite"})}else{$.jGrowl(responseText.txt,{header:"Add Favorite"});if(responseText.close==1){$("#layerfavorites").jqmHide()}}}else{$("#layerfavorites").jqmHide();$.jGrowl("Error! Could not contact the server!",{header:"Add Favorite"})}}function selectFavIcon(n){$("#iconfavs img").removeClass("sel");$("#fi"+n).addClass("sel");$("#new_fav_icon").val(n)}function validate(){if($("#new_comment").val().length>0&&$("#new_comment").val()!="Add comment..."&&$("#new_comment").val().length<=5000){$("#spinner").jqmShow();$("#formnmsg").submit()}else{if($("#new_comment").val().length>5000){$.jGrowl("Message cannot have mored than 5000 chars. You are currently using "+$("#new_comment").val().length,{header:"Post Comment"})}else{$.jGrowl("Please fill the Message field",{header:"Post Comment"})}}}function quote_art(msg,user){var txt;var fld;if(msg=="author"){fld="authorarticle"}else{fld="post"+msg}var sel=""+getSelectedText(fld);if(sel.length>0){txt=sel}else{txt=$("#"+fld).text()}if($("#new_comment").val()=="Add comment..."){$("#new_comment").val('[quote="'+user+'"]'+txt+"[/quote]")}else{$("#new_comment").val($("#new_comment").val()+'[quote="'+user+'"]'+txt+"[/quote]")}$("#new_comment").DefaultValue("Add comment...");$("#new_comment").focus();setCaretPosition(fld)}function delPost(id){$("#"+id).submit();return false}function closeAll_art(){if(openedC>0){cancelPostEdit(openedC)}}function editPost(id,holder){closeAll_art();var xxx=$("#commentwrapper"+holder).outerHeight();$.ajax({type:"GET",cache:false,url:"jx.php?loadnews="+id+"&h="+xxx+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:function(data,statusText){if(statusText=="success"){if(data.status&&data.status==1&&data.id>0){editcom=data.id;openedC=data.id;$("#postBar"+data.id).addClass("hide");$("#post"+data.id).addClass("hide");$("#commentwrapper"+data.id).addClass("bigbg");$("#commentwrapper"+data.id).append(data.txt);$("input[name=token]").val($("#editposttoken").val());if($.browser.msie){$("#commentwrapper"+data.id).parent().addClass("big");$("#news").css("display","none");$("#news").css("display","block")}}}else{$.jGrowl("Error! Could not contact the server!",{header:"Edit Post"})}},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function cancelPostEdit(id){editcom="0";openedC=-1;$("#commentedit"+id).remove();$("#commentwrapper"+id).removeClass("bigbg");$("#postBar"+id).removeClass("hide");$("#post"+id).removeClass("hide");if($.browser.msie){$("#commentwrapper"+id).parent().removeClass("big");$("#news").css("display","none");$("#news").css("display","block")}}function savePost(id){var poptions={beforeSubmit:function(){$("#spinner").jqmShow()},success:function(responseText,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(responseText.token);if(responseText.status&&responseText.status==1&&responseText.id>0){$("#post"+responseText.id).html(responseText.txt);cancelPostEdit(responseText.id);$.jGrowl("Post saved",{header:"Edit Post"})}else{$.jGrowl(responseText.txt,{header:"Edit Post"})}}else{cancelPostEdit(editcom);$.jGrowl("Error! Could not contact the server!",{header:"Edit Post"})}},type:"post",dataType:"json",url:"jx.php?savenews="+id+"&rnd"+Math.ceil(Math.random()*1000)};$("#formsavepost").ajaxSubmit(poptions);return false}function sendMsg(id){var poptions={beforeSubmit:function(){$("#spinner").jqmShow()},success:showResponse,type:"post",dataType:"json",url:"jx.php?newmsg="+id+"&rnd"+Math.ceil(Math.random()*1000)};$("#formnmsg").ajaxSubmit(poptions);return false}function showResponse(responseText,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(responseText.token);if(responseText.status&&responseText.status==1){if(responseText.close==1){$("#layermessage").jqmHide()}$.jGrowl("Message Sent",{header:"Send Message"});$("#msg_subject").val("");$("#msg_message").val("");$("#msg_subject").DefaultValue("enter here...");$("#msg_message").DefaultValue("enter here...")}else{$.jGrowl(responseText.txt,{header:"Send Message"});if(responseText.close==1){$("#layermessage").jqmHide()}}}else{$("#layermessage").jqmHide();$.jGrowl("Error! Could not contact the server!",{header:"Send Message"})}}function validate_topic(){if($("#new_post").val().length>0&&$("#new_post").val()!="Add comment..."&&$("#new_post").val().length<=5000){$("#spinner").jqmShow();$("#formnmsg").submit()}else{if($("#new_post").val().length>5000){$.jGrowl("Message cannot have mored than 5000 chars. You are currently using "+$("#new_post").val().length,{header:"Post Reply"})}else{$.jGrowl("Please fill the Message field",{header:"Post Reply"})}}}function quote_topic(msg,user){var txt;var fld="post"+msg;var sel=""+getSelectedText(fld);if(sel.length>0){txt=sel}else{txt=$("#"+fld).text()}if($("#new_post").val()=="Add comment..."){$("#new_post").val('[quote="'+user+'"]'+txt+"[/quote]")}else{$("#new_post").val($("#new_post").val()+'[quote="'+user+'"]'+txt+"[/quote]")}$("#new_post").DefaultValue("Add comment...");$("#new_post").focus();setCaretPosition(fld)}function editPost_topic(id,holder){closeAll_art();var xxx=$("#commentwrapper"+holder).outerHeight();$.ajax({type:"GET",cache:false,url:"jx.php?loadpost="+id+"&h="+xxx+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:function(data,statusText){if(statusText=="success"){if(data.status&&data.status==1&&data.id>0){editcom=data.id;openedC=data.id;$("#postBar"+data.id).addClass("hide");$("#post"+data.id).addClass("hide");$("#commentwrapper"+data.id).addClass("bigbg");$("#commentwrapper"+data.id).append(data.txt);$("input[name=token]").val($("#editposttoken").val());if($.browser.msie){$("#commentwrapper"+data.id).parent().addClass("big");$("#forum").css("display","none");$("#forum").css("display","block")}}}else{$.jGrowl("Error! Could not contact the server!",{header:"Edit Post"})}},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function cancelPostEdit_topic(id){editcom="0";openedC=-1;$("#commentedit"+id).remove();$("#commentwrapper"+id).removeClass("bigbg");$("#postBar"+id).removeClass("hide");$("#post"+id).removeClass("hide");if($.browser.msie){$("#commentwrapper"+id).parent().removeClass("big");$("#forum").css("display","none");$("#forum").css("display","block")}}function savePost_topic(id){var poptions={beforeSubmit:function(){$("#spinner").jqmShow()},success:function(responseText,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(responseText.token);if(responseText.status&&responseText.status==1&&responseText.id>0){$("#post"+responseText.id).html(responseText.txt);cancelPostEdit_topic(responseText.id);$.jGrowl("Post saved",{header:"Edit Post"})}else{$.jGrowl(responseText.txt,{header:"Edit Post"})}}else{cancelPostEdit_topic(editcom);$.jGrowl("Error! Could not contact the server!",{header:"Edit Post"})}},type:"post",dataType:"json",url:"jx.php?savepost="+id+"&rnd"+Math.ceil(Math.random()*1000)};$("#formsavepost").ajaxSubmit(poptions);return false}function moveForum(){if($("#move_confirm").attr("checked")==true){$("#formmoveforum").submit()}else{$.jGrowl("Please check the Confirm move",{header:"Move Topic"})}}function validate_forum(){if($("#topic_message").val().length>0&&$("#topic_message").val()!="Message..."&&$("#topic_subject").val().length>0&&$("#topic_subject").val()!="Topic Subject..."&&$("#topic_message").val().length<=5000){$("#spinner").jqmShow();$("#formnmsg").submit()}else{if($("#topic_message").val().length>5000){$.jGrowl("Message cannot have mored than 5000 chars. You are currently using "+$("#topic_message").val().length,{header:"Add Topic"})}else{$.jGrowl("Please fill both Subject and Message",{header:"Add Topic"})}}}function newPost_forum(){$("#topic_message").val("");$("#topic_subject").val("");$("#topic_message").DefaultValue("Message...");$("#topic_subject").DefaultValue("Topic Subject...");$("#layertopic").jqmShow()}function newpage(p,s,t,x){$.ajax({type:"GET",cache:false,url:"jx.php?collectprods="+p+"|"+s+"|"+t+"|"+x+"&rnd"+Math.ceil(Math.random()*1000),dataType:"html",success:function(html){$("#prodcontent").html(html);$("#coltoken").val($("#tmpcol").val());refreshSelected();$("#sortList").singleSelect({layerStackIndex:0,fieldIdName:"sort_results",fieldName:"sort_results",noneSelected:"Sort results...",inputClass:"smallSelect",listClass:"selectOptions",listWidth:110,listTop:30,listLeft:4},function(){newpage("1",$("#sort_results").val(),$("#col_type").val())})},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function toggleProd(id){if($("#col_products").val()!=""){var arr=$("#col_products").val().split(",")}else{var arr=new Array()}var key=$.inArray(id.toString(),arr);if(key>=0){arr.splice(key,1)}else{arr.push(id)}$("#col_products").val(arr.join(","));$("#totalprods").text(arr.length)}function refreshSelected(){if($("#col_products").length){if($("#col_products").val()!=""){var arr=$("#col_products").val().split(",")}else{var arr=new Array()}if(arr.length>0){for(id in arr){$("#item_"+arr[id]).attr("checked",true)}}$("#totalprods").text(arr.length);$("#col_search").DefaultValue("search within...");$().jPreview()}}function showprods(){$.ajax({type:"GET",cache:false,url:"jx.php?collectprodsselect="+$("#col_products").val()+"|"+$("#col_discount").val()+"|"+$("#col_type").val()+"&rnd"+Math.ceil(Math.random()*1000),dataType:"html",success:function(html){$("#prodlist").html(html);$("#layerproducts").jqmShow();$("#coltoken").val($("#tmpprodtok").val())},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function toggleProdSel(id,price){$("#sli"+id).remove();toggleProd(id);$("#item_"+id).attr("checked",false);var ptotal=$("#curTotal").text().split(" ");var total=parseInt(ptotal[0]);var cred=((total-price)!=1)?"s":"";$("#curTotal").text((total-price)+" Credit"+cred)}function editPost_blog(id,holder){closeAll_art();var xxx=$("#commentwrapper"+holder).outerHeight();$.ajax({type:"GET",cache:false,url:"jx.php?loadblog="+id+"&h="+xxx+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:function(data,statusText){if(statusText=="success"){if(data.status&&data.status==1&&data.id>0){editcom=data.id;openedC=data.id;$("#postBar"+data.id).addClass("hide");$("#post"+data.id).addClass("hide");$("#commentwrapper"+data.id).addClass("bigbg");$("#commentwrapper"+data.id).append(data.txt);$("input[name=token]").val($("#editposttoken").val());if($.browser.msie){$("#commentwrapper"+data.id).parent().addClass("big");$("#blog").css("display","none");$("#blog").css("display","block")}}}else{$.jGrowl("Error! Could not contact the server!",{header:"Edit Post"})}},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function savePost_blog(id){var poptions={beforeSubmit:function(){$("#spinner").jqmShow()},success:function(responseText,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(responseText.token);if(responseText.status&&responseText.status==1&&responseText.id>0){$("#post"+responseText.id).html(responseText.txt);cancelPostEdit(responseText.id);$.jGrowl("Post saved",{header:"Edit Post"})}else{$.jGrowl(responseText.txt,{header:"Edit Post"})}}else{cancelPostEdit(editcom);$.jGrowl("Error! Could not contact the server!",{header:"Edit Post"})}},type:"post",dataType:"json",url:"jx.php?saveblog="+id+"&rnd"+Math.ceil(Math.random()*1000)};$("#formsavepost").ajaxSubmit(poptions);return false}function typeBlockHandler(v){if(v){if(v=="on"){if($(".ftypesOptions").find("input.selectAll").attr("checked")){$(".advsearchForm").find("fieldset").not("fieldset:first").removeClass("hide")}else{$(".ftypesOptions").find("input").not("input.selectAll").each(function(){var x=$(this).val();if($(this).attr("checked")){$(".advsearchForm").find("fieldset#block"+x).removeClass("hide")}else{$(".advsearchForm").find("fieldset#block"+x).addClass("hide")}})}}else{if($(".advsearchForm").find("fieldset#block"+v).hasClass("hide")){$(".advsearchForm").find("fieldset#block"+v).removeClass("hide")}else{$(".advsearchForm").find("fieldset#block"+v).addClass("hide")}}if($.browser.msie){$("#advsearch").css("display","none");$("#advsearch").css("display","block")}}}function initAdvSea(){$("#prod_keyw").DefaultValue("enter here...");$("#prod_cont").DefaultValue("enter here...");$("#prod_cont").autocomplete("autocomplete.php",{width:174,autoFill:true,scroll:true,scrollHeight:250,max:0});$("#prodFtypList").multiSelect({selectAll:true,noneSelected:"any filetype",allSelected:"all filetypes",inputClass:"ftypesSelect",listClass:"ftypesOptions",listWidth:166,listTop:30,listLeft:2},function(v){typeBlockHandler(v)});$("#prodSortList").singleSelect({layerStackIndex:20,fieldName:"prod_sort",noneSelected:"choose...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodVideoDimeList").singleSelect({layerStackIndex:20,fieldName:"prod_video_dime",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodVideoFramList").singleSelect({layerStackIndex:20,fieldName:"prod_video_fram",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodVideoLoopList").singleSelect({layerStackIndex:20,fieldName:"prod_video_loop",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodVideoAudiList").singleSelect({layerStackIndex:20,fieldName:"prod_video_audi",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodVideoOpacList").singleSelect({layerStackIndex:20,fieldName:"prod_video_opac",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodFlashPlayList").singleSelect({layerStackIndex:20,fieldName:"prod_flash_play",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodFlashActiList").singleSelect({layerStackIndex:20,fieldName:"prod_flash_acti",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodFlashContList").singleSelect({layerStackIndex:20,fieldName:"prod_flash_cont",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodFlashLoopList").singleSelect({layerStackIndex:20,fieldName:"prod_flash_loop",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodFlashOpacList").singleSelect({layerStackIndex:20,fieldName:"prod_flash_opac",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodFlashScalList").singleSelect({layerStackIndex:20,fieldName:"prod_flash_scal",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodFlashAudiList").singleSelect({layerStackIndex:20,fieldName:"prod_flash_audi",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodAudioTypeList").singleSelect({layerStackIndex:20,fieldName:"prod_audio_type",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodAudioLoopList").singleSelect({layerStackIndex:20,fieldName:"prod_audio_loop",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodAudioSampList").singleSelect({layerStackIndex:20,fieldName:"prod_audio_samp",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodAeVersList").singleSelect({layerStackIndex:20,fieldName:"prod_ae_vers",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodAeDimeList").singleSelect({layerStackIndex:20,fieldName:"prod_ae_dime",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodAeLoopList").singleSelect({layerStackIndex:20,fieldName:"prod_ae_loop",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodAePlugList").singleSelect({layerStackIndex:20,fieldName:"prod_ae_plug",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodAeOpacList").singleSelect({layerStackIndex:20,fieldName:"prod_ae_opac",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodImageTypeList").singleSelect({layerStackIndex:20,fieldName:"prod_image_type",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodImageSizeList").singleSelect({layerStackIndex:20,fieldName:"prod_image_size",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodImageOpacList").singleSelect({layerStackIndex:20,fieldName:"prod_image_opac",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodImageShapList").singleSelect({layerStackIndex:20,fieldName:"prod_image_shap",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$("#prodVectOutpList").singleSelect({layerStackIndex:20,fieldName:"prod_vect_outp",noneSelected:"any...",inputClass:"bigSelect",listClass:"selectOptions"});$(".advsearchForm").formLines();typeBlockHandler("on")}function deletep(i){closeConfirm();$("#spinner").jqmShow();$("#fd"+i).submit()}function edit(i,uni){$.ajax({type:"GET",cache:false,url:"jx.php?editprod="+i+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:function(data,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(data.token);if(data.status&&data.status==1){$("#pid").val(data.id);$("#pth").html($("#t"+uni).html());$("#ptn").html('<div class="pdetail">'+$("#n"+uni).html()+"</div>");if(data.exclusive=="YES"){$("#product_exclusive").attr("checked",true)}else{$("#product_exclusive").attr("checked",false)}$("#product_keywords").val(data.keywords);$("#product_description").val(data.desc);$("#subslist").html('<input id="product_categories" type="text" readonly="readonly" class="select" value="" /><div class="ddMenu fourColMenu hide" >'+data.subs+"</div>");$("#product_categories").dropdown({layerStackIndex:20,noneSelected:"Add Categories"});$("#layerdetails").jqmShow()}else{$.jGrowl(data.txt,{header:"Edit Product"})}}else{$.jGrowl("Error! Could not contact the server!",{header:"Edit Product"})}},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function editcol(i,uni){$.ajax({type:"GET",cache:false,url:"jx.php?editcol="+i+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:function(data,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(data.token);if(data.status&&data.status==1){$("#cid").val(data.id);$("#cth").html($("#t"+uni).html());$("#ctn").html(data.name);if(data.exclusive=="YES"){$("#col_exclusive").attr("checked",true)}else{$("#col_exclusive").attr("checked",false)}$("#col_keywords").val(data.keywords);$("#col_description").val(data.desc);$("#colDiscList").singleSelectOption(data.discount);editColPutFlash();$("#layercol").jqmShow()}else{$.jGrowl(data.txt,{header:"Edit Product"})}}else{$.jGrowl("Error! Could not contact the server!",{header:"Edit Product"})}},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function deleteMessage(id){$("#formdeletemsg"+id).submit();return false}function closeTicket(){$("#closeticket").val("1");$(".replyForm").submit()}function newpage_ref(p,s,t,x){$.ajax({type:"GET",cache:false,url:"jx.php?affstats="+p+"|"+s+"|"+t+"|"+x+"&rnd"+Math.ceil(Math.random()*1000),dataType:"html",success:function(html){$("#affcontent").html(html);$("#selyear").val($("#tmpcol").val());$("#col_search").DefaultValue("search within...");dateToStat()},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function chart(x,y){$.ajax({type:"GET",cache:false,url:"jx.php?prodchart="+x+"&rnd"+Math.ceil(Math.random()*1000),dataType:"html",success:function(html){$("#stattitle").html("<span>"+$("#pname"+y).html()+"</span> - Downloads Stats");$("#statsBox").html(html);$("#selyear").val($("#tmpcolchart").val())},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function statement(x,y){$.ajax({type:"GET",cache:false,url:"jx.php?prodstatement="+x+"&rnd"+Math.ceil(Math.random()*1000),dataType:"html",success:function(html){var dd="";if($("#ddate"+y).html()!=""){dd=" - "+$("#ddate"+y).html()}$("#statementdata").html(html);$("#plthumb").html($("#psthumb"+y).html());$("#psdetails").html('<span class="pdetail">'+$("#pname"+y).html()+"</span> - Upload in "+$("#pdate"+y).html()+dd+"<br />Downloads: "+$("#pdown"+y).html()+"<br />Earned: "+$("#pearn"+y).html());$("#layerstatements").jqmShow();$("#selyear").val($("#tmpcolstate").val())},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function newpage_prod(p,s,t,x){$.ajax({type:"GET",cache:false,url:"jx.php?prodstats="+p+"|"+s+"|"+t+"|"+x+"&rnd"+Math.ceil(Math.random()*1000),dataType:"html",success:function(html){$("#prodcontent").html(html);$("#selyear").val($("#tmpcol").val());$().jPreview();$("#col_search").DefaultValue("search within...");dateToStat()},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function setDefs(){$("#request_paypal_email").DefaultValue("enter here...");$("#request_bank_client").DefaultValue("enter here...");$("#request_bank_name").DefaultValue("enter here...");$("#request_bank_iban").DefaultValue("enter here...");$("#request_bank_swift").DefaultValue("enter here...")}function checkRequest(){if(parseFloat($("#request_amount").val())>0){if(parseFloat($("#request_amount").val())>totcred){$.jGrowl("The maximum amount you can request is "+totcred,{header:"Request Payment"});return false}}else{$.jGrowl("Not a valid amount",{header:"Request Payment"});return false}if($("#request_method_1").attr("checked")){if($("#request_bank_client").val()=="enter here..."||$("#request_bank_client").val().trim()==""){$.jGrowl("Please fill your Name",{header:"Request Payment"});return false}else{if($("#request_bank_name").val()=="enter here..."||$("#request_bank_name").val().trim()==""){$.jGrowl("Please fill the Bank Name",{header:"Request Payment"});return false}else{if($("#request_bank_iban").val()=="enter here..."||$("#request_bank_iban").val().trim()==""){$.jGrowl("Please fill the IBAN",{header:"Request Payment"});return false}else{if($("#request_bank_swift").val()=="enter here..."||$("#request_bank_swift").val().trim()==""){$.jGrowl("Please fill the SWIFT",{header:"Request Payment"});return false}}}}}else{if($("#request_method_2").attr("checked")){if($("#request_paypal_email").val()=="enter here..."||$("#request_paypal_email").val().trim()==""){$.jGrowl("Please fill your Paypal email ",{header:"Request Payment"});return false}}else{$.jGrowl("Please select a Payment method ",{header:"Request Payment"});return false}}if($("#request_confirm").attr("checked")==true){$("#spinner").jqmShow();$("#frmreq").submit()}else{$.jGrowl("Please Confirm this request",{header:"Request Payment"});return false}}function convertCred(){if(maxcred>0){$("#convert_amount").val(maxcred);$("#convert_confirm").attr("checked",false);$("#layerconvert").jqmShow()}else{$.jGrowl("You currently don't have funds to convert",{header:"Convert to Credits"})}}function checkConvert(){if(parseInt($("#convert_amount").val())>0){if(parseInt($("#convert_amount").val())>maxcred){$.jGrowl("The maximum amount you can convert is "+maxcred,{header:"Convert to Credits"});return false}else{if($("#convert_confirm").attr("checked")==true){return true}else{$.jGrowl("Please Confirm this conversion",{header:"Convert to Credits"});return false}}}$.jGrowl("Not a valid amount ",{header:"Convert to Credits"});return false}function reqPay(){if(totcred>=100){$("#request_amount").val(totcred);$("#request_confirm").attr("checked",false);setDefs();$("#layerrequest").jqmShow()}else{alertLowFunds()}}function deleteFav(id){$("#favtodelte").val(id);$("#formdeletefav").submit();return false}function deleteFolder(id){$("#formdeletefld"+id).submit();return false}function togglePublic(folder){var x=($("#public"+folder).attr("checked"))?"public":"private";$.ajax({type:"GET",cache:false,url:"jx.php?setfolder="+folder+"&"+x+"="+x+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:function(data,statusText){if(statusText=="success"){$("input[name=token]").val(data.token);if(data.status&&data.status==1){var x=(data.folder=="YES")?true:false;$("#public"+data.id).attr("checked",x)}}else{$.jGrowl("Error! Could not contact the server!",{header:"Favorites"})}},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}});return true}function dwn(id,total){if(total==2){$("#dwn"+id).html('<div class="cell">Download limit exceeded<br />3 downloads per purchase</div>')}else{if(dwns[id]){dwns[id]++}else{dwns[id]=10+total}if(dwns[id]==12){$("#dwn"+id).html('<div class="cell">Download limit exceeded<br />3 downloads per purchase</div>')}}return true}function getThumb(mt){$("#upthumb").html('<img src="images/ajax-loader.gif" width="24" height="24" alt="" />');var tn=new Image(110,110);tn.src="/getupimagethumb.php?mt="+mt+Math.ceil(Math.random()*1000);tn.onload=function(){$("#upthumb").html(this)}}function deleteup(mt){showConfirm("Delete File","Are you sure you want to delete this file?<br />If you choose to delete it, you will need to upload it again by using this form or by FTP (if enabled).","deleteupfile",mt);return false}function browseFTP(mt){$.ajax({type:"GET",cache:false,url:"jx.php?browseftp="+mt+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:function(data,statusText){$("#spinner").jqmHide();if(statusText=="success"){$("input[name=token]").val(data.token);$("#filesList").empty();if(data.files&&data.files.length>0){for(var i=0;i<data.files.length;i++){$("#filesList").append('<option value="'+data.files[i][0]+'">'+data.files[i][1]+"</option>")}}$("#layerupload").jqmShow()}else{$.jGrowl("Connection Error",{header:"Browse FTP"})}},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})}function deleteupfile(mt){closeConfirm();$.ajax({type:"GET",cache:false,url:"jx.php?delftpfile="+mt+"&rnd"+Math.ceil(Math.random()*1000),dataType:"json",success:function(data,statusText){if(statusText=="success"){$("input[name=token]").val(data.token);$("#updone").hide();file2();bt2=false;if(mt=="6"){file1();bt1=false}$("#btcont").removeClass("uploadfiles");$("#btcont").addClass("uploadfilesDisabled");$("#btcont").attr("disabled",true);defs();$("#spinner").jqmHide()}else{$.jGrowl("Connection Error",{header:"Delete File"})}},complete:function(){$("#spinner").jqmHide()},beforeSend:function(){$("#spinner").jqmShow()}})};
