$(document).ready(function(){ $("h2.toggle:not(.active)").next().hide(); $("h2.toggle").click(function(){ $(this).toggleClass("active").next().slideToggle("fast"); $(this).parent().siblings().children(".toggle").removeClass("active").next().slideUp("fast"); }); $(".faq h3:not(.active)").next().hide(); $(".faq h3").click(function(){ $(this).toggleClass("active").next().slideToggle("fast"); }); $('.jqzoom').jqzoom({ zoomType: 'standard', lens:true, preloadImages: true, zoomWidth: 220, title: true, hideEffect:"fadeout", preloadText:"Loading Zoom", }); $(" a[rel^='lightbox']").prettyPhoto({ animation_speed:'normal', theme:'light_rounded', slideshow:3000, deeplinking: false, social_tools:false, gallery_markup:"", keyboard_shortcuts: false }); $.easing.custom = function (x, t, b, c, d) { var s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; } $(".featured .slider").scrollable({easing: 'custom', speed: 700, circular: true}).navigator(".featured .navi").autoscroll(); //$(".featured > .slider > .items > img").css("cursor", "pointer" ); $(".wide-slider").each(function(){ $(".slider", this).scrollable({circular: false}).navigator(".navi", this); }); $(".mini-slider").each(function(){ $(".slider", this).scrollable({circular: false}).navigator(".navi", this); }); /*$("#sidebar .categories ul").children().hover(function(){ $(this).siblings().stop().fadeTo(500,0.5); },function(){ $(this).siblings().stop().fadeTo(500,1); });*/ $(".categories ul").superfish({ animation: {height:'show'}, // slide-down effect without fade-in delay: 100, autoArrows: true, }); $("#top-tools-nav .login a").click(function(){ $("#top-tools-nav .login").toggleClass("active"); $("#top-tools-nav .login .login-box").slideToggle(); if ($.cookie('Username')){ $("#login_box > input[name='Password']").focus() }else{ $("#login_box > input[name='Username']").focus() } return false; }); $("#main-header span.advanced-search").click(function(){ $(this).next().slideToggle(); }); // login box.. $('#login_box').submit(function() { var loginData = $(this).serialize(); $("#login_box_ajax").fadeIn("fast"); $("#login_box_message").html(""); $.ajax({ type: "POST", url: "ajax/users.php?action=login" , data: loginData, success: function(data) { if (data == "true"){ var Username = $("#login_box > input[name='Username']").val(); $.cookie('Username', Username); $("#login_box_message").html("Please wait..").css("color", "green").animate({width:"220px"}, {duration: 'fast', easing: 'easeOutBounce'}); location.href=location.href; }else{ $("#login_box_message").html("Invalid Login").css("color", "red").animate({width:"220px"}, {duration: 'slow', easing: 'easeOutBounce'}); } $("#login_box_ajax").fadeOut("fast"); }, error: function(){ } }); return false; }); $("#advanced_search").validate({ rules: { "Search": { minlength:3}, "PriceFrom":{number:true}, "PriceTo":{number:true} }, messages: { "Search": "", "PriceFrom":"", "PriceTo":"" } }); // get Username from Cookie! if ($.cookie('Username')){ $("#login_box > input[name='Username']").val($.cookie('Username')); } }); function ForgetPassword(){ $("#ajax_forget_form").validate({ rules: { "EMail": { required: true,email: true }, }, messages:{ "EMail": "", } }); if ($("#ajax_forget_form").valid() == false){ $(".forget_form_error").html("Invalid E-mail Address").fadeIn("slow").css("display", "block"); return false; } var Code = $("#ajax_forget_form").serialize(); $.ajax({ type: "POST", url: "ajax/ForgetPassword.php?action=doforget" , data: Code, success: function(data) { if (data == "false"){ $(".forget_form_error").html("This E-mail Is not in our database").fadeIn("slow").css("display", "block"); }else{ $(".forget_form_error").html("$Lang['ForgetPassword_Sent'] .").fadeIn("slow").css("display", "block"); $("#ajax_forget_form").slideUp("slow"); } }, error: function(){ } }); return false; } function ChnagePasswd(){ $("#ajax_chnagepasswd_form").validate({ rules: { "OldPassword": { required: true,minlength:6}, "Password": { required: true ,minlength:6}, "PasswordV": { required: true, equalTo: "#Password"}, }, messages:{ "OldPassword": "", "Password": "", "PasswordV": "" } }); if ($("#ajax_chnagepasswd_form").valid() == false){ $(".chnagepasswd_form_error").html("Please Complete All Fildes above").fadeIn("slow").css("display", "block"); return false; } var Code = $("#ajax_chnagepasswd_form").serialize(); $.ajax({ type: "POST", url: "ajax/users.php?action=dochangepasswd" , data: Code, success: function(data) { if (data == "invalid_old_password"){ $(".chnagepasswd_form_error").hide().html("Invalid current Password").fadeIn("slow").css("display", "block"); return false; } if (data == "true"){ $(".chnagepasswd_form_error").html("Password Changed").fadeIn("slow").css("display", "block"); $("#ajax_chnagepasswd_form").slideUp(); } }, error: function(){ } }); return false; } function ChargeAccount(){ $("#ajax_charge_form").validate({ rules: { "ChrageCode": { required: true,number: true , range: [100000000000, 999999999999]}, }, messages:{ "ChrageCode": "", } }); if ($("#ajax_charge_form").valid() == false){ $(".charge_form_error").html("Invalid Secret Code").fadeIn("slow").css("display", "block"); return false; } $(".charge_form_error").html(""); var Code = $("#ajax_charge_form").serialize(); $.ajax({ type: "POST", url: "ajax/users.php?action=docharge" , data: Code, success: function(data) { if (data == "false"){ $(".charge_form_error").html("Invalid Secret Code").fadeIn("slow").css("display", "block"); }else if (data == "Banned"){ $("#ajax_charge_form").slideUp("slow"); $(".charge_form_error").html("Banned").fadeIn("slow").css("display", "block"); }else{ $(".charge_form_error").html("Account Charged").fadeIn("slow").css("display", "block"); $("#ajax_charge_form").slideUp("slow",function(){ location.href = "http://www.egyshops.com/store/?Account"; }); } }, error: function(){ } }); return false; } function ActiveForm(){ $("#ajax_activation_code_form").validate({ rules: { "ActiveCode": { required: true ,number: true , range: [10000, 99999]} }, messages:{ "ActiveCode": "" } }); if ($("#ajax_activation_code_form").valid() == false){ $(".activation_code_form_error").fadeIn("slow").css("display", "block"); return false; } $.prettyPhoto.close(); $('.not-active').fadeTo("fast",0.2,function(){ $(this).html("Wait...").fadeTo("fast",1) }); var Code = $("#ajax_activation_code_form").serialize(); $.ajax({ type: "POST", url: "ajax/users.php?action=doactive&" , data: Code, success: function(data) { if (data == "true"){ $('.not-active').fadeTo("fast",0.2,function(){ $(this).html("Verified").fadeTo("fast",1).removeClass("not-active"); location.href=location.href; }); }else{ $('.not-active').fadeTo("fast",0.2,function(){ $(this).html("Invalid verfication codeEnter Received Code").fadeTo("fast",1); $(" a[rel^='lightbox']").prettyPhoto({ animation_speed:'normal', theme:'light_rounded', deeplinking: false, social_tools:false, gallery_markup:"" }); }); } }, error: function(){ } }); return false; } function BuyWithPoints(ItemID){ $("#buywithpoints_div_buy").html("Please Wait.."); $.ajax({ type: "POST", url: "ajax/BuyWithPoints.php?ItemID="+ItemID , data: "ItemID="+ItemID, success: function(data) { if (data == "true"){ $("#buywithpoints_div_buy").html("Thanks for your order, We will contact you soon.."); return false; }else{ $("#buywithpoints_div_buy").html("Error!"); return false; } }, error: function(){ } }); return false; }