var state = 0;

function maindiv(){
	fsdiv = document.getElementById('fs');
	
	if (typeof window.addEventListener != 'undefined'){
		fsdiv.style.width = window.innerWidth + 'px;';
		fsdiv.style.height = window.innerHeight + 'px;';
	}else if (typeof document.addEventListener != 'undefined'){
		fsdiv.style.width = document.body.clientWidth + 'px;';
		fsdiv.style.height = document.body.clientHeight + 'px;';
	}else if (typeof window.attachEvent != 'undefined'){
		fsdiv.style.width = document.body.clientWidth;
		fsdiv.style.height = document.body.clientHeight;
	}
}

if (typeof window.addEventListener != 'undefined'){
	window.addEventListener('load', maindiv, false);
	window.addEventListener('resize', maindiv, false);
}else if (typeof document.addEventListener != 'undefined'){
	document.addEventListener('load', maindiv, false);
	document.addEventListener('resize', maindiv, false);
}else if (typeof window.attachEvent != 'undefined'){
	window.attachEvent('onload', maindiv);
	window.attachEvent('onresize', maindiv);
}else{
	//
}
function changeState(id){

	if (document.getElementById(id).style.display == 'none'){
		dis = '';
		img = 'block';
	}else{
		dis = 'none';
		img = dis;
	}
	if (state != 1){
		document.getElementById(id).style.display = dis;
		document.getElementById(id + '_bar').src = '/_layout/bar-'+ img +'.gif';
	}

}
function displayDiv(id,set,img,s){
	
	document.getElementById('fs').style.display = '';	
	document.getElementById('fs').style.width = document.body.scrollWidth + 'px';
	document.getElementById('fs').style.height = document.body.scrollHeight + 'px';

	document.getElementById(id).style.display = '';	
	
	new Ajax.Updater(id,id + '.php',{parameters:{set:set,img:img,s:s}});
	scrollTo(0,0);
	state = 1;
}
function hideDiv(id){
	document.getElementById('fs').style.display = 'none';	
	document.getElementById(id).style.display = 'none';		
	document.getElementById(id).innerHTML = '';
	state = 0;	
}
function showInfo(){
	document.getElementById('infotext').style.display = '';
}
function hideInfo(){
	document.getElementById('infotext').style.display = 'none';
}