
﻿function changeimage(rowID){var imgObj=$("#img_"+rowID);var zoomObj=$("#zoom_"+rowID);var thisObj=$("#color_"+rowID);var imgSrc=imgObj.attr("src");var imgSplit=imgSrc.split("/");var imgName=imgSplit[imgSplit.length-1];var imgUrl=imgSrc.replace(imgName,"")+thisObj.val()+".jpg";imgObj.attr("src",imgUrl);zoomObj.attr("href",imgUrl.replace("/thumbs",""));imgObj.after("<div class='loadingimg'></div>");$("#img_"+rowID).load(function(){setTimeout(function(){imgObj.parents("td:first").find(".loadingimg").remove();},500);});}
$(document).ready(function(){var _url=document.location.href.toLowerCase();var $selectedLI=null;var _currentIndex=0;if(_url.indexOf("locopopo")>0){$selectedLI=$('.designer-options-gallery ul').find('#navlocopopo');}
if(_url.indexOf("ideaspice")>0){$selectedLI=$('.designer-options-gallery ul').find('#navideaspice');}
if(_url.indexOf("vakils")>0){$selectedLI=$('.designer-options-gallery ul').find('#navvakils');}
if(_url.indexOf("bernadette")>0){$selectedLI=$('.designer-options-gallery ul').find('#navbernadette');}
if(_url.indexOf("magicbus")>0||_url.indexOf("designers")>0){$selectedLI=$('.designer-options-gallery ul').find('#navmagicbus');}
if($selectedLI!==null){$selectedLI.find('.over').show();}
$('.designer-options-gallery ul li').hover(function(){$(this).find('.over').show();if($(this).attr("id")!=$selectedLI.attr("id"))
$selectedLI.find('.over').hide();},function(){if($(this).attr("id")!=$selectedLI.attr("id")){$(this).find('.over').hide();$selectedLI.find('.over').show();}});if($(".magicbus").length>0){var zoomBoxy=new Boxy($("#ZoomView"),{title:" ",modal:true,width:"410px",height:"400px",fixed:false,unloadOnHide:false,show:false,closeText:"X"});var zoomBoxy_6=new Boxy($("#ZoomView6"),{title:" ",modal:true,width:"850px",height:"400px",fixed:false,unloadOnHide:false,show:false,closeText:"X"});var nametext="Please enter your name";var telnumber="";$("#txtmagicname").click(function(){if($(this).val()==nametext){$(this).val("");$("#requiredname").hide();}});$("#txtmagicnumber").click(function(){if($(this).val()==telnumber){$(this).val("");$("#requiredno").hide();}});$("#txtmagicnumber").blur(function(){if($(this).val().length==0){$(this).val(telnumber);}})
$("#txtmagicname").blur(function(){if($(this).val().length==0){$(this).val(nametext);}})
$("#txtmagicname").alphanumeric({allow:"., "});;$("#txtmagicnumber").numeric();$('.productlisting .btn-silver').bind("click",function(){var themeidval;var size
var id=this.id.replace('btn_','');var magicname="";var magicnumber="";var type=true;var theme;var themeprefix;var designer;var designerthemename;if(id==6){theme=$("#color_"+id).val();themeprefix=$("#color_"+id).attr("title");themeidval=themeprefix+"-"+theme;magicname=$("#txtmagicname").val();size=$("#size_"+id).val();magicnumber=$("#txtmagicnumber").val();designer=$("#designer_"+id).attr("title");designerthemename=designer+"-"+$('#size_'+id+' option:selected').text();if($("#txtmagicname").val()==nametext){$("#requiredname").show();type=false;}
else{$("#requiredname").hide();}
if($("#txtmagicnumber").val()==telnumber){$("#requiredno").show();type=false;}
else{$("#requiredno").hide();}
if(type==false){return false;}}
else{theme=$("#color_"+id).val();themeprefix=$("#color_"+id).attr("title");size=$("#size_"+id).val();themeidval=themeprefix+"-"+theme;designer=$("#designer_"+id).attr("title");designerthemename=designer+"-"+$('#size_'+id+' option:selected').text();}
var postData={themeid:themeidval,size:size,magicbusname:magicname,magicbusnumber:magicnumber,DesignerTheme:designerthemename};console.log(postData);$("#loadingajax").css({opacity:0.8,height:$("#main-content").height()});$("#loadingajax").show();$.ajax({type:"POST",url:"MagicbusCart",data:postData,cache:false,dataType:"json",success:function(data){if(data.result==0){window.location.pathname=data.Url;}}});});$(".zoom").click(function(e){if(this.id=="zoom_6"){$("#ZoomViewLoading6").css({opacity:0.8});$("#ZoomViewLoading6").show();e.preventDefault();$("#img_zoomed6").attr("src",$(this).attr("href"));$('#img_zoomed6').load(function(){$("#ZoomViewLoading6").hide();});zoomBoxy_6.center();zoomBoxy_6.show();}
else{$("#ZoomViewLoading").css({opacity:0.8});$("#ZoomViewLoading").show();e.preventDefault();$("#img_zoomed").attr("src",$(this).attr("href"));$('#img_zoomed').load(function(){$("#ZoomViewLoading").hide();});zoomBoxy.center();zoomBoxy.show();}});}
$(CURRENCY).bind('currencyChange',function(args,data){location.reload();});});