/*function resize() {
	frameWidth=0;
	frameHeight=0;
		height = screen.availHeight;
		width = screen.availWidth;
	
	if (self.innerWidth)
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}
	//document.write("h="+frameHeight+",w="+frameWidth);
	obj = document.styleSheets[0].cssRules[0].style;
	obj.mainframe.height=600;
	//alert(obj.height);
}*/

function setSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
    //alert("IE6+ h="+myHeight);
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
    //alert("IE4 h="+myHeight);
  }
  obj = document.getElementById('mainframe');
  obj.style.height=myHeight-220; // drar ifrån höjden på flashmenyn
}

function isIE() {
	if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		alert("IE");
		//return true;
	} else {
		alert("FF");
		//return false;
	}
}

function showDiv() {
	id = document.getElementById("alt")
	id.style.height=100;
}

function showPage(menu,url,task) {
	//top.mainframe.location.href=url;
	top.location.href=url+"?menu="+menu+"&task="+task;
}

function checkAndRedirect(server,url) {
	// Kollar om man hamnat på sajten via en undersida och skickar besökaren
	// vidare till huvudsidans framework
	
	/*
	top_url = top.location.href;
	//alert("url="+top_url);
	//alert("page url="+url);
	if (top_url.indexOf("index.asp?p=") < 0) {
		// Sidan är inte laddad i framesettet
		a = url.split("/");
		page_url = a[a.length-1]; // Hitta sidans namn
		//top.location.href="http://"+server+"/nyhemsida/index.asp?p="+page_url;
		showPage(page_url);
	}
	*/
}

function checkVote() {
	f = document.getElementById("voteform")
	
	for (var i=0; i < f.cgrade.length; i++) {
	   if (f.cgrade[i].checked) {
	      var rad_val = f.cgrade[i].value;
	   }
	}

	if (isNaN(rad_val)) {
		alert("Du måste välja ett betyg 1-5 för att kunna rösta");
	} else {
		f.chosengrade.value=rad_val;
		f.submit();
	}
}

function hiLite(obj) {
	obj.style.border="3px solid #EC8B0E";
	//obj.style.margin="4px 2px 0px 5px";
}

function loLite(obj) {
	obj.style.border="3px solid #FFFFFF";
	//obj.style.margin="4px 2px 0px 5px";
}