function getElement(id){
	if(document.all) return document.all[id];
	else return document.getElementById(id);
}


function hide_menu(){
	getElement("TB_window").style.left = "-9999px";
}


function show_menu(){
	var element = getElement("TB_window");
	var width_el = Math.round(removePx(element.style.width));
	var pos = getCenterPos(width_el);
	getElement("TB_window").style.left = pos + "px";
}


function TB_getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight
	arrayPageSize = new Array(w,h) 
	return arrayPageSize;
}


function getCenterPos(width_el){
	var array = TB_getPageSize();
	var width = array[0];
	return width/2 - width_el/2;
}


function removePx(str){
	var len = str.length;
	return str.substr(0,len-2);
}

function center_menu(){
	var element = getElement("TB_window");
	if(element.style.left != "-9999px"){
		show_menu();
	}
}


