// common.js

function showSubmenu(elem){ showElem("submenu_" + elem); }
function hideSubmenu(elem){ hideElem("submenu_" + elem); }
function showOriSpan(elem){ showElem("orispan_" + elem); }
function hideOriSpan(elem){ hideElem("orispan_" + elem); }
function showHotSpan(elem){ showElem("hotspan_" + elem); }
function hideHotSpan(elem){ hideElem("hotspan_" + elem); }

function hideElem(elem){
	document.getElementById(elem).style.display = "none";
}

function showElem(elem){
	document.getElementById(elem).style.display = "block";
}

function showElemVisibility(elem){
	document.getElementById(elem).style.visibility = "visible";
}

function hideElemVisibility(elem){
	document.getElementById(elem).style.visibility = "hidden";
}

function alertWindowSize(){
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	//var leftDespliegue = (myWidth - 490) / 2;
	//alert ("leftDespliegue: " + leftDespliegue);
	window.alert( 'Width = ' + myWidth + '\nHeight = ' + myHeight );
}

function getWindowWidth(){
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	}
	return myWidth;
}
