$(document).ready(function(){var g=false;if($.browser.msie){g=true}$(".clouds").pan({fps:30,speed:1,dir:"left",depth:10});$("div.nav > ul#nav > li > div.dropdown").hide();$("#topbar > div.content > div.nav > ul#nav > li").hover(function(){$(this).siblings().removeClass("on").find("div.dropdown").hide().find("input#f_login").blur();$(this).addClass("on").find("div.dropdown").show().find("input#f_login").focus();if($(this).index()==2){var b=$(this);$(this).find("#close").one("click",function(){b.removeClass("on").find("div.dropdown").hide();return false})}},function(){if($(this).index()<2){$(this).removeClass("on").find("div.dropdown").hide()}});$("#topbar > div.content > div.nav > ul#nav > li a#forgotpassword").live("click",function(){var o="Forgot your password?";var p="Enter your email address and we will send you an email with a link to reset your password.";var n=$('<input type="text" tabindex="0" class="v-u-y-O-O">');n.watermark_set("Email address");var m=$('<div class="v-u-y-m" />').append(n);var l=$('<div class="c-b c-b-modal c-b-i">Submit</div>');var k=function(q,s,r,b,d){$.ajax({url:"welcome/forgotPassword",type:"POST",data:"e="+n.watermark_get(),success:function(t){if(t=="1"){s.text("Password reset");r.text("An email with instructions has been sent to you. If you do not see it, please check your spam or junk folder.")}else{s.text("Error");if(t=="2"){r.text("You have submitted an invalid email.")}else{r.text("There was an error processing your request.  Please try again later.")}}m.remove();l.hide();d.removeClass("c-b-x").addClass("c-b-i").text("Okay")}})};show_modal("450px",o,p,[m],l,k);return false});$("span.helpBox").hide();$("span#no_invitation").hover(function(){$(this).children("span.helpBox").show().children("input[type=text]").focus()},function(){$(this).children("span.helpBox").hide().children("input[type=text]").blur()});$("span.helpBox > input[type=submit]").click(function(l){var k=$(this),b=k.siblings("input[type=text]"),d=k.parent();$.ajax({url:"welcome/subscribe",type:"POST",dataType:"json",data:"e="+b.val(),success:function(m){if(m=="0"){d.text("You have submitted an invalid email.")}else{if(m=="1"){d.text("Thank you for giving us your email. We'll be sending you an invite as soon as possible!");k.children().remove()}else{if(m=="2"){d.text("There was an error trying to save your email. Please try again later.");k.children().remove()}else{d.text("There was an error processing your request.  Please try again later.");k.children().remove()}}}}});return false});if(typeof account_created!="undefined"){var f="Account created!";var j="We have sent you an email with a link to activate your account. If you do not see it, please check your spam or junk folder.";var c=$('<div class="c-b c-b-modal c-b-i">Okay</div>');var a=function(){};show_modal_no_x("300px",f,j,[],c,a)}$.validator.addMethod("alphaNum",function(d,b){return this.optional(b)||/^[0-9a-zA-Z]+$/.test(d)},"Field must contain only letters and numbers.");$.validator.addMethod("over13",function(l,d){var k=$("#bd").val();var o=$("#bm").val();var n=$("#by").val();var m=new Date();m.setFullYear(n+13,o-1,k);var b=new Date();return(!$("#bd").valid()||!$("#bm").valid()||!$("#by").valid()||b>m)});$.validator.addMethod("validDay",function(d,b){return/([1-9]|[12][0-9]|3[01])/.test(d)});$.validator.addMethod("validMonth",function(d,b){return/([1-9]|1[012])/.test(d)});$.validator.addMethod("validYear",function(d,b){return/(19|20)\d\d$/.test(d)});function h(b){$.ajax({url:"welcome/check_"+b,type:"POST",dataType:"text",data:"l="+$("#reg input#"+b).val(),success:function(d){if(d){$("#error"+b).html("Not available").addClass("error")}else{$("#error"+b).html("Available").removeClass("error")}}})}$("#reg input#email,#reg input#login").bind("keyup blur change paste",function(b){if((((b.keyCode>=43&&b.keyCode<=127)||b.keyCode==8||b.keyCode==127)&&b.type=="keyup")||b.type=="blur"||b.type=="change"||b.type=="paste"){if(($(this).attr("id")=="email"&&/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test($(this).val()))||$(this).attr("id")=="login"&&$(this).val()!=""){h($(this).attr("id"))}else{$("#error"+$(this).attr("id")).html("").removeClass("error")}}});$("form#reg").validate({groups:{bdate:"bd bm by"},errorPlacement:function(b,d){if(d.attr("name")=="gender"){d=d.parent().next()}b.insertAfter(d)},rules:{fname:{required:true,alphaNum:true,minlength:1,maxlength:64},lname:{required:true,alphaNum:true,minlength:1,maxlength:64},email:{required:true,email:true},login:{required:true,alphaNum:true,minlength:1,maxlength:64},pw:{required:true,alphaNum:true,minlength:8,maxlength:64},gender:{required:true},rrc:{required:true}},messages:{fname:{required:"This field is required",minlength:"Your Firstname must consist of at least 1 character",maxlength:"Your Firstname must consist of maximum 64 characters"},lname:{required:"This field is required",minlength:"Your Lastname must consist of at least 1 character",maxlength:"Your Lastname must consist of maximum 64 characters"},email:{required:"This field is required",email:"Incorrect Email"},login:{required:"This field is required",alphaNum:"Must contain only letters and numbers",minlength:"Your Screen Name must consist of at least 1 character",maxlength:"Your Screen Name must consist of maximum 64 characters"},pw:{required:"This field is required",alphaNum:"Must contain only letters and numbers",minlength:"Your Password must consist of at least 8 characters",maxlength:"Your Password must consist of maximum 64 characters"},gender:{required:"This field is required"},rrc:{required:"This field is required"}},errorElement:"p"});$("div.public-info > div.contact > form#contact-form").bind("submit",function(){var l=$(this),d=l.children("p").children("input#n"),b=l.children("p").children("input#e"),k=l.children("p").children("textarea#m");$.ajax({url:"welcome/contact",type:"POST",dataType:"json",data:"n="+d.val()+"&e="+b.val()+"&m="+k.val()+"&Send=Submit",success:function(m){var n=l.prev();if(m=="0"){n.css("color","red");n.text("You have submitted an invalid email.")}if(m=="1"){l.remove();n.css("color","green");n.text("Thank you for contacting us.  You will be hearing from us shortly.")}else{l.remove();n.css("color","red");n.text("There was an error processing your request.  Please try again later.")}}});return false});if($(".overview-features").length>0){var i=false;var e="1-1";ovText=$(".overview-exp").get(parseInt(e.substr(0,1)-1));$(ovText).show();if(($(ovText).children(".features-thumbs").length)>0){ovThumb=$(ovText).children(".features-thumbs").children("a").get(0);$(ovThumb).addClass("sel-link")}ovLink=$(".overview-features .col-l h3 a").get(parseInt(e.substr(0,1)-1));$(ovLink).addClass("sel-link");$("#features-lrg-1-1").show();$(".features-thumbs a").each(function(){$(this).bind({click:function(b){b.preventDefault();if((!($(this).hasClass("sel-link")))&&(!i)){i=true;$("#overview-note").hide();thisEle=$(this);thisPar=$(this).parent().parent(".overview-exp");thisEleIndex=$(thisPar).children(".features-thumbs").children("a").index(thisEle);thisParIndex=$(".overview-exp").index(thisPar);$("#features-lrg-"+e).stop(true).fadeOut("fast",function(){$("#features-lrg-"+e).css("opacity",1);$(".overview-features .features-thumbs a").removeClass("sel-link");thisEle.addClass("sel-link");$("#features-lrg-"+(1+thisParIndex)+"-"+(1+thisEleIndex)).stop(true).fadeIn("fast",function(){e=(1+thisParIndex)+"-"+(1+thisEleIndex);i=false})})}}})});$(".overview-features .col-l h3 a").each(function(){$(this).bind({click:function(b){b.preventDefault();thisEle=$(this);thisPar=$(thisEle).parent().parent().children(".overview-exp");thisParIndex=$(".overview-exp").index(thisPar);if(($(thisPar).css("display")!="block")&&(!i)){i=true;$("#overview-note").hide();prevPar=$(".overview-exp").get((e.substr(0,1)-1));$(".overview-features .col-l h3 a").removeClass("sel-link");$(thisEle).addClass("sel-link");$(prevPar).stop(true).slideUp("fast");$(thisPar).stop(true).slideDown("fast",function(){e=(1+thisParIndex)+"-1";i=false});$("#features-lrg-"+e).stop(true).fadeOut("fast",function(){$("#features-lrg-"+e).css("opacity",1);$(".overview-features .features-thumbs a").removeClass("sel-link");if(($(thisPar).children(".features-thumbs").length)>0){thisThumb=$(thisPar).children(".features-thumbs").children("a").get(0);$(thisThumb).addClass("sel-link")}$("#features-lrg-"+(1+thisParIndex)+"-1").stop(true).fadeIn("fast")})}}})});$(".mag-glass").each(function(){$(this).bind({mouseenter:function(){$("#overview-note").removeClass("note-alt");if(!g){$("#overview-note").css({opacity:0,display:"block"})}thisText=$(this).attr("data-note");$("#overview-note .mid").html(thisText);thisPos=$(this).position();if((thisPos.left)>199){newLeft=(thisPos.left)+220;startLeft=(newLeft-30)}else{$("#overview-note").addClass("note-alt");newLeft=(thisPos.left)+537;startLeft=(newLeft+30)}thisHeight=(parseInt($("#overview-note").height())-9);if(thisHeight>119){newTop=(thisPos.top)-parseInt((thisHeight-119)/2)}else{newTop=((thisPos.top)+parseInt((119-thisHeight)/2)+65)}if(!g){$("#overview-note").css({left:startLeft+"px",top:newTop+"px"});$("#overview-note").stop(true).animate({opacity:1,left:newLeft+"px"},200)}else{$("#overview-note").css({left:newLeft+"px",top:newTop+"px"});$("#overview-note").show()}},mouseleave:function(){thisPos=$(this).position();if((thisPos.left)>199){startleft=(thisPos.left-30)}else{startleft=(thisPos.left+30)}if(!g){$("#overview-note").stop(true).animate({opacity:0,left:startLeft+"px"},200,function(){$("#overview-note").hide()})}else{$("#overview-note").hide()}}})})}});

