ns = (document.layers) ? 1:0
ie = (document.all) ? 1:0
goodbrowser = ((!ns)&&(document.getElementById)) ? 1:0

function navi(e) {
	if(document.all) { key = event.keyCode}
	else if(parseInt(navigator.appVersion) >= 5) { key = e.which } 
	if((key==32)||(key==39)||(key==57376)) 
	{
		if(document.getElementById("next"))
		{
			document.location = document.getElementById("next").getAttribute("href")
		}
	}
	if((key==8)||(key==37)||(key==57375)) 
	{ 
		if(document.getElementById("prev"))
		{
			document.location = document.getElementById("prev").getAttribute("href")
		}
	}
	if((key==38)||(key==57373))
	{
		if(document.getElementById("index")) 
		{
			document.location = document.getElementById("index").getAttribute("href") 
		}
	}
}

function get_width() {
	if (ns||goodbrowser && !ie) { return window.innerWidth }
	else if (ie) {return document.body.offsetWidth }
}

function get_height() {
	if (ns||goodbrowser && !ie) { return window.innerHeight }
	else if (ie) {return document.body.offsetHeight }
}

function main() {
	iframe = document.getElementsByTagName("iframe")[0]
	iframe.setAttribute("src","sender.php?w="+get_width()+"&h="+get_height()+"&s="+filename+"&p="+path+"&id="+id);
}

