function Is() {
    agent		    = navigator.userAgent.toLowerCase();
    this.major		= parseInt(navigator.appVersion);
    this.minor		= parseFloat(navigator.appVersion);
    this.ns			= ((agent.indexOf('mozilla')   !=   -1) && ((agent.indexOf('spoofer')   ==   -1) && (agent.indexOf('compatible') ==   -1)));
    this.ns4		= (this.ns && (this.major      ==    4));
    this.ns6		= (this.ns && (this.major      >=    5));
    this.ie			= (agent.indexOf("msie")       !=   -1);
    this.ie3		= (this.ie && (this.major      < 4));
    this.ie4		= (this.ie && (this.major      ==    4) && (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5		= (this.ie && (this.major      ==    4) && (agent.indexOf("msie 5.0")   !=   -1));
    this.ie55		= (this.ie && (this.major      ==    4) && (agent.indexOf("msie 5.5")   !=   -1));
    this.ie6		= (this.ie && (agent.indexOf("msie 6.0")!=-1) );
}

var is = new Is();

function layerSetup(id,left,top,width,height,zindex,visibility,position) {
  this.obj           	= document.getElementById(id).style;
  this.obj.id        	= document.getElementById(id);
  this.obj.position  	= position;
  this.obj.left      	= left
  this.obj.top       	= top;
  this.obj.width     	= width;
  this.obj.height    	= height;
  this.obj.zIndex    	= zindex;
  this.obj.visibility	= visibility;
  return this.obj;
}

function objectSetup() {
// snags the users browsers dimenensions.
  page              = new Object();
  pageWidth         = (is.ns6) ? innerWidth  : document.body.clientWidth;
  pageHeight        = (is.ns6) ? innerHeight : document.body.clientHeight;
 
 
 // document.getElementById("yhteystiedot_osa").style.font-size = "400px";
  // pageHeight*0,08;
 ow = 814;
 oh = 529;
 pw = 205; // 195
 ph = 34; // 28
 pl = 17; // 17
 
 lefti = pageWidth * (pl/ow);
 leveys = pageWidth * (pw/ow);
 korkeus = pageHeight * (ph/oh);
// layerSetup(id,left,top,width,height,zindex,visibility,position)	
  s_kurssit         = new layerSetup("kurssit_kuva",lefti,(pageHeight *(173/oh)),leveys,korkeus,7,"visible","absolute"); // 168
  s_ilmot         = new layerSetup("ilmot_kuva",lefti,(pageHeight *(222/oh)),leveys,korkeus,7,"visible","absolute"); // 217
  s_email         = new layerSetup("email_kuva",lefti,(pageHeight *(274/oh)),leveys,korkeus,7,"visible","absolute"); // 269
  s_logo         = new layerSetup("logo_kuva",(pageWidth * (32/ow)),(pageHeight *(17/oh)),(pageWidth * (135/ow)),(pageHeight * (135/oh)),7,"visible","absolute"); // 269
/*  s_main         = new layerSetup("main_Layer",0,(pageHeight*0,4),pageWidth,(pageHeight*0,4),7,"visible","absolute");
  s_bottom         = new layerSetup("bottom_Layer",0,pageHeight-(pageHeight*0,2),pageWidth,(pageHeight*0,2),7,"visible","absolute"); */
}

function yhteysSetup(id) {
// snags the users browsers dimenensions.
  page              = new Object();
  pageWidth         = (is.ns6) ? innerWidth  : document.body.clientWidth;
  pageHeight        = (is.ns6) ? innerHeight : document.body.clientHeight;
 //alert ("w: " + pageWidth + " h: " + pageHeight);
  if (id == "index") {
	  document.getElementById("otsikko").style.fontSize = pageHeight*0.05;
	  document.getElementById("ingressi").style.fontSize = pageHeight*0.03;
	  document.getElementById("juttu").style.fontSize = pageHeight*0.02;
	  } else if (id == "etusivu") {
		document.getElementById(id).style.fontSize = pageHeight*0.1;		  
	  } else if (id == "yrityssivu") {
		document.getElementById(id).style.fontSize = pageHeight*0.03;		  
	  } else if (id == "yhteystiedot_osa") {
  		document.getElementById(id).style.fontSize = pageHeight*0.04;
	  } else if (id == "yhteistyokumppanit") {
  		document.getElementById(id).style.fontSize = pageHeight*0.04;
	  }
}

