
function urlencode(x)
	{
	counter = x.length
	newx = ""
	temp= ""

	for (i=0; i <= counter; i++)
			{
			if (x.substring(i,i+1) == " ")
				newx = newx + "\+";
			else if (x.substring(i,i+1) == "Å")
				newx = newx + "%C5";
			else if (x.substring(i,i+1) == "Ä")
				newx = newx + "%C4";
			else if (x.substring(i,i+1) == "Ö")
				newx = newx + "%D6";
			else if (x.substring(i,i+1) == "å")
				newx = newx + "%E5";
			else if (x.substring(i,i+1) == "ä")
				newx = newx + "%E4";
			else if (x.substring(i,i+1) == "ö")
				newx = newx + "%F6";
			else
				newx = newx + x.substring(i,i+1);
			}

	return(newx);
  }
  function OpenSearch(item_id)
	{	
		var msgwin1=null
		formstring = "item.asp?id="+item_id+"&searchfield="+urlencode(document.searchform.searchfield.value);
	
	 	msgwin1=window.open(formstring,"popup","left=100,top=100,width=290,height=442,scrollbars=yes");

		msgwin1.focus();
		return false;
	}
  function glow(imgDocID,imgObjName) {
    if ((browserVer >= 2 && browserVer <= 9) || browserVer >= 11) {
      document.images[imgDocID].src = eval(imgObjName + ".src")
    }
  }

 browserVer = browsercheck();
  function browsercheck() {
    temp = navigator.userAgent;
    if (temp.indexOf("MSIE")== -1) {
      var tempint = parseInt(temp.charAt(temp.indexOf("/") + 1));
      return (tempint - 1);
    } else if (temp.indexOf("MSIE")!= -1) {
      var tempint = parseInt(temp.charAt(temp.indexOf("/") + 1));
      return (tempint + 8);
    } else {
      // Dunno what browser this is.
      return -1;
    }
  }
  isMac = (navigator.appVersion.indexOf("Mac") != -1)

function Is (){ 
var agt=navigator.userAgent.toLowerCase()
this.major = parseInt(navigator.appVersion)
this.minor = parseFloat(navigator.appVersion)
this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
this.nav2 = (this.nav && (this.major == 2))
this.nav3 = (this.nav && (this.major == 3))
this.nav4 = (this.nav && (this.major == 4))
this.nav4up = this.nav && (this.major >= 4)
this.navonly = (this.nav && (agt.indexOf(";nav") != -1))
this.ie = (agt.indexOf("msie") != -1)
this.ie3 = (this.ie && (this.major == 2))
this.ie4 = (this.ie && (this.major == 4))
this.ie4up = this.ie && (this.major >= 4)
isMac = (navigator.appVersion.indexOf("Mac") != -1)
}

var is = new Is()
if (is.nav4up && !isMac){

document.write('<LINK REL=STYLESHEET HREF="css/b4press_ns.css" TYPE=text/css>');}
if (is.nav4up && isMac){

document.write('<LINK REL=STYLESHEET HREF="css/b4press_ns_mac.css" TYPE=text/css>');}

else if (is.ie4up && !isMac){
document.write('<LINK REL=STYLESHEET HREF="css/b4press_ie.css" TYPE=text/css>');}

else if (is.ie4up && isMac){
document.write('<LINK REL=STYLESHEET HREF="css/b4press_ie_mac.css" TYPE=text/css>');}

