<!--//--><![CDATA[//><!--

function toggleNewsItem(id, parent) {
	var prnt = document.getElementById(parent);

        var children = prnt.childNodes;
            for(var i=0; i < children.length; i++) {
                children[i].style.display = 'none';
            }

				var state = document.getElementById('news'+id).style.display;
				if (state == 'none') {
					document.getElementById('news'+id).style.display = 'block';
				} else {
					document.getElementById('news'+id).style.display = 'none';
				}
} 

function ToggleSite(){
		var state = document.getElementById('containerdiv').style.display;
		if (state == 'none') {
			document.getElementById('containerdiv').style.display = 'block';
			document.getElementById('enjoylink').firstChild.nodeValue = 'Hide Site -';
		} else {
			document.getElementById('containerdiv').style.display = 'none';
			document.getElementById('enjoylink').firstChild.nodeValue = 'Show Site +';
		}
}
function windowHeight(){
	var alto= 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		alto= window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		alto= document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		alto= document.body.clientHeight;
	}
	return alto;
}

function windowWidth(){
	var alto= 0;
	if( typeof( window.innerHeight ) == 'number' ) {
		alto= window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		alto= document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		alto= document.body.clientWidth;
	}
	return alto;
}

function popUp(URL) {

var swidth = screen.width
var sheight = screen.height
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width="+swidth+",height="+sheight+"');");
}


function BiggerText()
{
	createTextSizeCookie('bigText');
}
function SmallerText()
{
	createTextSizeCookie('smallText');
}
function NormalText()
{
	createTextSizeCookie('normalText');
}
function SetTextSize(value)
{
	var page=document.getElementById('containerdiv') ;
	page.className=value;
}

function ChangePageBackground()
	{
	var val= document.getElementById('aspnetForm').elements['BackgroundDropDownList'].value;
	//var val=document.getElementById('BackgroundDropDownList').selectedIndex.value;
	//alert(val);

	createBackgroundImageCookie(val);
}

function SetPageBackground(value)
{
	document.body.style.backgroundImage = 'url('+value+')';
}

function SetDropDownListValue(val)
{
	document.getElementById('aspnetForm').elements['BackgroundDropDownList'].value = val;
}

function createTextSizeCookie(textSize) 
{

	document.cookie = "textsize="+textSize+"; path=/";
	SetTextSize(textSize);
}

function createBackgroundImageCookie(backgroundImage) 
{

	document.cookie = "backgroundimage="+backgroundImage+"; path=/";
	SetPageBackground(backgroundImage);

	if(backgroundImage == '')
	{
		document.location.href = document.location;
	}
}

function readCookie() 
{
	var nameEQ = "textsize=";
	var nameEQ1 = "backgroundimage=";

	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) 
		{
			var value = c.substring(nameEQ.length,c.length);
			SetTextSize(value);
		}

		if (c.indexOf(nameEQ1) == 0) 
		{
			var value = c.substring(nameEQ.length,c.length);
			if(value != '-1' && value != '' )
			{
				SetPageBackground(value);
				SetDropDownListValue(value);
			}
		}
	}



}

function readCookieBackgroundImage() 
{
	var nameEQ = "backgroundimage=";

	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) 
		{
			var value = c.substring(nameEQ.length,c.length);
			if(value != '-1' && value != '' )
			{
				SetPageBackground(value);
				SetDropDownListValue(value);

			}
		}
	}
//alert(document.cookie);
return value;
}


function readCookieTextSize() 
{
	var nameEQ = "textsize=";

	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) 
		{
			var value = c.substring(nameEQ.length,c.length);
			SetTextSize(value);
		}
	}
return value;
}


function StartPage()
{
readCookieBackgroundImage();
readCookieTextSize();
}

//--><!]]>