$(document).ready(function(){ 
/** Carousel
*************************/		
function carousel_initCallback(carousel){		

// Pause autoscrolling if the user moves with the cursor over the clip.
carousel.clip.hover(function() {
carousel.stopAuto();
}, function() {
carousel.startAuto();
});
}


jQuery('#game_carousel').jcarousel({
auto: 5,
scroll : 5,
wrap: "both",			
buttonNextHTML: null,
buttonPrevHTML: null,
initCallback: carousel_initCallback
});
}); 

function revealModal()
{
window.onscroll = function () { document.getElementById('modal_Optin').style.top = document.body.scrollTop; };
document.getElementById('modal_Optin').style.display = "block";
document.getElementById('modal_Optin').style.top = document.body.scrollTop;
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
function echeck(str)
{
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
alert("Invalid E-mail Address")
return false
}

if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Invalid E-mail Address")
return false
}

if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Invalid E-mail Address")
return false
}

if (str.indexOf(at,(lat+1))!=-1){
alert("Invalid E-mail Address")
return false
}

if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid E-mail Address")
return false
}

if (str.indexOf(dot,(lat+2))==-1){
alert("Invalid E-mail Address")
return false
}

if (str.indexOf(" ")!=-1){
alert("Invalid E-mail Address")
return false
}

return true					
}

function ValidateForm()
{
var nameID=document.theForm.name;
var emailID=document.theForm.from;

if ((nameID.value==null)||(nameID.value=="")){
alert("Please Enter your First and Last Names")
nameID.focus()
return false
}
if ((emailID.value==null)||(emailID.value=="")){
alert("Please Enter your Email Address")
emailID.focus()
return false
}
if (echeck(emailID.value)==false){
emailID.value=""
emailID.focus()
return false
}

return true
}
function download_instructions()
{
setTimeout('window.location = "/getting-started"',6000);
}
var win=null;function NewWindow(mypage,myname,w,h,scroll,pos){if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';win=window.open(mypage,myname,settings);} 



