$(document).ready(function(){ 
	
	Cufon.replace('#menu li a:not(".current")', {
		fontFamily: 'VAGRounded BT',
		letterSpacing: '-0.8px',
		fontWeight: 'normal',
		hover: {
			color: '#000'
		}
	});
	
	Cufon.replace('#menu li a.current', {
		fontFamily: 'VAGRounded BT',
		letterSpacing: '-0.8px',
		fontWeight: 'normal'
	});
	
	Cufon.replace('#download p', {
		fontFamily: 'VAGRounded BT',
		letterSpacing: '-0.8px',
		fontWeight: 'normal'
	});
	
	Cufon.replace('#content_col h1', {
		fontFamily: 'VAGRounded BT',
		letterSpacing: '-0.8px',
		fontWeight: 'normal',
		color: '-linear-gradient(#f5c24f, #f1e297, #c7852b, #e8af3d)',
		textShadow: '2px 1px rgba(0, 0, 0, 0.4)'
	});
	
	function swopInputText(e){
		var emailInput = $(e+' .inputText');	
		var origEmail = emailInput.val();	
		emailInput.focus(function(){
			if( $(this).val() == origEmail ){
				$(this).val('')		
			}		
		}),
		emailInput.blur(function(){
			if( $(this).val() == '' ){
				$(this).val(origEmail)		
			}
		});
	}
	
	if ($('#download').length > 0 ){
		swopInputText('#download');
	}
	if ($('#download_content').length > 0 ){
		swopInputText('#download_content');
	}
	
	
});

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
}
dltrack.location.href = "/dltrack";
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);}
