// © 2002 Til (til_s@myRealbox.com)

var DOM = (document.getElementById)? true : false;
var OP = (window.opera)? true : false;
var OP5 = (OP && DOM)? true : false;
var NS = (window.outerWidth && !OP)? true : false;
var MOZ = (NS && DOM)? true : false;
var NS4 = (NS && !DOM)? true : false;
var IE = (document.all && !OP)? true : false;
var IE5 = (IE && DOM)? true : false;
var IE4 = (IE && !DOM)? true : false;

var WIN=(navigator.userAgent.indexOf('Win')!=-1)? true : false;

var visTrue=(NS4)? "show" : "visible";
var visFalse=(NS4)? "hide" : "hidden";

//var w=(IE)? document.body.clientWidth : window.innerWidth;w=(NS4 && WIN && self!=top)? w+4 : w;
//var h=(IE)? document.body.clientHeight : window.innerHeight;h=(NS4 && WIN && self!=top)? h+4 : h;

function thisObj(Ident)
	{
	if(IE4) {return document.all[Ident].style;}
	else if(DOM) {return document.getElementById(Ident).style;}
	else if(NS4)
		{
		if(document.layers[Ident]) {return document.layers[Ident];}
		else{
		var theLayers=document.layers;
			for(i=0;i<theLayers.length;i++)
				{if(theLayers[i].document.layers[Ident]) {return theLayers[i].document.layers[Ident];break;}}
			}
		}
	else return null;
	}
	
function moveObjTo(objName,x,y) {thisObj(objName).left=x;thisObj(objName).top=y;}
function moveObjBy(objName,x,y)
	{
	thisObj(objName).left=parseInt(thisObj(objName).left)+x;
	thisObj(objName).top=parseInt(thisObj(objName).top)+y;
	}
function showObj(objName) {thisObj(objName).visibility="inherit";}
function hideObj(objName) {thisObj(objName).visibility=visFalse;}

function clipObj(objName,x1,x2,y1,y2)
	{
	if(NS4)
		{
		if(x1!="auto") {thisObj(objName).clip.left=x1;}
		if(x2!="auto") {thisObj(objName).clip.right=x2;}
		if(y1!="auto") {thisObj(objName).clip.top=y1;}
		if(y2!="auto") {thisObj(objName).clip.bottom=y2;}
		}
	else
		{
		if(x1!="auto") {x1=x1+'px ';} else {x1=x1+" ";}
		if(x2!="auto") {x2=x2+'px ';} else {x2=x2+" ";}
		if(y1!="auto") {y1=y1+'px ';} else {y1=y1+" ";}
		if(y2!="auto") {y2=y2+'px ';} else {y2=y2+" ";}
		thisObj(objName).clip="rect("+y1+x2+y2+x1+")";
		}
	}