// JavaScript Document



function hidediv() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideShow').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideShow.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideShow.style.visibility = 'hidden'; 
} 
} 
}

function showdiv() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideShow').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideShow.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideShow.style.visibility = 'visible'; 
} 
} 
} 





	
function closeNewsletter() {
		$("#newsletter").hide("");		
		
		}
	
	
function adjustModalForm()
{
					modal_form_width = 350;
					modal_form_height = 290;
					client_height = document.documentElement.clientHeight;
					client_width = document.documentElement.clientWidth;
					xPos = (client_width / 2) - (modal_form_width / 2);
					xPos = xPos > 0 ? xPos : 0;
					yPos = (client_height / 2) - (modal_form_height / 2);
					yPos = yPos > 0 ? yPos : 0;
					$("#modal_form").css({ top: yPos, left: xPos });
}

function adjustModalBackground()
{
				min_width = 775;
					
					client_height = document.documentElement.clientHeight;
					client_width = document.documentElement.clientWidth;
					scroll_width = document.documentElement.scrollWidth;
					client_width = document.documentElement.clientWidth;
					modal_bg_width = scroll_width > client_width ? client_width : scroll_width;
					modal_bg_width = min_width > modal_bg_width ? min_width : modal_bg_width;
					scroll_height = document.documentElement.scrollHeight;
					client_height = document.documentElement.clientHeight;
					if( $.browser.safari ) {
						scroll_height = document.body.scrollHeight;
						client_height = document.body.clientHeight;
					}
					modal_bg_height = scroll_height > client_height ? scroll_height : client_height;
					
					$("#modal_overlay").css({ height: modal_bg_height, width: modal_bg_width });
}

		
$(document).ready(function(){
					
					
	adjustModalForm();
	adjustModalBackground();
					
});
				
				
		
$(window).resize(function(event) {
					
		adjustModalBackground();				
		adjustModalForm();
				
});
		
	
	
	
	
	
	
$(window).load(function() {

	
	if( !get_cookie('newsletterCookie'))
	{
		$('#newsletter').show();
	}
	else
	{
		//delete_cookie('newsletterCookie');
	}
	
};		
		
		