var isOp = navigator.userAgent.indexOf('Opera')>0;		// Opera
var isDom = document.getElementById?true:false;			// IE 5+, Nav 6+, Mozilla 1+
var isOp6 = (isOp&&isDom)?true:false;					// Opera 6+
var isIE = (document.all&&(!isOp6))?true:false;			// IE 4+
var isIE4 = (isIE&&(!isDom))?true:false;				// IE4
var isNav = navigator.appName.indexOf('Netscape')==0;	// Nav, Mozilla
var isNav4 = (isNav&&(!isDom))?true:false;				// Nav 4
var isNav6 = (isNav&&isDom)?true:false;					// Nav 6+
var isMac = navigator.userAgent.indexOf('Mac')>0;		// Mac

function openFlash(flashUrl, title, width, height) {
		var strUrl = "";
		
		strUrl = "ViewFlash.aspx?flashUrl=" + escape(flashUrl)
		strUrl += "&title=" + escape(title)
		strUrl += "&width=" + escape(width)
		strUrl += "&height=" + escape(height)
	
		window.open(strUrl, "ViewFlash", "width=" + width + "px, height=" + height + "px, status=0, scrollbars=0, menu=0, toolbar=0, resizable=0");
}

function searchSite(queryid)
{
	alert(document.getElementById(queryid).value);
}

function openPopup(url, label, width, height, parameters) {
		var strSpecialPosition = "";
		var intOffsetX = 100;
		var intOffsetY = 100;
	
		if(isNav) {
			strSpecialPosition = "screenX="  + (top.screenX + intOffsetX) + ",";
			strSpecialPosition += "screenY="  + (top.screenY + intOffsetY) + ",";
		} else if(isIE) {
			strSpecialPosition = "left="  + (top.screenLeft + intOffsetX) + ",";
			strSpecialPosition += "top="  + (top.screenTop + intOffsetY) + ",";
		} else {
			strSpecialPosition = "";
		}
		
		// Kommenterar bort storleksplaceringen
		strSpecialPosition = "";
		
		window.open(url , '', strSpecialPosition + "width=" + parseInt(width) + "px,height=" + parseInt(height) + "px,status=0,scrollbars=0,menu=0,toolbar=0,resizable=0," + parameters);
	}
	
function openPopup2(url,label,w,h, noScrl) {
	w = getWidth();
	h = getHeight();
	var d = document.getElementById("IframePopupDiv");
	d.height = h;
	var f = d.firstChild;
	f.src = "/";
	f.width = w;
	f.height = h;
	if(noScrl == 'no'){f.scrolling = "no";}
	f.name = "bigDivFrame";		
	f.frameBorder = 0;
	f.allowTransparency = true;	
	f.src = url;	
	f.style.height = h;
	d.style.display = 'block';
	d.style.bottom = 0;
	return false;
}
function getHeight() 
{
   var myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) 
  {
    //Non-IE
    myHeight = window.innerHeight < document.documentElement.scrollHeight ? document.documentElement.scrollHeight : window.innerHeight;
  } 
  else if( document.documentElement &&( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
  {
    //IE 6+ in 'standards compliant mode
    myHeight = document.documentElement.clientHeight < document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.documentElement.clientHeight;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
  {
    //IE 4 compatible
    myHeight = document.body.clientHeight-100;
  }
  return myHeight;
}
function getWidth() 
{
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myWidth = window.innerWidth;
  } 
  else if( document.documentElement &&( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
  {
    //IE 6+ in 'standards compliant mode
    myWidth = document.documentElement.clientWidth;//-60;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
  {
    //IE 4 compatible
    myWidth = document.body.clientWidth-60;
  }
  return myWidth;
}
function closePopup2(id)
{
	var d = document.getElementById(id);
	var f = d.firstChild;
	f.src = "/";
	d.style.display = 'none';
}

	function openURL(url, label, newwindow) {
		var strSpecialPosition = "";
		var intOffsetX = 100;
		var intOffsetY = 100;
	
		if(isNav) {
			strSpecialPosition = "screenX="  + (top.screenX + intOffsetX) + ",";
			strSpecialPosition += "screenY="  + (top.screenY + intOffsetY) + ",";
		} else if(isIE) {
			strSpecialPosition = "left="  + (top.screenLeft + intOffsetX) + ",";
			strSpecialPosition += "top="  + (top.screenTop + intOffsetY) + ",";
		} else {
			strSpecialPosition = "";
		}
		
		// Kommenterar bort storleksplaceringen
		strSpecialPosition = "";
	
		if(newwindow) {
			window.open(url,'',strSpecialPosition);
			//window.open("/pages/relatedfiles_popup.asp?strUrl=" + escape(url) + "&strTitle=" + escape(label) , "view_image", "width=400px, height=300px, status=0, menu=0, toolbar=0, resize=0");
		} else {
			window.location = url;
		}
	}
	
	function openImage(url, label, description) {
		var strSpecialPosition = "";
		var intOffsetX = 100;
		var intOffsetY = 100;
	
		if(isNav) {
			strSpecialPosition = "screenX="  + (top.screenX + intOffsetX) + ",";
			strSpecialPosition += "screenY="  + (top.screenY + intOffsetY) + ",";
		} else if(isIE) {
			strSpecialPosition = "left="  + (top.screenLeft + intOffsetX) + ",";
			strSpecialPosition += "top="  + (top.screenTop + intOffsetY) + ",";
		} else {
			strSpecialPosition = "";
		}
		
		// Kommenterar bort storleksplaceringen
		strSpecialPosition = "";

		window.open("/ViewImage.aspx?strUrl=" + escape(url) + "&strTitle=" + escape(label) + "&strDescription=" + escape(description) , "view_image", strSpecialPosition + "width=620px,height=220px,status=0,scrollbars=0,menu=0,toolbar=0,resizable=0");
	}
	
	function openPrint(url)
	{
		var newWin;
		newWin = window.open(url,'printWin','width=650px,height=580px,location=0,status=0,resizable=1,menubar=1,toolbar=1,scrollbars=1');
		newWin.focus();
	}

