function BrowserInfo(){
  this.name = navigator.appName;
  this.codename = navigator.appCodeName;
  this.version = navigator.appVersion.substring(0,4);
  this.platform = navigator.platform;
  this.javaEnabled = navigator.javaEnabled();
  this.screenWidth = screen.width;
  this.screenHeight = screen.height;
	/* ruudun koko*/
	
	this.myWidth = 0, this.myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    this.myWidth = window.innerWidth;
    this.myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    this.myWidth = document.documentElement.clientWidth;
    this.myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    this.myWidth = document.body.clientWidth;
    this.myHeight = document.body.clientHeight;
  }
	
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
handleResize = function () {
	var brinfo = new BrowserInfo();
	
	var myTable = MM_findObj("kehys");	
	var myBottomElem = MM_findObj("alaraja");
	var myRightElem = MM_findObj("oikearaja");

	if(brinfo.myHeight < 622) {

		if(myTable.className != "Table_01alingtop"){
			myTable.className = "Table_01alingtop";
		}
		
		if(myBottomElem.className != "stellap_bottomfieldHide"){
			myBottomElem.className = "stellap_bottomfieldHide";
		}
	}else {
		if(myTable.className != "Table_01alingbottom"){
			myTable.className = "Table_01alingbottom";
		}
		if(myBottomElem.className != "stellap_bottomfield"){
			myBottomElem.className = "stellap_bottomfield";
		}
	}
	
	if(brinfo.myWidth < 900) {

		if(myRightElem.className != "stellap_rightfieldHide"){
			myRightElem.className = "stellap_rightfieldHide";
		}
	}else {
		if(myRightElem.className != "stellap_rightfield"){
			myRightElem.className = "stellap_rightfield";
		}
	}
}


startList = function() {

	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}	
	handleResize();
}	
window.onresize = handleResize;
window.onload=startList;