// Pop-up sivun koon märitys

var d=document, winW=540, winH=400, wd=window.document, nav=navigator;

function whichBrowser() {
	if(d.layers && nav.appName == "Netscape"){
		winW=wd.images["kuva1"].x;
		winH=wd.images["kuva1"].y;
	}
	if(d.all && (nav.userAgent.indexOf('IE') > -1) && nav.userAgent.indexOf('Opera')== -1){
		winW=wd.all['posX'].offsetLeft+20;
		winH=wd.all['posY'].offsetTop+40;
	}
	if(nav.userAgent.indexOf('Opera')!= -1 && wd.all['kuva1'].parentElement){
		winW=wd.all['kuva1'].offsetLeft+16;
		winH=wd.all['kuva1'].parentElement.offsetTop+40;
	}
	if(d.getElementById && !(nav.userAgent.indexOf('IE') > -1)){
		winW=wd.getElementById('posX').offsetLeft+8;
		winH=wd.getElementById('posY').offsetTop+26;
	}
}

function getTheContent(){
	if(d.getElementById && !(nav.userAgent.indexOf('IE') > -1)){
		window.sizeToContent();
	}
	else {
		window.scroll = true;
		window.resizeTo(winW,winH);
	}
}

function setSize(){
	whichBrowser();
	setTimeout('getTheContent()',100);
}

function setSize2(){
	// whichBrowser();
	// setTimeout('getTheContent()',100);
	getTheContent();
}

// Pop-up sivun avaaminen

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Vaihda classia

function change(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}

// Avaa - Sulje

function toggle(o,id){
document.getElementById(id).className = (o.checked) ? "table blue" : "hide";
}
function toggle2(o,id){
document.getElementById(id).className = (o.checked) ? "hide-txt" : "hide";
}
function toggle3(o,id){
document.getElementById(id).className = (o.checked) ? "table" : "hide";
}
function toggle4(o,id){
document.getElementById(id).className = (o.checked) ? "table" : "hide";
}

function openHTTPURL(url){
	var newURL="http://" + self.location.host +  url;
	window.status = newURL;
	self.location = newURL

}
function openHTTPSURL(url){
	var newURL="https://" + self.location.host + url;
	window.status = newURL;
	self.location = newURL
}