

		function clearvalue(valueid) {
			document.getElementById(valueid).value='';
			}
			function joinnewsletter() {
			
			if((document.getElementById('newsletter_email').value=='' || document.getElementById('newsletter_fullname').value=='') || 
			(document.getElementById('newsletter_email').value=='Email Address' || document.getElementById('newsletter_fullname').value=='First & Last Name') 
			
			
			) {
			alert('Please enter your first/last name and your email address to continue.');
			} else {
			document.newslettersignupform.submit();
			}
			
			}
			
			

function Set_CookieDay( name, value, expires, path, domain, secure ) {
   // set time, it's in milliseconds
   var today = new Date();
   today.setTime( today.getTime() );
   // if the expires variable is set, make the correct expires time, the
   // current script below will set it for x number of days, to make it
   // for hours, delete * 24, for minutes, delete * 60 * 24
   if ( expires )
   {
      expires = expires * 1000 * 60 * 60;
   }
   //alert( 'today ' + today.toGMTString() );// this is for testing purpose only
   var expires_date = new Date( today.getTime() + (expires) );
   //alert('expires ' + expires_date.toGMTString());// this is for testing purposes only

   document.cookie = name + "=" +escape( value ) +
      ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
      ( ( path ) ? ";path=" + path : "" ) +
      ( ( domain ) ? ";domain=" + domain : "" ) +
      ( ( secure ) ? ";secure" : "" );
}


function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function eraseCookie(name) {
Set_Cookie(name,"",'-1');
}


 
//With the window size & the element size functions built-in
ModalPopup = function (elem,options) {

if(elem=='register') {
embeds = document.getElementsByTagName('embed');
for(i = 0; i < embeds.length; i++) {
embeds[i].style.visibility = 'hidden';
}
objects = document.getElementsByTagName('object');
for(i = 0; i < objects.length; i++) {
objects[i].style.visibility = 'hidden';
}
}


window.scrollTo(0,0);

     // document.getElementById('video_object').style.display = "none";
     //	document.getElementById('video_object').style.visibility = "hidden";

	//option default settings
	options = options || {};
	var HasBackground = (options.HasBackground!=null)?options.HasBackground:true;
	var BackgroundColor = options.BackgroundColor || '#000000';
	var BackgroundOpacity = options.BackgroundOpacity || 75; // 1-100
	BackgroundOpacity = (BackgroundOpacity > 0) ? BackgroundOpacity : 1;
	var BackgroundOnClick = options.BackgroundOnClick || function(){};
	var BackgroundCursorStyle = options.BackgroundCursorStyle || "default";
	//var Zindex = options.Zindex || 9999999;
	var Zindex = 9999999;
	
	var AddLeft = options.AddLeft || 0; //in px
	var AddTop = options.AddTop || 0; //in px

	function _Convert(val) {
		if (!val) {return;}
		val = val.replace("px","");
		if (isNaN(val)) {return 0;}
		return parseInt(val);
	}
	var popup = document.getElementById(elem);
	if (!popup) {return;}
	//set the popup layer styles
	var winW = (document.layers||(document.getElementById&&!document.all)) ? window.outerWidth : (document.all ? document.body.clientWidth : 0);
	var winH = window.innerHeight ? window.innerHeight :(document.getBoxObjectFor ? Math.min(document.documentElement.clientHeight, document.body.clientHeight) : ((document.documentElement.clientHeight != 0) ? document.documentElement.clientHeight : (document.body ? document.body.clientHeight : 0)));
	//display the popup layer
	popup.style.display = "block";
	popup.style.visibility = "visible";
	var currentStyle;
	if (popup.currentStyle)	{ 
		currentStyle = popup.currentStyle; 
	}
	else if (window.getComputedStyle) {
		currentStyle = document.defaultView.getComputedStyle(popup, null);
	} else {
		currentStyle = popup.style;
	}

//alert(popup.offsetWidth);

//	_Convert(currentStyle.marginLeft) -
//  _Convert(currentStyle.marginRight) -


	var elemW = popup.offsetWidth -
	
		_Convert(currentStyle.borderLeftWidth) -
		_Convert(currentStyle.borderRightWidth);

	var elemH = popup.offsetHeight -
		_Convert(currentStyle.marginTop) -
		_Convert(currentStyle.marginBottom) -
		_Convert(currentStyle.borderTopWidth) -
		_Convert(currentStyle.borderBottomWidth);

	popup.style.position = "absolute";

//alert(elemW);
//alert(winW);

	popup.style.left = (winW/2 - elemW/2 + AddLeft) + "px";
	//popup.style.top = (winH/2 - elemH/2 + AddTop - 10) + "px";

    popup.style.top = 150 + "px";
	
	
	popup.style.zIndex = Zindex + 1;

	if (HasBackground) {		
		if (!ModalPopup._BackgroundDiv) {
			ModalPopup._BackgroundDiv = document.createElement('div');
			ModalPopup._BackgroundDiv.id = "_BackgroundDiv";
			ModalPopup._BackgroundDiv.style.display = "none";
			ModalPopup._BackgroundDiv.style.width = "100%";
			ModalPopup._BackgroundDiv.style.position = "absolute";
			ModalPopup._BackgroundDiv.style.top = "0px";
			ModalPopup._BackgroundDiv.style.left = "0px";
			document.body.appendChild(ModalPopup._BackgroundDiv);
		}
		ModalPopup._BackgroundDiv.onclick =  BackgroundOnClick;
		ModalPopup._BackgroundDiv.style.background = BackgroundColor;	
		//ModalPopup._BackgroundDiv.style.height = document.all ? Math.max(Math.max(document.documentElement.offsetHeight, document.documentElement.scrollHeight), Math.max(document.body.offsetHeight, document.body.scrollHeight)) : (document.body ? document.body.scrollHeight : ((document.documentElement.scrollHeight != 0) ? document.documentElement.scrollHeight : 0)) + "px";

		
		ModalPopup._BackgroundDiv.style.height =  1663 + "px";
	


	ModalPopup._BackgroundDiv.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + BackgroundOpacity +")";
		ModalPopup._BackgroundDiv.style.MozOpacity = BackgroundOpacity / 100;
		ModalPopup._BackgroundDiv.style.opacity = BackgroundOpacity / 100;
		ModalPopup._BackgroundDiv.style.zIndex = 9999999;
		ModalPopup._BackgroundDiv.style.cursor = BackgroundCursorStyle;

		//Display the background
		ModalPopup._BackgroundDiv.style.display = "";
	}

}

ModalPopup.Close = function(id) {
	if (id) {

		document.getElementById(id).style.display = "none";
		document.getElementById(id).style.visibility = "hidden";
	} 
	if  (ModalPopup._BackgroundDiv) {
	

	
		ModalPopup._BackgroundDiv.style.display = "none";
		document.getElementById('_BackgroundDiv').style.display="none";
	} else {

	
        document.getElementById('_BackgroundDiv').style.display="none";
	}
}


var browsecount=readCookie('newslettersignup');

if(!browsecount || browsecount=='NaN') {
var browsecount=1;
Set_CookieDay('newslettersignup',browsecount,999999);
ModalPopup('continue');
} else {

}
