// JavaScript Document var pos2=0; var scroll_it=true; var w=646; var max=6;function scrollmain() { if (scroll_it) { $("#holder").animate({left: '-'+(pos2*w)+'px'},'slow'); pos2++; if (pos2==max) { pos2=0; } } } function signup() { var email=$("#email").attr("value"); var name=$("#name").attr("value"); var error=0; if (email==="Email Address" || email==="") { error=1; } if (name==="Full Name" || name==="") { error=1; } if (error==1) { alert("Please enter your name and email address"); return false; } return true; } $(document).ready(function(){ setInterval ( "scrollmain()", 5000 ); $('.product_over').hover(function() { $(this).children("img").stop().animate({opacity:0.0}); }, function() { $(this).children("img").stop().animate({opacity:1.0}); }); $('.clickscroll').click(function() { $("#holder").animate({left: '-'+($(this).attr('href')*w)+'px'},'slow'); return false; }); $('#scrollleft').click(function() { pos2--; if (pos2==-1) { pos2=max-1; } $("#holder").animate({left: '-'+(pos2*w)+'px'},'slow'); return false; }); $('#scrollright').click(function() { pos2++; if (pos2==max) { pos2=0; } $("#holder").animate({left: '-'+(pos2*w)+'px'},'slow'); return false; }); $('.indeximage').hover(function(){ scroll_it=false; }, function() { scroll_it=true; }); $('.menubutton').hover(function(){ $(this).css("background-color","white"); $(this).css("color","#58595B"); }, function() { $(this).css("background-color","#58595B"); $(this).css("color","white"); }); $('.menubutton').click(function(){ var target=$(this).attr("id"); if (target!=="new" && target!="sale" && target!="promo" && target!="look") { $(".item_holder").fadeOut(function(){ $(".item_holder").load("http://www.thechimpstore.com/menu_loader.php?type="+target, function(){ $(".item_holder").fadeIn(); }); }); } else { if (target==="new") { window.location="http://www.thechimpstore.com/newarrivals.php"; } else if (target==="sale") { window.location="http://www.thechimpstore.com/sale.php"; } else if (target==="promo") { window.location="http://www.thechimpstore.com/promoview.php"; } else { window.location="http://www.thechimpstore.com/lookbooks.php"; } } }); $('#name').focus(function(){ if ($(this).attr("value")==="Full Name") { $(this).attr("value", ""); } }); $('#name').blur(function(){ if ($(this).attr("value")==="") { $(this).attr("value", "Full Name"); } }); $('#email').focus(function(){ if ($(this).attr("value")==="Email Address") { $(this).attr("value", ""); } }); $('#email').blur(function(){ if ($(this).attr("value")==="") { $(this).attr("value", "Email Address"); } }); $('#search').focus(function(){ if ($(this).attr("value")==="SEARCH") { $(this).attr("value", ""); } }); $('#search').blur(function(){ if ($(this).attr("value")==="") { $(this).attr("value", "SEARCH"); } }); });