var pyra={v3menu:function(){var b="Type your search here.";if($("#vmj-sinp input").val()==""){$("#vmj-sinp input").addClass("vmj-curly").val(b)}$("#vmj-sinp input").focus(function(){if($(this).val()==b){$(this).val("")}$(this).removeClass("vmj-curly")}).blur(function(){if($(this).val()==""){$(this).addClass("vmj-curly").val(b)}});var a=$("#vmj-cat");$(".vmj-sopbtn").click(function(){$("#vmj-smenu").fadeOut();if(a.css("display")=="none"){a.fadeIn()}else{a.fadeOut()}});$(".vmj_menu").click(function(c){c.stopPropagation()});$(".cid").click(function(){var d=$("#vmj-soptxt span").html();var e="- All Categories -";var c="";if($(".cid:checked").length>0){if($(".cid:checked").length==1&&d==e){c=$(this).next().html()}else{c=$(this).next().html()+", "+d}if($(this).attr("checked")){$("#vmj-soptxt span").html(c)}else{$("#vmj-soptxt span").html($("#vmj-soptxt span").html().replace($(this).next().html()+", ",""));$("#vmj-soptxt span").html($("#vmj-soptxt span").html().replace($(this).next().html(),""))}}else{$("#vmj-soptxt span").html(e)}});$("#vmj-srcfm").submit(function(){if($("#vmj-sbox").val()==""||$("#vmj-sbox").val()==b){alert("Type a search phrase first. e.g. 360 For Men By Perry Ellis");return false}else{return true}});$("#vmj-list li a").mouseover(function(c){});$("#vmj-menu").click(function(c){c.stopPropagation()});$(document).click(function(){a.fadeOut();$("#vmj-smenu").fadeOut("normal",function(){$(this).css("width","1px")})});$("#vmj-list li a").hoverIntent({sensitivity:3,interval:200,over:pyra.expandMenu,timeout:300,out:pyra.bf})},expandMenu:function(){$("#vmj-cat").fadeOut();var a=$(this).attr("id").substr(2,11);$("#vmj-smenu .vmj-smenu-inner").html('<img src="/images/loading.gif" />');$("#vmj-smenu").animate({width:250},50,"linear",function(){$.get("/xml_http_req/vmj_menu_v3",{c:a},function(b){$("#vmj-smenu .vmj-smenu-inner").html(b.documentElement.firstChild.nodeValue)})})},bf:function(){},getDeals:function(){$.get("/xml_http_req/latest_deals",{w:$(".vmj-center").width()},function(a){$("#vmj-deals").html(a.documentElement.firstChild.nodeValue)})},cascade:function(){$(".vui-cascade-header").click(function(){if($(this).hasClass("active")){$(this).removeClass("active");$(this).find(".vui-icon").removeClass("vui-icon-triangle-s").addClass("vui-icon-triangle-e");$(this).next().slideUp("fast")}else{$(this).addClass("active");$(this).find(".vui-icon").removeClass("vui-icon-triangle-e").addClass("vui-icon-triangle-s");$(this).next().slideDown("fast")}});$(".vmj-cascade-refresh").click(function(){var d=$("#vmjurl").val();var a="";var c="";$(".vmcid").each(function(f){if(this.checked){c+="&"+this.name+"="+this.value}});a=c;var b="";$(".vmf").each(function(f){if(this.checked){b+="&"+this.name+"="+this.value}});a+=b;var e="";$(".vmsid").each(function(f){if(this.checked){e+="&"+this.name+"="+this.value}});a+=e;a+=$("#on_sale").attr("checked")?"&on_sale=1":"";a+=$("#free_shipping").attr("checked")?"&free_shipping=1":"";a+="&p_min="+$("#p_min").val();a+="&p_max="+$("#p_max").val();if(a!=""){a="?"+a}location.href="http://"+document.domain+d+a});$(".vui-cascade :checkbox").click(function(){if($(this).attr("checked")){$(this).next().css("text-decoration","underline")}else{$(this).next().css("text-decoration","none")}$(".vui-cascade-hi").fadeIn()});$(".price-range").blur(function(){if($("#p_min").val()!=""&&$("#p_max").val()!=""){$(".vui-cascade-hi").fadeIn()}})},toggleCheckbox:function(a){if($(a).parent().prev().children("input").attr("checked")){$(a).parent().prev().children("input").attr("checked",false);$(a).css("text-decoration","none")}else{$(a).parent().prev().children("input").attr("checked",true);$(a).css("text-decoration","underline")}$(".vui-cascade-hi").fadeIn()},productGroup:function(){$(".vui-prod-image").mouseover(function(){$(this).children(".vui-prod-zoom").show()}).mouseout(function(){$(this).children(".vui-prod-zoom").hide()});$(".vui-prod-himage").mouseover(function(){$(this).children(".vui-prod-zoom").show()}).mouseout(function(){$(this).children(".vui-prod-zoom").hide()});$("#preview-dialog").dialog({bgiframe:true,autoOpen:false,width:500,height:530,draggable:false,modal:true})},productDetails:function(){$("#tabs").tabs();$("#login-reg-dialog").dialog({bgiframe:true,autoOpen:false,width:520,height:480,draggable:false,modal:true});$("#xd-register").submit(function(){$.post("/xml_http_req/register",{f:$("#xd-register [name='firstName']").val(),l:$("#xd-register [name='lastName']").val(),e:$("#xd-register [name='email']").val(),p:$("#xd-register [name='passwd']").val(),pc:$("#xd-register [name='passwd_c']").val(),c:$(".validate-termsAgree").get(0).checked},function(a){if(a.documentElement.childNodes[0].firstChild.nodeValue==1){$("#login-reg-dialog").close()}else{$("#reg-alert").html('<div class="ui-widget"><div style="padding: 0pt 0.7em; margin-top: 20px;" class="ui-state-highlight ui-corner-all"><p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"/><strong>Hey!</strong> '+a.documentElement.childNodes[1].firstChild.nodeValue+"</p></div></div>")}});return false});$("#xd-login").submit(function(){$.post("/xml_http_req/login",{e:$("#xd-login [name='email']").val(),p:$("#xd-login [name='passwd']").val()},function(a){if(a.documentElement.childNodes[0].firstChild.nodeValue==1){$("#login-reg-dialog").dialog("close");$(".review-write-btn").hide();$("#review-fm").show()}else{$("#log-alert").html('<div class="ui-widget"><div style="padding: 0pt 0.7em; margin-top: 20px;" class="ui-state-highlight ui-corner-all"><p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"/><strong>Hey!</strong> '+a.documentElement.childNodes[1].firstChild.nodeValue+"</p></div></div>")}});return false});$(".showlogin").click(function(){$(".login").show();$(".register").hide()});$(".showregister").click(function(){$(".login").hide();$(".register").show()});$(".comment-remove").click(function(){var a=$(this);$.post("/xml_http_req/product_comment_remove",{c:a.get(0).id.substr(4,11)},function(b){if(b.documentElement.firstChild.nodeValue==1){a.parent().parent().fadeOut("fast",function(){$(this).addClass("ui-state-highlight").html("Your product comment has been removed.").fadeIn()})}})});$(".vmj-prod-image-show").mouseover(function(){$(".vmj-prod-image").hide();$("#"+$(this).get(0).id+"-lg").fadeIn()});$("#preview-dialog").dialog({bgiframe:true,autoOpen:false,width:500,height:530,draggable:false,modal:true})},sortStore:function(b){if(b=="all"){$(".stores").show()}else{if(b=="0 - 9"){$(".stores").hide();for(var a=0;a<10;a++){$(".store_"+a).show()}}else{$(".stores").hide();$(".store_"+b).show()}}},previewImg:function(a){$("#preview-dialog").html('<div style="text-align:center;"><img src="'+a+'" /></div>');$("#preview-dialog").dialog("open")},reqPrice:function(a){$.post("/xml_http_req/fm_login_reg/"+a,"",function(b){$("#preview-dialog").html(b.documentElement.firstChild.nodeValue);$("#preview-dialog").dialog("option","title","Join ShopVMJ.com to send a price request.");$("#preview-dialog").dialog("open");$("#x-register").submit(function(){$.post("/xml_http_req/register",{f:$("#x-register [name='firstName']").val(),l:$("#x-register [name='lastName']").val(),e:$("#x-register [name='email']").val(),p:$("#x-register [name='passwd']").val(),pc:$("#x-register [name='passwd_c']").val(),c:$(".validate-termsAgree").get(0).checked},function(c){if(c.documentElement.childNodes[0].firstChild.nodeValue==1){$.post("/xml_http_req/fm_price_request/"+a,"",function(d){$("#preview-dialog").html(d.documentElement.firstChild.nodeValue)})}else{$(".reg-alert").html('<div class="ui-widget"><div style="padding: 0pt 0.7em; margin-top: 20px;" class="ui-state-highlight ui-corner-all"><p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"/><strong>Hey!</strong> '+c.documentElement.childNodes[1].firstChild.nodeValue+"</p></div></div>")}});return false});$("#x-login").submit(function(){$.post("/xml_http_req/login",{e:$("#x-login [name='email']").val(),p:$("#x-login [name='passwd']").val()},function(c){if(c.documentElement.childNodes[0].firstChild.nodeValue==1){$.post("/xml_http_req/fm_price_request/"+a,"",function(d){$("#preview-dialog").html(d.documentElement.firstChild.nodeValue)})}else{$(".log-alert").html('<div class="ui-widget"><div style="padding: 0pt 0.7em; margin-top: 20px;" class="ui-state-highlight ui-corner-all"><p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"/><strong>Hey!</strong> '+c.documentElement.childNodes[1].firstChild.nodeValue+"</p></div></div>")}});return false})})},myaccount:function(){$(".date-picker").datepicker({showOn:"both",buttonImage:"/images/date.gif",buttonImageOnly:true,changeMonth:true,changeYear:true,dateFormat:"yy-mm-dd"});$("#login-form").validate();$("#vcard-add-form").validate({rules:{trn:{minlength:9}}});$("#vcard-add-form img").click(function(){var a=$(this).attr("src");$("#vCardDesign").val(a);$("#vcard-add-form img").removeClass("selected");$(this).addClass("selected")});$("#name-setting-form").validate({rules:{security_code:{required:true,remote:"/captcha/process.php"}}});$("#emailpassword-setting-form").validate({rules:{newpassword:{minlength:6},confirmpassword:{minlength:6,equalTo:"#newpassword"},security_code:{required:true,remote:"/captcha/process.php"}}});$("#secretquestion-setting-form").validate({rules:{confirmanswer:{equalTo:"#newanswer"},security_code:{required:true,remote:"/captcha/process.php"}}});$("#recoverpassword-setting-form").validate({rules:{newpassword:{minlength:6},confirmpassword:{minlength:6,equalTo:"#newpassword"},confirmemail:{equalTo:"#email"},security_code:{required:true,remote:"/captcha/process.php"}}});$("#refer-form").validate();$(".get-contact").click(function(){var c=$(this).attr("rel");var a=$("#"+c+"-username").val();var b=$("#"+c+"-password").val();$(this).attr("disabled","disabled");$(this).attr("value","processing...");$.post("/xml_http_req/refer",{u:a,p:b,pr:c},function(d){$("#"+c+"-results").html(d.documentElement.firstChild.nodeValue);$("#"+c+"-get-contact").removeAttr("disabled");$("#"+c+"-get-contact").attr("value","Get My Contacts");if(d.documentElement.firstChild.nodeValue!="error"){$(".send-contact").removeAttr("disabled")}else{$("#"+c+"-results").html("Unable to get contacts !. Please try again!")}})});$(".printInvoice").click(function(){var a=$(this).attr("id");var b=a.replace(/printInvoice_/,"");window.open("http://mystore.shopvmj.com/xml/getOrderInvoice.php?r="+b,"popWin","width=700,height=500,toolbar=0,location=0,directories=0,status=0,menubar=0,dependent=1,scrollbars=1")});$(".cancelOrder").click(function(){var a=$(this).attr("id");var b=a.replace(/cancelOrder_/,"");location.href="/myaccount/orders/cancel/"+b})},search:function(){$(".vui-prod-image").mouseover(function(){$(this).children(".vui-prod-zoom").show()}).mouseout(function(){$(this).children(".vui-prod-zoom").hide()});$(".vui-prod-himage").mouseover(function(){$(this).children(".vui-prod-zoom").show()}).mouseout(function(){$(this).children(".vui-prod-zoom").hide()});$("#preview-dialog").dialog({bgiframe:true,autoOpen:false,width:480,height:480,draggable:false,modal:true})}};$(document).ready(function(){pyra.v3menu()});