function fblogin(){url=document.getElementById("fburl").value;window.open(url,"newRegister","width=600,height=400,top=200,left=200")}function showOptions(a){jQuery(".optionsProducts_"+a).stop(true,true).animate({opacity:"toggle"},"slow")}function OpenPromotionProducts(a){jQuery("#OpenPromotionProducts_Body").load("index.php?do=catalog/promotion.ajax&id="+a);OpenDialog("OpenPromotionProducts")}function OpenProduct(a){jQuery("#OpenProduct_Body").load("index.php?do=catalog/product.ajax&pid="+a);OpenDialog("OpenProduct")}function slideProducts(a,b){var c="slideLeftImage";var d="slideRightImage";var e="slideLeftLink";var f="slideRightLink";var g="slideContent";jQuery("#slideContent").html("");jQuery("#slideLoading").show();for(var h=0;h<midBlockIds.length;h++){jQuery("#midBlock"+midBlockIds[h]).attr("class","")}jQuery("#midBlock"+a).attr("class","ui-tabs-selected");if(b<0){b=0}jQuery.ajax({type:"POST",url:"index.php?do=catalog/showTabMidBlock",data:"midBlock="+a+"&offset="+b,dataType:"json",async:false,success:function(h){var i=h.count;var j=h.template;var k=h.limit;jQuery("#slideLoading").hide();jQuery("#"+g).html(j);if(b+k<i&&b==0){document.getElementById(c).setAttribute("src","images/tabs/pagerleft.gif");document.getElementById(d).setAttribute("src","images/tabs/pagerrighthover.gif");document.getElementById(e).onclick=function(){};document.getElementById(f).onclick=function(){slideProducts(a,b+k)}}else if(b+k<i&&b>0){document.getElementById(c).setAttribute("src","images/tabs/pagerlefthover.gif");document.getElementById(d).setAttribute("src","images/tabs/pagerrighthover.gif");document.getElementById(e).onclick=function(){slideProducts(a,b-k)};document.getElementById(f).onclick=function(){slideProducts(a,b+k)}}else if(i<=k){document.getElementById(c).setAttribute("src","images/tabs/pagerleft.gif");document.getElementById(d).setAttribute("src","images/tabs/pagerright.gif");document.getElementById(e).onclick=function(){};document.getElementById(f).onclick=function(){}}else if(b+k>=i){document.getElementById(c).setAttribute("src","images/tabs/pagerlefthover.gif");document.getElementById(d).setAttribute("src","images/tabs/pagerright.gif");document.getElementById(e).onclick=function(){slideProducts(a,b-k)};document.getElementById(f).onclick=function(){}}}})}function IdeaCompare(a){this.MAX_COMPARE_PRODUCT_COUNT=a;this.infoGroupId=0;this.products=new Array;this.load()}function IdeaCurr(a){this.Currencies=new Array;this.Currencies["YTL"]=3;this.Currencies["TL"]=2;this.DefaultCurr=a}function IdeaCart(){this.productCount=0;this.products=new Hash;if($("hiddenCart")){this.cartTemplate=new Template("")}else{this.cartTemplate=new Template('<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=16><img src="images/arrowblack.gif" width=7 height=8><b> #{product}</b></td><td rowspan=2 align=right valign=top><a href="JavaScript:ideacart1.RemoveFromCart(\'#{pid}\')"><img src="images/xx.gif" border=0></a></td></tr><tr><td height=17><b>#{amount}</b> #{stockTypeLabel} <b style="color:#FF0000; padding-left:10px;">#{price} #{curr}</b></td></tr></table>')}this.lastUpdate="";this.lastId=new Hash}function addSearchLabelToUrl(a){var b="";var c="";if(a=="1"){b="QuickSearch";c=document.getElementById("QuickSearchLabel").value}else if(a=="2"){var c=document.getElementById("QuickSearchBlockLabel").value;b="QuickSearchBlock"}if(c.indexOf("&")==0){c=c.substring(1,c.length)}var d=document.getElementById(b).action;d+="&q="+c.replace("+","%2B");window.location=d;return false}function getPageSize(){var a,b;if(window.innerHeight&&window.scrollMaxY){a=document.body.scrollWidth;b=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){a=document.body.scrollWidth;b=document.body.scrollHeight}else{a=document.body.offsetWidth;b=document.body.offsetHeight}var c,d;if(self.innerHeight){c=self.innerWidth;d=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){c=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else if(document.body){c=document.body.clientWidth;d=document.body.clientHeight}if(b<d){pageHeight=d}else{pageHeight=b}if(a<c){pageWidth=c}else{pageWidth=a}arrayPageSize=new Array(pageWidth,pageHeight,c,d);return arrayPageSize}function HideTooltip(){$("IdeaToolTip").hide()}function ShowTooltipPositioned(a,b,c,d){ttSource=$(b);if($("IdeaToolTip")!=null&&$("IdeaToolTip").visible){tt=$("IdeaToolTip");css=tt.classNames();for(i=0;i<css.length;i++)tt.removeClassName(css[i])}else{tt=document.createElement("div");Element.extend(tt);tt.id="IdeaToolTip";tt.hide();document.body.appendChild(tt);Position.absolutize(tt)}tt.addClassName(ttSource.className);tt.update(ttSource.innerHTML);tt.setStyle({width:ttSource.style.width,height:ttSource.style.height,display:"block","z-index":1050});tt.style.left=Event.pointerX(a)+c+"px";tt.style.top=Event.pointerY(a)+d+"px";tt.makePositioned();tt.show()}function ShowTooltip(a,b){ttSource=$(b);if($("IdeaToolTip")!=null&&$("IdeaToolTip").visible){tt=$("IdeaToolTip");css=tt.classNames();for(i=0;i<css.length;i++)tt.removeClassName(css[i])}else{tt=document.createElement("div");Element.extend(tt);tt.id="IdeaToolTip";tt.hide();document.body.appendChild(tt);Position.absolutize(tt)}tt.addClassName(ttSource.className);tt.update(ttSource.innerHTML);tt.setStyle({width:ttSource.style.width,height:ttSource.style.height,display:"block","z-index":1050});tt.style.left=Event.pointerX(a)+15+"px";tt.style.top=Event.pointerY(a)+"px";tt.makePositioned();tt.show()}function HideMenu(a){$(a).hide()}function ShowMenu2(a){$(a).show()}function ShowDTMenu(a){var b=a.split("_");re=/\d+/g;b.each(function(a){if(a.match(re)){no=a.match(re)}});str="";for(i=0;i<b.length-1;i++){str=str+b[i]+"_"}img="img_"+str.substr(0,str.lastIndexOf("_"))+"_"+no;if($(a).visible()){if(src.indexOf("down")){src=src.replace("down","left")}$(img).src=src;$(a).hide()}else if(!$(a).visible()){$(a).show();src=$(img).src;if(src.indexOf("left")){src=src.replace("left","down")}$(img).src=src}}function ShowMenu(a,b){Element.extend(a);if(a.up().style.position!="absolute"){pos=Position.cumulativeOffset(a);tx=pos[0]+a.getWidth()-0+"px";ty=pos[1]+"px"}else{tx=parseInt(a.up().style.width)-2+"px";hh=0;hx=0;while(a.previous(".MenuItem",hx)!=undefined){hh+=20;hx+=1}ty=hh+"px"}$(b).style.left=tx;$(b).style.top=ty;$(b).show()}function getScrollXY(){var a=0,b=0;if(typeof window.pageYOffset=="number"){b=window.pageYOffset;a=window.pageXOffset}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){b=document.body.scrollTop;a=document.body.scrollLeft}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){b=document.documentElement.scrollTop;a=document.documentElement.scrollLeft}return[a,b]}function getWindowWidth(){var a=0;if(typeof window.innerWidth=="number"){a=window.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){a=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){a=document.body.clientWidth}}}return a}function getWindowHeight(){var a=0;if(typeof window.innerHeight=="number"){a=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight}}}return a}function CloseDialog(a){var b=document.getElementById(a);b.style.display="none";b.style.visibility="hidden";b.style.zIndex=-2;ClosePageOverEffect();if(document.body.style.overflow=="hidden"){document.body.style.overflow="scroll"}}function OpenDialog(a){var b=document.all?1:0;dropdowns=document.getElementsByTagName("select");for(i=0;i<dropdowns.length;i++){elem=dropdowns[i];if(IsDropDownExcluded(elem.getAttribute("id"))){Element.extend(elem);elem.hide()}}document.getElementById("PageOver").style.opacity=0;if(b){document.getElementById("PageOver").style.filter="alpha(opacity=0)";document.getElementById("PageOver").style.display="block"}document.getElementById("PageOver").style.visibility="visible";document.getElementById("PageOver").style.height=getPageSize()[1]+"px";document.getElementById("PageOver").style.width="100%";document.getElementById("PageOver").style.zIndex=1008;var c=new Effect.Opacity("PageOver",{to:.8,duration:.3,transition:Effect.Transitions.linear,afterFinish:function(c){document.getElementById("PageOver").style.zIndex=1008;var d=document.getElementById(a);Element.extend(d);var e=getWindowHeight();var f=getWindowWidth();d.style.position="absolute";d.style.zIndex=1009;d.style.display="block";scrpos=getScrollXY();d.style.left=String(f/2-parseInt(d.getWidth())/2+scrpos[0])+"px";d.style.top=String(e/2-parseInt(d.getHeight())/2+scrpos[1])+"px";d.style.visibility="visible";opendropdowns=$(a).getElementsByTagName("select");for(i=0;i<opendropdowns.length;i++){dropDown=opendropdowns[i];ChangeDropDownStyle(dropDown.getAttribute("id"))}if(d.tagName!="table"||!b){jQuery("#"+a).find("#closeButton").remove();var g=jQuery("<img id='closeButton' onclick='CloseDialog(\""+a+"\")' style='display: inline; position: absolute; right: -11px; top: -11px; z-index: 80; cursor: pointer;' src='images/formdialog/closebox.png'/>");jQuery("#"+a).append(g)}}})}function ClosePageOverEffect(){var a=document.all?1:0;document.getElementById("PageOver").style.zIndex=1008;var b=new Effect.Opacity("PageOver",{to:0,duration:.3,transition:Effect.Transitions.linear,afterFinish:function(){document.getElementById("PageOver").style.zIndex=-5;document.getElementById("PageOver").style.visibility="visible";if(a){document.getElementById("PageOver").style.display="none"}document.getElementById("PageOver").style.height=getPageSize()[1]+"px";document.getElementById("PageOver").style.width="100%";dropdowns=document.getElementsByTagName("select");for(i=0;i<dropdowns.length;i++){elem=dropdowns[i];if(IsDropDownExcluded(elem.getAttribute("id"))){Element.extend(elem);elem.show()}}}});if(a){setTimeout("function() { "+'document.getElementById("PageOver").style.display = "none";'+'document.getElementById("PageOver").style.zIndex = -5;'+'document.getElementById("PageOver").style.visibility = "visible";'+"}",300)}}function ClosePageOver(){var a=document.all?1:0;if(a){document.getElementById("PageOver").style.filter="alpha(opacity=0)";document.getElementById("PageOver").style.display="none"}else{document.getElementById("PageOver").style.opacity=0}document.getElementById("PageOver").style.zIndex=-5}function ChangeDropDownStyle(a){if(!IsDropDownExcluded(a)){jQuery("#"+a).select_skin()}else{};}function IsDropDownExcluded(a){if(a==null||a==""){return true}for(var b=0;b<excludeList.length;b++){exclude=excludeList[b];if(a==exclude){return true}if(exclude.charAt(exclude.length-1)=="*"){excLikeStr=exclude.substring(0,exclude.length-1);if(a.search(excLikeStr)>=0){return true}}}return false}var excludeList=new Array("path","pager","DataGridRPP*","cur_*","status_*","regions*","brandId","category","mb","cpu","ram","q_ram","hda","gpu","kb","mou","dvdw","cdw","mon","sc","spk","cs","fdd","mod","prnt","tvc","os","other","opt1","opt2","opt3","extra3","SearchBrands","catSelectBox*","tokenType");var selectElements=document.getElementsByTagName("select");jQuery(document).ready(function(){var a="";for(var b=0;b<selectElements.length;b++){a=selectElements[b].getAttribute("id");ChangeDropDownStyle(a)}});if(noDrag==undefined)var noDrag=0;var pdrags=new Hash;var DDS=new Array;var totalAmount=0;IdeaCart.prototype.AddToCartBasic=function(a,b,c,d,e,f,g,h,j,k,l){j=unescape(j);if(DDS.length>0&&this.lastId.toArray().length==0&&this.productCount>0){this.products.each(function(a){if(ideacart1.lastId[a.value.pid]==undefined)ideacart1.lastId[a.value.pid]=0;if(a.value.ext>parseInt(ideacart1.lastId[a.value.pid]))ideacart1.lastId[a.value.pid]=a.value.ext})}temp2="";if(DDS.length>0){var m=new Array;for(i=0;i<DDS.length;i++){var n=DDS[i].id;optionLabel=$(n).value;if(optionLabel!="")m.push(optionLabel)}temp2=m.join("/")}if(temp2!=""){b=b+" "+temp2}b=unescape(b);b=unescape(escape(b).replace(/%C2%A0/g,"%20"));b=unescape(escape(b).replace(/%A0/g,"%20"));b=b.replace(/[^0-9a-zA-ZğüşıiöçĞÜŞIİÖÇ\n\t\s\.\*\+&;#,=\[\]{}\(\)\/\\%\$\^\?'"@:<>\-_!€~]/gi,"");if(b.indexOf("}")>0){b=b.replace(/}/gi,"&#125;")}if(b.indexOf("{")>0){b=b.replace(/{/gi,"&#123;")}pid2=a;if(this.lastId[a]&&this.products["pr_"+a+"_"+this.lastId[a]]){exist=false;index=0;for(i=1;i<=this.lastId[a];i++){if(!this.products["pr_"+a+"_"+i])continue;currentel=this.products["pr_"+a+"_"+i]["product"].toString();if(b.toLowerCase()==currentel.toLowerCase()){exist=true;index=i}}if(exist){ext=index}else{this.lastId[a]++;ext=this.lastId[a]}}else{ext=1;this.lastId[a]=1}a=a+"_"+ext;if($("quantity_"+pid2)!=null){if(isNaN(parseFloat($("quantity_"+pid2).value))){alert("Lütfen Stok Adedini Doğru Giriniz.");$("quantity_"+pid2).value=1;return}if(parseFloat($("realamount_"+pid2).value)<parseFloat($("quantity_"+pid2).value)){$("quantity_"+pid2).value=parseInt($("realamount_"+pid2).value)}}if($("cartItem_"+a)!=null){if(this.products["pr_"+a]["amount"]>=parseFloat($("realamount_"+pid2).value)){this.quantityWarn();return}var o=1;if($("quantity_"+pid2)!=null){o=parseFloat($("quantity_"+pid2).value);this.products["pr_"+a]["amount"]=parseFloat(this.products["pr_"+a]["amount"])+o;if(this.products["pr_"+a]["amount"]>=parseFloat($("realamount_"+pid2).value)){this.products["pr_"+a]["amount"]=parseFloat($("realamount_"+pid2).value);this.quantityWarn()}else{if($("hiddenCart")){var p=parseInt($("hiddenCart").value);p=p+parseFloat($("quantity_"+pid2).value);$("hiddenCart").value=p;$("hiddenCartContainer").innerHTML="("+p+")"}}}else{this.products["pr_"+a]["amount"]=parseFloat(this.products["pr_"+a]["amount"])+1;if($("hiddenCart")){var p=parseInt($("hiddenCart").value);p=p+1;$("hiddenCart").value=p;$("hiddenCartContainer").innerHTML="("+p+")"}}pr=parseFloat(this.products["pr_"+a]["price"]);if(f!=0&&g==1||g==0){if(g==0){pr=f}else{pr=pr*(100-f)/100}}pr=pr*(100+e)/100;pr=pr.toFixed(2);total=parseFloat(pr)*parseFloat(this.products["pr_"+a]["amount"]);total=total.toFixed(2);$("cartItem_inner_"+a).innerHTML=this.cartTemplate.evaluate({product:this.products["pr_"+a]["product"].truncate(22,"..."),amount:this.products["pr_"+a]["amount"],pid:a,price:total,curr:d,tax:e,rebate:f,rebateType:g,bt:h,stockTypeLabel:j,rootProduct:l});totalAmount+=parseFloat(ideacurr1.Convert(pr*o,d,ideacurr1.DefaultCurr));totalAmount=parseFloat(totalAmount.toFixed(2))}else{if(parseFloat($("realamount_"+pid2).value)==0)return;this.productCount++;this.products["pr_"+a]=new Hash;if($("quantity_"+pid2)!=null){this.products["pr_"+a]["amount"]=parseFloat($("quantity_"+pid2).value);if(this.products["pr_"+a]["amount"]>=parseFloat($("realamount_"+pid2).value)){this.products["pr_"+a]["amount"]=parseFloat($("realamount_"+pid2).value);this.quantityWarn()}if($("hiddenCart")){var p=parseInt($("hiddenCart").value);p=p+parseFloat($("quantity_"+pid2).value);$("hiddenCart").value=p;$("hiddenCartContainer").innerHTML="("+p+")"}}else{this.products["pr_"+a]["amount"]=1;if($("hiddenCart")){var p=parseInt($("hiddenCart").value);p=p+1;$("hiddenCart").value=p;$("hiddenCartContainer").innerHTML="("+p+")"}}this.products["pr_"+a]["price"]=c;this.products["pr_"+a]["product"]=b;this.products["pr_"+a]["pid"]=pid2;this.products["pr_"+a]["curr"]=d;this.products["pr_"+a]["tax"]=e;this.products["pr_"+a]["rebate"]=f;this.products["pr_"+a]["rebateType"]=g;this.products["pr_"+a]["bt"]=h;this.products["pr_"+a]["ext"]=ext;this.products["pr_"+a]["stockTypeLabel"]=j;this.products["pr_"+a]["rootProduct"]=l;var q=document.createElement("div");Element.extend(q);q.hide();q.id="cartItem_"+a;var r=document.createElement("div");Element.extend(r);r.addClassName("productOnCart");pr=c;if(f!=0&&g==1||g==0){if(g==0){pr=f}else{pr=pr*(100-f)/100}}pr=pr*(100+e)/100;pr=pr.toFixed(2);total=parseFloat(pr)*parseFloat(this.products["pr_"+a]["amount"]);total=total.toFixed(2);totalAmount+=parseFloat(ideacurr1.Convert(pr,this.products["pr_"+a]["curr"],ideacurr1.DefaultCurr))*parseFloat(this.products["pr_"+a]["amount"]);totalAmount=parseFloat(totalAmount.toFixed(2));r.innerHTML=this.cartTemplate.evaluate({product:this.products["pr_"+a]["product"].truncate(22,"..."),amount:this.products["pr_"+a]["amount"],pid:a,price:total,curr:d,stockTypeLabel:j});r.id="cartItem_inner_"+a;q.appendChild(r);if(this.productCount==1)$("CartContainer").innerHTML="";$("CartContainer").appendChild(q);Effect.Appear("cartItem_"+a,{duration:1})}if($("totalCartAmount")){$("totalCartAmount").innerHTML="<b>Toplam :</b> <b style='color:red;'>"+totalAmount+" "+ideacurr1.DefaultCurr+"</b>"}if(DDS.length==0){if(this.products["pr_"+a]["amount"]>=parseFloat($("realamount_"+pid2).value)){if($("addtocart_product")!=null){$("cartPic_"+pid2).src="themes/"+buttonsDir+"/nostock_product.gif"}else{$("cartPic_"+pid2).src="themes/"+buttonsDir+"/nostock.gif"}if(pdrags[pid2])pdrags[pid2].destroy()}var s=document.createElement("div");Element.extend(s);if($("Item_"+pid2)){itemDiv=$("Item_"+pid2)}else if($("Row_"+pid2)){itemDiv=$("Row_"+pid2)}s.innerHTML=itemDiv.innerHTML;document.body.appendChild(s);s.setStyle({position:"absolute",width:itemDiv.getWidth(),overflow:"hidden",backgroundColor:"#FFFFFF"});pos=Position.cumulativeOffset(itemDiv);s.style.left=pos[0]+"px";s.style.top=pos[1]+"px";cartpos=Position.cumulativeOffset($("CartContainer"));new Effect.Parallel([new Effect.MoveBy(s,cartpos[1]-pos[1],cartpos[0]-pos[0],{sync:true}),new Effect.Opacity(s,{sync:true,to:0,from:1,afterFinish:function(a){a.element.remove()}})],{duration:1})}if(k){if(SaveCart(escape(this.products.inspect()),"type=r"))window.location="index.php?do=catalog/order"}else{SaveCart(escape(this.products.inspect()),"type=r")}if($("cartPromotion")!=null){jQuery.get("index.php?do=catalog/ajax&ref=getPromotions",function(a){if(a.length>0){$("cartPromotion").innerHTML=a;$("cartPromotion").show()}else{$("cartPromotion").innerHTML="";$("cartPromotion").hide()}})}};IdeaCart.prototype.AddToCart=function(a,b,c,d,e,f,g,h,i,j,k,l){if(!k){new Ajax.Request("index.php?do=catalog/hasOption&pid="+a,{method:"get",onSuccess:function(k){if(k.responseText=="1"){window.location="index.php?do=catalog/product&pid="+a;return false}else{ideacart1.AddToCartBasic(a,b,c,d,e,f,g,h,i,j,l)}}})}else{ideacart1.AddToCartBasic(a,b,c,d,e,f,g,h,i,j,l)}};IdeaCart.prototype.RemoveFromPage=function(a){Element.extend(a);a.remove()};IdeaCart.prototype.TruncateCart=function(a){this.productCount=0;if($("totalCartAmount"))$("totalCartAmount").innerHTML="";this.products=new Hash;this.FreeCart();SaveCart(escape(this.products.inspect()),"type=e,method=post")};IdeaCart.prototype.FreeCart=function(a){if($("hiddenCart")){$("CartContainer").innerHTML=""}else{$("CartContainer").innerHTML="<center><br/>Alışveriş sepetinizde <br/> ürün bulunmamaktadır.<br/><br/></center>"}};IdeaCart.prototype.RemoveFromCart=function(a){if(this.products["pr_"+a]==undefined)return;pid2=this.products["pr_"+a]["pid"];if(this.products["pr_"+a]){if(this.products["pr_"+a]["amount"]>1){this.products["pr_"+a]["amount"]=this.products["pr_"+a]["amount"]-1;rebate=ideacart1.products["pr_"+a]["rebate"];rebateType=ideacart1.products["pr_"+a]["rebateType"];tax=ideacart1.products["pr_"+a]["tax"];pr=parseFloat(this.products["pr_"+a]["price"]);if(rebate!=0&&rebateType==1||rebateType==0){if(rebateType==0){pr=rebate}else{pr=pr*(100-rebate)/100}}pr=pr*(100+tax)/100;pr=pr.toFixed(2);total=parseFloat(pr)*parseFloat(this.products["pr_"+a]["amount"]);total=total.toFixed(2);totalAmount-=parseFloat(ideacurr1.Convert(pr,ideacart1.products["pr_"+a]["curr"],ideacurr1.DefaultCurr));totalAmount=parseFloat(totalAmount.toFixed(2));curr=this.products["pr_"+a]["curr"];$("cartItem_inner_"+a).innerHTML=this.cartTemplate.evaluate({product:this.products["pr_"+a]["product"].truncate(22,"..."),amount:this.products["pr_"+a]["amount"],pid:a,price:total,curr:this.products["pr_"+a]["curr"],stockTypeLabel:this.products["pr_"+a]["stockTypeLabel"]})}else{curr=this.products["pr_"+a]["curr"];rebate=ideacart1.products["pr_"+a]["rebate"];rebateType=ideacart1.products["pr_"+a]["rebateType"];tax=ideacart1.products["pr_"+a]["tax"];pr=parseFloat(this.products["pr_"+a]["price"]);if(rebate!=0&&rebateType==1||rebateType==0){if(rebateType==0){pr=rebate}else{pr=pr*(100-rebate)/100}}pr=pr*(100+tax)/100;total=parseFloat(pr)*parseFloat(this.products["pr_"+a]["amount"]);total=total.toFixed(2);totalAmount-=parseFloat(ideacurr1.Convert(pr,this.products["pr_"+a]["curr"],ideacurr1.DefaultCurr));totalAmount=parseFloat(totalAmount.toFixed(2));this.products.remove("pr_"+a);this.productCount--;new Effect.Fade("cartItem_"+a,{duration:1,afterFinish:function(a){ideacart1.RemoveFromPage(a.element);if(ideacart1.productCount<1){ideacart1.productCount=0;ideacart1.FreeCart()}}})}if($("cartPic_"+pid2)!=undefined){if($("addtocart_product")!=null){$("cartPic_"+pid2).src="themes/"+buttonsDir+"/addtocart_product.gif"}else{$("cartPic_"+pid2).src="themes/"+buttonsDir+"/addtocart.gif"}if(!noDrag)pdrags[a]=new Draggable("Item_"+pid2,{revert:true,ghosting:false,zindex:1003})}if(this.productCount<1){totalAmount=0}if($("totalCartAmount")){$("totalCartAmount").innerHTML=totalAmount>0?"<b>Toplam :</b> <b style='color:red;'>"+totalAmount+" "+ideacurr1.DefaultCurr+"</b>":"";SaveCart(escape(this.products.inspect()),"type=r,method=post")}}if($("cartPromotion")!=null){jQuery.get("index.php?do=catalog/ajax&ref=getPromotions",function(a){if(a.length>0){$("cartPromotion").innerHTML=a;$("cartPromotion").show()}else{$("cartPromotion").innerHTML="";$("cartPromotion").hide()}})}};IdeaCart.prototype.CompleteRemoveFromCart=function(a){this.products.remove("pr_"+a);this.productCount--;ideacart1.RemoveFromPage($("cartItem_"+a));ideacart1.lastId=new Hash;this.products.each(function(a){ideacart1.lastId[a.value.pid]=a.value.ext});if(ideacart1.productCount<1){ideacart1.productCount=0;ideacart1.FreeCart()}};IdeaCart.prototype.ReloadCart=function(){this.productCount=0;$("CartContainer").innerHTML="";var a=0;var b="";totalAmount=0;this.products.each(function(c){pid=c.key.substring(3);var d=document.createElement("div");Element.extend(d);d.id="cartItem_"+pid;var e=document.createElement("div");Element.extend(e);e.addClassName("productOnCart");pr=parseFloat(ideacart1.products["pr_"+pid]["price"]);rebate=ideacart1.products["pr_"+pid]["rebate"];rebateType=ideacart1.products["pr_"+pid]["rebateType"];tax=ideacart1.products["pr_"+pid]["tax"];if(rebate!=0){if(rebateType==0){pr=rebate}else{pr=pr*(100-rebate)/100}}pr=pr*(100+tax)/100;total=parseFloat(pr)*parseFloat(ideacart1.products["pr_"+pid]["amount"]);if($("hiddenCart")){a=a+parseFloat(ideacart1.products["pr_"+pid]["amount"]);$("hiddenCart").value=a;$("hiddenCartContainer").innerHTML="("+a+")"}total=total.toFixed(2);b=ideacart1.products["pr_"+pid]["curr"];totalAmount+=parseFloat(ideacurr1.Convert(total,b,ideacurr1.DefaultCurr));e.innerHTML=ideacart1.cartTemplate.evaluate({product:ideacart1.products["pr_"+pid]["product"].truncate(22,"..."),amount:ideacart1.products["pr_"+pid]["amount"],pid:pid,price:total,curr:ideacart1.products["pr_"+pid]["curr"],stockTypeLabel:ideacart1.products["pr_"+pid]["stockTypeLabel"]});e.id="cartItem_inner_"+pid;d.appendChild(e);ideacart1.productCount++;$("CartContainer").appendChild(d)});totalAmount=parseFloat(totalAmount.toFixed(2));if(ideacart1.productCount==0){if($("hiddenCart")){$("CartContainer").update("");totalAmount=0}else{$("CartContainer").update("<center><br>Alışveriş sepetinizde <br> ürün bulunmamaktadır.<br><br></center>");if($("totalCartAmount")){$("totalCartAmount").update=""}totalAmount=0}}else{if($("totalCartAmount")){$("totalCartAmount").innerHTML="<b>Toplam :</b> <b style='color:red;'>"+totalAmount+" "+ideacurr1.DefaultCurr+"</b>"}}};IdeaCart.prototype.quantityWarn=function(){if($("quantityWarn")!=null){quantityWarning=quantityWarning.replace("(arg0)",parseFloat($("realamount_"+pid2).value));$("quantityWarn").update(quantityWarning);Effect.Appear("quantityWarn",{queue:{position:"front",scope:"myscope",limit:2},duration:1});Effect.Fade("quantityWarn",{queue:{position:"end",scope:"myscope",limit:2},duration:1})}else{quantityWarning=quantityWarning.replace("(arg0)",parseFloat($("realamount_"+pid2).value));alert(quantityWarning)}};IdeaCurr.prototype.Load=function(a){ideacurr1.Currencies=new Array;var a=a.split("-");var b=new Array;for(var c=0;c<a.length;c++){b=a[c].split("_");ideacurr1.Currencies[b[0]]=parseFloat(b[1])}};IdeaCurr.prototype.Convert=function(a,b,c){if(b=="YTL"){b="TL"}if(c=="YTL"){c="TL"}var d=this.Currencies[b];var e=this.Currencies[c];var f=d/e;var g=a*f;return g.toFixed(4)};IdeaCompare.prototype.addToCompare=function(a){if(this.products.length==this.MAX_COMPARE_PRODUCT_COUNT){return false}pid=parseInt(a.getAttribute("pid"));groupId=parseInt(a.getAttribute("groupid"));if(isNaN(pid)||isNaN(groupId)||pid<=0||groupId<=0){return false}if(this.infoGroupId!=0&&groupId!=this.infoGroupId){return false}this.infoGroupId=groupId;for(var b=0;b<this.products.length;b++){if(this.products[b]==pid){return false}}this.products[this.products.length]=pid;this.updateCookie();this.updateComparePanel()};IdeaCompare.prototype.hasProduct=function(a){for(var b=0;b<this.products.length;b++){if(this.products[b]==a){return true}}return false};IdeaCompare.prototype.updateComparePanel=function(){if(this.products.length!=0){var a=document.getElementsByTagName("input");var b="";for(var c=0;c<a.length;c++){pid=parseInt(a[c].getAttribute("pid"));groupId=parseInt(a[c].getAttribute("groupid"));if(isNaN(pid)||isNaN(groupId)||pid<=0||groupId<=0){continue}b=a[c].getAttribute("id");if(groupId!=this.infoGroupId){$(b).style.visibility="hidden";$(this.nextElementId($(b))).style.visibility="hidden"}$(b).checked=this.hasProduct(pid)}}else{var a=document.getElementsByTagName("input");var b="";for(var c=0;c<a.length;c++){pid=parseInt(a[c].getAttribute("pid"));groupId=parseInt(a[c].getAttribute("groupid"));if(isNaN(pid)||isNaN(groupId)||pid<=0||groupId<=0){continue}b=a[c].getAttribute("id");if(groupId!=this.infoGroupId){$(b).style.visibility="visible";var d=this.nextElementId($(b));if(d){$(d).style.visibility="visible"}}$(b).checked=this.hasProduct(pid)}}};IdeaCompare.prototype.nextElementId=function(a){if(document.all){var b=a.parentNode;var c=b.childNodes;for(var d=0;d<c.length;d++){if(c[d]==a){if(d<c.length-2){return c[d+2].getAttribute("id")}return false}}return false}else{if(a.nextSibling==null){return false}return a.nextSibling.nextSibling.getAttribute("id")}};IdeaCompare.prototype.removeFromCompare=function(a){var b=parseInt(a.getAttribute("pid"));if(isNaN(b)||b<=0){return false}var c=0;while(c<this.products.length&&this.products[c]!=b){c++}if(c<this.products.length){if(this.products.length>1){for(var d=c;d<this.products.length-1;d++){this.products[d]=this.products[d+1]}this.products.length=this.products.length-1}else{this.products=new Array;this.infoGroupId=0}}this.updateCookie();this.updateComparePanel()};IdeaCompare.prototype.load=function(){this.products=this.getCookie("IdeaCompareProducts").split(",");this.infoGroupId=parseInt(this.getCookie("IdeaCompareGroupId").split(","));if(this.products.length>this.MAX_COMPARE_PRODUCT_COUNT||isNaN(this.infoGroupId)||this.infoGroupId<=0){this.products=new Array;this.infoGroupId=0}};IdeaCompare.prototype.updateCookie=function(){this.setCookie("IdeaCompareProducts",this.products.join(","));this.setCookie("IdeaCompareGroupId",this.infoGroupId)};IdeaCompare.prototype.getCookie=function(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end))}}return""};IdeaCompare.prototype.setCookie=function(a,b){var c=new Date;c.setTime(c.getTime()+365*24*60*60*1e3);document.cookie=a+"="+b+"; expires="+c.toGMTString()+"; path=/"};var midBlockIds=new Array;(function(a){a.fn.select_skin=function(b){return a(this).each(function(b){s=a(this);oldParent=s.parent();if(!s.attr("multiple")&&!oldParent.hasClass("cmf-skinned-select")){s.wrap('<div class="cmf-skinned-select"></div>');c=s.parent();c.children().before('<div class="cmf-skinned-text"> </div>').each(function(){if(this.selectedIndex>=0)a(this).prev().text(this.options[this.selectedIndex].innerHTML)});c.width(s.outerWidth()-2);c.height(s.outerHeight()-1);c.css("background-color",s.css("background-color"));c.css("color",s.css("color"));c.css("font-size",s.css("font-size"));c.css("font-family",s.css("font-family"));c.css("font-style",s.css("font-style"));c.css("position","relative");s.css({opacity:0,position:"relative","z-index":100});var d=c.children().prev();d.height(c.outerHeight()-s.css("padding-top").replace(/px,*\)*/g,"")-s.css("padding-bottom").replace(/px,*\)*/g,"")-d.css("padding-top").replace(/px,*\)*/g,"")-d.css("padding-bottom").replace(/px,*\)*/g,"")+2);d.css({opacity:100,overflow:"hidden",position:"absolute","text-indent":"0px","z-index":1,left:0});c.children().click(function(){d.text(this.options!=undefined&&this.options.length>0&&this.selectedIndex>=0?this.options[this.selectedIndex].innerHTML:"")});c.children().change(function(){d.text(this.options!=undefined&&this.options.length>0&&this.selectedIndex>=0?this.options[this.selectedIndex].innerHTML:"")})}})};a.fn.select_unskin=function(b){return a(this).each(function(b){s=a(this);if(!s.attr("multiple")&&s.parent().hasClass("cmf-skinned-select")){s.siblings(".cmf-skinned-text").remove();s.css({opacity:100,"z-index":0}).unwrap()}})}})(jQuery)
