var formRating;try{document.observe("dom:loaded",function(){initPaging(true);if($("DetailesImg")){nextImageInit()}})}catch(e){}function rate_add(f){var c=$F("rate"+f);var b="Rating invalid!";if(c==""){alert(b);return false}var a='<img src="/images/loading_big.gif" width="16" height="16" />';if($("rate_form"+f)==null){if($("rate_img")==null||$("rate_votes")==null){return true}else{formRating=$("rate_form").innerHTML;$("rate_form").update(a)}}else{formRating=$("rate_form"+f).innerHTML;$("rate_form"+f).update(a)}var d=new Ajax.Request("/request.php",{method:"post",parameters:"action=rateimage&rating="+c+"&id="+f,onSuccess:function(k){var g=k.responseText;if(g!=0){var j='Would you like to post a comment for this item?<br/><label for="new_comment">E:</label><br/><textarea id="new_comment" style="width:400px; height:80px;"></textarea><br/><input type="button" value="Add" class="button" onclick="addRatingAndComment('+c+", "+f+')" />';Dialog.alert(j,{width:500,height:200,okLabel:"close",windowParameters:{className:"alphacube"},ok:function(){Dialog.closeInfo()}});if($("rate_form"+f)!=null){$("rate_form"+f).update(g)}else{if($("rate_img")!=null&&$("rate_votes")!=null){$("rate_img").update(g);$("rate_votes").update(parseInt($("rate_votes").innerHTML)+1);$("rate_form").update()}else{alert(b)}}}else{var j='If you give a product a rating of 1, 2, 3 stars you must include a comment as to why.<br/><label for="new_comment">Enter your comments (300 characters max):</label><br/><textarea id="new_comment" style="width:400px; height:80px;"></textarea><br/><input type="button" value="Add" class="button" onclick="addRatingAndComment('+c+", "+f+')" />';Dialog.alert(j,{width:500,height:200,okLabel:"close",windowParameters:{className:"alphacube"},ok:function(){if($("rate_form"+f)){$("rate_form"+f).update(formRating)}else{if($("rate_form")){$("rate_form").update(formRating)}}Dialog.closeInfo()}})}}});return false}function addRatingAndComment(b,c){var a=$("new_comment").value.trim();if(a!=""&&a.length>=10){Dialog.closeInfo();new Ajax.Request("/request.php",{method:"post",parameters:{action:"rateimage",rating:b,id:c,comment:a},onSuccess:function(f){var d=f.responseText;if(d!=0){if($("rate_form"+c)!=null){$("rate_form"+c).update(d)}else{if($("rate_img")!=null&&$("rate_votes")!=null){$("rate_img").update(d);$("rate_votes").update(parseInt($("rate_votes").innerHTML)+1);$("rate_form").update();if($("rate_comment")){$("rate_comment").update()}}else{alert(ri)}}}else{if($("rate_form"+c)){$("rate_form"+c).update(formRating)}else{if($("rate_form")){$("rate_form").update(formRating)}}}}})}else{alert("Comment text must have from 10 to 300 characters and not contain different flood")}}function digitKey(c,b){var a=(typeof b.charCode=="undefined"?b.keyCode:b.charCode);if(b.ctrlKey||b.altKey||a<32){return true}a=String.fromCharCode(a);r=/\d/.test(a);if(!r&&c=="budget"){$("budgetmsg").update("Budget only digits")}return r}var swiffy;function beginformupload(){window.addEvent("load",function(){$("demo-status").appendText(" Detected Flash "+Browser.Plugins.Flash.version+"!");swiffy=new FancyUpload2($("demo-status"),$("demo-list"),{url:$("form-demo").action,limitFiles:50,limitSize:100*1024*1024,fieldName:"photoupload",path:"/js/Swiff.Uploader.swf",onLoad:function(){$("demo-status").removeClass("hide")},onAllComplete:function(b){swiffy.removeFile()},onComplete:function(c,b){OneFileComplite(c,b)},target:"demo-browse"});$("demo-browse").addEvent("click",function(){swiffy.browse();return false});$("demo-clear").addEvent("click",function(){swiffy.removeFile();return false});$("demo-upload").addEvent("click",function(){swiffy.upload();return false});var a={"Images and Archiv (*.jpg, *.jpeg, *.zip, *.rar)":"*.jpg; *.jpeg; *.zip; *.rar"};swiffy.options.typeFilter=a})}var rate_view_flag=true;function rate_view(a){if(rate_view_flag){$("rate_view").setStyle({display:""})}else{$("rate_view").setStyle({display:"none"})}rate_view_flag=!rate_view_flag}function paymentcheck(){var d=$F("cat_pay_id");var c=$F("user_wm");var a=$F("user_mb");if(!(/Z\d{12}/.test(c)||(c==""&&d!=2))){$("user_wm").parentNode.setStyle({backgroundColor:"red"})}else{$("user_wm").parentNode.setStyle({backgroundColor:""})}if(!(/^[\.\-_A-Za-z0-9]+?@[\.\-A-Za-z0-9]+?\.[A-Za-z0-9]{2,6}$/.test(a)||(a==""&&d!=6))){$("user_mb").parentNode.setStyle({backgroundColor:"red"})}else{$("user_mb").parentNode.setStyle({backgroundColor:""})}var f=["user_contact","user_adress","user_bankzipcode","user_bankcity","user_bankcountry"];if(!((d!=4&&d!=5)||($F("user_contact")!=""&&$F("user_adress")!=""&&$F("user_bankzipcode")!=""&&$F("user_bankcity")!=""&&$F("user_bankcountry")!=""))){for(var b=0;b<5;b++){if($F(f[b])==""){$(f[b]).parentNode.setStyle({backgroundColor:"red"})}}}else{for(var b=0;b<5;b++){if($F(f[b])!=""){$(f[b]).parentNode.setStyle({backgroundColor:""})}}}var f=["user_bankinfo","user_bankadress","user_bankname","user_bankswift"];if(!((d!=1)||($F("user_bankinfo")!=""&&$F("user_bankadress")!=""&&$F("user_bankname")!=""&&$F("user_bankswift")!=""))){for(var b=0;b<5;b++){if($F(f[b])==""){$(f[b]).parentNode.setStyle({backgroundColor:"red"})}}}else{for(var b=0;b<5;b++){if($F(f[b])!=""){$(f[b]).parentNode.setStyle({backgroundColor:""})}}}}var shownavf=false;function shownav(b,c){var a=0;while(b){a+=b.offsetLeft;b=b.offsetParent}if(!shownavf){if(a==0){if(c){a=c.clientX}else{if(window.event){a=window.event.clientX}else{return true}}}document.getElementById("navmenu").style.display="";document.getElementById("navmenu").style.left=a;shownavf=true}else{document.getElementById("navmenu").style.display="none";shownavf=false}return false}var support_tip_default=null;function change_ticket_category(b){if(support_tip_default==null){support_tip_default=$("support_girl_tip").innerHTML}var a=b.selectedIndex;if(support_tips[a-1]){$("support_girl_tip").innerHTML=support_tips[a-1]}else{$("support_girl_tip").innerHTML=support_tip_default}}var alerttimer=null;function bookmarkthis(){new Ajax.Request("/ajax/collections.php",{method:"post",parameters:{action:"bookmarkthis",collectionid:$F("collectionid"),image_id:$F("image_id"),collectionname:$F("collectionname"),collectionprivat:$("collectionprivat").checked?1:0},onSuccess:function(d){var b=d.responseText;if(b==1||b==2){var a="";if($F("collectionname")!=""){a=' "'+$F("collectionname")+'"'}else{if(a=$("collectionid").options[$("collectionid").selectedIndex].text){a=' "'+a+'"'}}var c="This item saved to collection"+a;if(b==2){c="This item deleted from collection"+a}Dialog.alert(c,{width:298,height:73,okLabel:"close",ok:function(){clearTimeout(alerttimer);Dialog.closeInfo()}});alerttimer=setTimeout("Dialog.closeInfo()",3000)}else{alert(b)}}})}var editname=editnamesave=new Array();function collection_edit(a){collection_edit_close();editname=Array(a,$F("ph"+a),$("aid"+a).innerHTML);$("cid"+editname[0]).innerHTML='<br><input type="text" value="'+editname[2]+'" id="etext" onkeydown="collection_edit_action(event)" class="inputform"><input type="button" value="Ok" onclick="collection_edit_save()" class="button"><br><input type="checkbox" id="echeckbox" '+(editname[1]==1?"checked":"")+'> <label for="echeckbox">Privat?</label> ';$("etext").focus()}function collection_edit_action(a){if(a.keyCode==27){collection_edit_close()}else{if(a.keyCode==13){collection_edit_save()}}}function collection_edit_close(){if(cid=editname[0]){$("cid"+cid).innerHTML=""}}function collection_edit_save(){if(cid=editname[0]){editnamesave=Array(cid,$("echeckbox").checked?1:0,$F("etext"));$("cid"+cid).innerHTML='<img src="/images/spinner.gif"/>';new Ajax.Request("/ajax/collections.php",{method:"post",parameters:{action:"collection_edit",collectionid:cid,cprivat:editnamesave[1],cname:editnamesave[2]},onSuccess:function(a){if(a.responseText==1){$("cid"+editnamesave[0]).innerHTML="";$("aid"+editnamesave[0]).innerHTML=editnamesave[2];$("p"+editnamesave[0]).innerHTML=editnamesave[1]?"Private":"Public";$("ph"+editnamesave[0]).value=editnamesave[1];editnamesave=editname=new Array()}else{collection_edit_close();alert(a.responseText)}}})}}function nextImageInit(){var a=$("main_img");a.observe("click",function(){var c=a.readAttribute("src");var d=$$(".thumbnails");var b=d[0];d.each(function(g,f){if(g.readAttribute("rel")==c){if(d[f+1]){b=d[f+1]}throw $break}});nextImage(b)});$$(".thumbnails").each(function(c){var b=a.readAttribute("src");$$(".thumbnails").each(function(f,d){if(f.readAttribute("rel")==b){f.addClassName("thumbnail-active");throw $break}});c.observe("click",function(){nextImage(c)})})}function nextImage(a){$$(".thumbnails").each(function(b){b.removeClassName("thumbnail-active")});a.addClassName("thumbnail-active");$("main_img").writeAttribute("src",a.readAttribute("rel"));window.location="#topimg"}function initPaging(d){if($("shadow")){$("shadow").remove()}if(typeof d!="undefined"){var b=window.location.href;var c=/#page=(\d)/.test(b);if(c){b=b.replace(/#/,(/\?/.test(b)?"&":"?"));a(b)}}$$(".paging").each(function(g){var f=g.readAttribute("href");g.observe("click",function(j){a(f);Event.stop(j)})});function a(f){shadow("mainBodyCenter");new Ajax.Updater("mainBodyCenter",f,{parameters:{ajaxPage:1},onComplete:function(){initPaging();if(typeof syncListInit!="undefined"){syncListInit()}var g=/page=(\d)/.exec(f);if(g&&typeof g[1]!="undefined"){window.location="#page="+g[1]}}})}}function shadow(objName){var loading=document.createElement("div");loading.style.background="url(/images/loading_big.gif) no-repeat center";loading.style.height="100%";var bglayer=document.getElementById(objName);var shadow=document.createElement("DIV");with(shadow.style){position="absolute";background='url("/images/loader_bg.png")';width=bglayer.clientWidth+"px";height=bglayer.clientHeight+"px";top=bglayer.offsetTop+"px";left=bglayer.offsetLeft+"px";textAlign="center"}shadow.id="shadow";shadow.appendChild(loading);document.body.appendChild(shadow);return shadow}var offsetfrommouse=[15,25];var displayduration=0;var defaultimageheight=40;var defaultimagewidth=40;var timer;function gettrailobj(){if(document.getElementById){return document.getElementById("preview_div").style}}function gettrailobjnostyle(){if(document.getElementById){return document.getElementById("preview_div")}}function truebody(){return(!window.opera&&document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}function hidetrail(){gettrailobj().display="none";document.onmousemove="";gettrailobj().left="-5000px";clearTimeout(timer)}function showtrail(d,c,b,a){i=d;t=c;w=b;h=a;timer=setTimeout("show('"+i+"',t,w,h);",200)}function show(g,f,c,a){var d=document.all?truebody().scrollLeft+truebody().clientWidth:pageXOffset+window.innerWidth-offsetfrommouse[0];var b=document.all?Math.min(truebody().scrollHeight,truebody().clientHeight):Math.min(window.innerHeight);if((navigator.userAgent.indexOf("Konqueror")==-1||navigator.userAgent.indexOf("Firefox")!=-1||(navigator.userAgent.indexOf("Opera")==-1&&navigator.appVersion.indexOf("MSIE")!=-1))&&(d>650&&b>500)){(c==0)?c=defaultimagewidth:"";(a==0)?a=defaultimageheight:"";c+=20;a+=20;defaultimageheight=a;defaultimagewidth=c;document.onmousemove=followmouse;newHTML='<div class="border_preview" style="width:'+c+"px;height:"+a+'px"><div id="loader_container"><div id="loader"><div align="center">Website Örnegi Yükleniyor...</div><div id="loader_bg"><div id="progress"> </div></div></div></div>';newHTML=newHTML+'<div class="preview_temp_load"><img onload="javascript:remove_loading();" src="'+g+'" border="0"></div>';newHTML=newHTML+"</div>";if(navigator.userAgent.indexOf("MSIE")!=-1&&navigator.userAgent.indexOf("Opera")==-1){newHTML=newHTML+'<iframe src="about:blank" scrolling="no" frameborder="0" width="'+c+'" height="'+a+'"></iframe>'}gettrailobjnostyle().innerHTML=newHTML}}function followmouse(f){var b=offsetfrommouse[0];var a=offsetfrommouse[1];var d=document.all?truebody().scrollLeft+truebody().clientWidth:pageXOffset+window.innerWidth-15;var c=document.all?Math.min(truebody().scrollHeight,truebody().clientHeight):Math.min(window.innerHeight);if(typeof f!="undefined"){if(d-f.pageX<defaultimagewidth+2*offsetfrommouse[0]){b=f.pageX-b-defaultimagewidth}else{b+=f.pageX}if(c-f.pageY<defaultimageheight+2*offsetfrommouse[1]){a+=f.pageY-Math.max(0,(2*offsetfrommouse[1]+defaultimageheight+f.pageY-c-truebody().scrollTop))}else{a+=f.pageY}}else{if(typeof window.event!="undefined"){if(d-event.clientX<defaultimagewidth+2*offsetfrommouse[0]){b=event.clientX+truebody().scrollLeft-b-defaultimagewidth}else{b+=truebody().scrollLeft+event.clientX}if(c-event.clientY<(defaultimageheight+2*offsetfrommouse[1])){a+=event.clientY+truebody().scrollTop-Math.max(0,(2*offsetfrommouse[1]+defaultimageheight+event.clientY-c))}else{a+=truebody().scrollTop+event.clientY}}}gettrailobj().left=b+"px";gettrailobj().top=a+"px";gettrailobj().display="block"}var t_id=setInterval(animate,20);var pos=0;var dir=2;var len=0;function animate(){var a=document.getElementById("progress");if(a!=null){if(pos==0){len+=dir}if(len>32||pos>79){pos+=dir}if(pos>79){len-=dir}if(pos>79&&len==0){pos=0}a.style.left=pos;a.style.width=len}}function remove_loading(){this.clearInterval(b);var a=document.getElementById("loader_container");a.style.display="none";a.style.visibility="hidden";var b=setInterval(animate,60)};
