// function shows/hides choosen layer
function layerShow(id){
	var el = getElement (id);

	// on start - layer may not has set visibilty
	if (el.style.visibility =="")
		el.style.visibility = "visible";
	
	// switch visibility	
	if (el.style.visibility=="hidden")
		el.style.visibility = "visible";
	else
		el.style.visibility = "hidden";		
} 
// gets element by id
function getElement (id){
	return document.getElementById ? document.getElementById(id): document.all? document.all[id]: null;
}  

function openWindow(pageHref,width,height,windowName){
	var	leftPos = 10;
	var	topPos  = 10;
	
	if (document.body != null){
		leftPos = (document.body.clientWidth-width)/2;
		topPos  = (document.body.clientWidth-height)/2 - 200;
	}
	window.open(pageHref,windowName,'top='+topPos+',left='+leftPos+',width='+width+',height='+height+',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
} 

function setSize(width, height) {
	window.resizeTo(width,height);
	return;
} 
