
$(document).ready(function(){

	
});

var t=setTimeout("showNewsLetterSignupfrm()",5000);


function showNewsLetterSignupfrm(){
	var shw=getCookie('shownls');	
	
	
	if(shw == ""){
		
		showHide('overFlow');
		showHide('popup');
		aligndiv('popup');	
		
		var stuff = $.ajax({
			type: "GET",
			url: "newsLetterSignupfrm.cfm",
			data: "msg=",
			async: false
		}).responseText;
		
		if(jQuery.trim(stuff) == ""){
			var stuff = $.ajax({
				type: "GET",
				url: "newsLetterSignupfrm.cfm",
				data: "msg=",
				async: false
			}).responseText;
			
			$("#popup").html(stuff);	
		}else{		
			$("#popup").html(stuff);	
		}
		
		
	}else{
		//alert('no');
	}
}

function closeMypopupandRedirect(){
	hidePopup();	
	//nothanks();
	//javascript:history.go(-1);
}


function nothanks(){
	var exdate=new Date();
	var expiredays=1;		
	exdate.setDate(exdate.getDate()+expiredays);				
	document.cookie="shownls=jibu;expires="+exdate.toUTCString();
	hidePopup();
}	






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 deletecook(name){
    var d = new Date();
	document.cookie = ""+name+"='';expires=" + d.toGMTString();
}

function showHide(id){	
	if(document.getElementById(id)) {
		if(document.getElementById(id).style.display == 'none' || document.getElementById(id).style.display == ''){
			document.getElementById(id).style.display = 'inline';
		}
		else{
			document.getElementById(id).style.display = 'none';
		}
	}
}

function hidePopup(){
	$("#overFlow").hide();	
	$("#popup").hide();
}


function aligndiv(Myid){
document.getElementById(Myid).style.top = "50px";
javascript:scroll(0,0);

	  
}
