﻿function switch_state(divId){
	
		if(document.getElementById(divId).style.display == 'none'){
			new Effect.BlindDown(document.getElementById(divId));
		} else {
			new Effect.BlindUp(document.getElementById(divId));
		}
	}

var contentHeight;
var height;

function setFooter()
{	
	var el = document.getElementById('footer');
	
	// Get client specific height
	if( typeof(window.innerWidth ) == 'number')// NON IE
		height = window.innerHeight;
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))//IE 6+ in 'standards compliant mode'
		height = document.documentElement.clientHeight;
	else if(document.body && (document.body.clientWidth || document.body.clientHeight))//IE 4 compatible
		height = document.body.clientHeight;
	
	// Set it all
	if (height > contentHeight)
		el.style.paddingTop = height - contentHeight  + 'px';
	else
		el.style.paddingTop = 0 + 'px'; // Special case substraction
}

window.onload = function() {
	// We need to get max height the first time its loaded. AND ONLY THE FIRST TIME!
	var el = document.getElementById('wrapper');
	contentHeight = el.offsetHeight;
	setFooter();
	
	// Insert line for each PNG image needing IE& Tranparancy fix
	fixMIE(document.getElementById('asian'));
	fixMIE(document.getElementById('logo'));
}

window.onresize = function() {
	setFooter();
}


function fixMIE(el)
{
	if (navigator.appVersion.indexOf("MSIE 6.0") != -1) 
	{
		var tImg = el;
		var imgWidth = tImg.width;
		var imgHeight = tImg.height;
		
		tImg.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + tImg.src + "', sizingMethod='scale')";
		tImg.src = 'images/transparent.gif';
		tImg.height = imgHeight;
		tImg.width = imgWidth;
	}
}