var clipTop = 0;
var clipWidth = 280;
var clipBottom = 110;
var topper = 20;
var lyrheight = 110;
var time,amount,theTime,theHeight,DHTML;

function init()
{
	
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('example');
	
	show('example');
	var winW, winH;
	
	/// to test
	if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
  			winW = window.innerWidth-16;
			winH = window.innerHeight-16;
		 }
 		if (navigator.appName.indexOf("Microsoft")!=-1) {
  			winW = document.body.offsetWidth-20;
  			winH = document.body.offsetHeight-20;
 		}
	}
	
	
	
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	
		var intLeft = winW/2 + 10;
		x.style.clip.left=intLeft;

	
		
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		x.style.clip = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';

		var intLeft = winW/2 + 10;
		x.style.left=intLeft;

	}

		//if the 
	if (screen.width<1024 && screen.height<768)
	{
		vis('visible');
		setTimeout("vis('hidden')",5000);
	}

}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function realscroll()
{
	if (!DHTML) return;
	
	
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;
	if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
	time = setTimeout('realscroll()',theTime);
}

function stopScroll()
{
	if (time) clearTimeout(time);

}

function checkWinSize()
{
	// function to be called by every page to check if the 
	// resoluiton of the page is not 1024 x 768

	if (screen.width<1024 && screen.height<768)
	{

		vis('visible');
		setTimeout("vis('hidden')",5000);
	}
}


function vis(val)
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var f = new getObj('showMsg');
	f.style.visibility = val;
}

function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}



	function getStyleObject(objectId) 
	{
    	// cross-browser function to get an object's style object given its id
	    if(document.getElementById && document.getElementById(objectId)) {
		// W3C DOM
		return document.getElementById(objectId).style;
    	} else if (document.all && document.all(objectId)) {
	 	// MSIE 4 DOM
		return document.all(objectId).style;
	    } else if (document.layers && document.layers[objectId]) {
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
    	} else {
		return false;
    	}
	} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	//we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function hideme(_Option)
{
			changeObjectVisibility(_Option, 'hidden');
}

function show(_Option)
	{
			changeObjectVisibility(_Option, 'visible');
}


// Set the menu

function setMenu(MenuName, leftValue)
{
	
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj(MenuName);
	var winW, winH;
	
	/// to test
	if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
  			winW = window.innerWidth-16;
			winH = window.innerHeight-16;
		 }
 		if (navigator.appName.indexOf("Microsoft")!=-1) {
  			winW = document.body.offsetWidth-20;
  			winH = document.body.offsetHeight-20;
 		}
	}
	
	
	
	if (document.layers)
	{
	
		var intLeft = winW/2 -leftValue;
		x.style.clip.left=intLeft;

	
		
	}
	else if (document.getElementById || document.all)
	{

		var intLeft = winW/2 - leftValue;
		x.style.left=intLeft;

	}

}