var winW = 630, winH = 460;
var navi = "";
var cDivHeight = 0;
var show = new Array(); 
var show2 = new Array(); 

winW = f_clientWidth();
winH = f_clientHeight();

if (parseInt(navigator.appVersion)>3) {

 if (navigator.appName.indexOf("Microsoft")!=-1) {
	 navi = "Microsoft";
 }
 else 
 {
		 navi = "Netscape";
 }
}

function start()
{
	newW = (10+parseInt(winW*(820.2/1280))) + "px";
	cDivHeight = parseInt(winH*(519.8/850));
	newH = parseInt(winH*(519.8/850)) + "px";	
	newX = parseInt(winW*(448.1/1280)) + "px";	
	newY = parseInt(winH*(19/850)) + "px";	
	document.getElementById("cDiv").style.left = newX;
	document.getElementById("cDiv").style.top = newY;
	document.getElementById("cDiv").style.width = newW;
	document.getElementById("cDiv").style.height = newH;

	newX = parseInt(winW*(159.8/1280)) + "px";	
	newY = parseInt(winH*(313.8/850)) + "px";	
	document.getElementById("education").style.left = newX;
	document.getElementById("education").style.top = newY;	
	
	newX = parseInt(winW*(182/1280)) + "px";	
	newY = parseInt(winH*(394.2/850)) + "px";	
	document.getElementById("information").style.left = newX;
	document.getElementById("information").style.top = newY;	
	
	document_show("cDiv");
	setTimeout ("fixScroll()",200);
}

function fixScroll()
{
	if(document.getElementById("mainPage").offsetHeight>cDivHeight)
	{
	  document.getElementById("cDiv").style.overflowY = "scroll";
	}
}
function scrollToTop()
{
	window.scroll(0,0); 
}


/* 
 * The Id of the category to be sawn is 'cat'+id
 * the id of the linked raquo image is 'linkCat'+id 
 */
function showCatDiv(id)
{
	show2[id] = 1;
	document_show(id);
}

function showCatDiv2(id)
{
	show[id] = 1;
	document_show(id);
}

function hideCatDiv2(id)
{
	show[id] = 0;
  if(show2[id]!=1)
  {
	  document_hide(id);	  
  }
}


function hideCatDiv(id)
{
  show2[id] = 0;
  if(show[id]!=1)
  {
	  document_hide(id);
  }
}

function findPosX(obj)
{
  var curleft = 0;
  if(obj.offsetParent)
      while(1) 
      {
        curleft += obj.offsetLeft;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.x)
      curleft += obj.x;
  return curleft;
}

function findPosY(obj)
{
  var curtop = 0;
  if(obj.offsetParent)
      while(1)
      {
        curtop += obj.offsetTop;
        if(!obj.offsetParent)
        {
          break;
        }
        obj = obj.offsetParent;
      }
  else if(obj.y)
  {
      curtop += obj.y;
  }
  return curtop;
}

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}

function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

