<!-- eServ: 	erservcommon.js								--> 
<!-- 		Basala funktioner i Javascript 1.2						--> 
<!-- 		Av Ola Samuelson, Datalink Nordic AB					--> 
<!--													--> 
<!-- 		Endast funktioner som ALLA sidor skall ha					--> 
<!-- 		får ligga i denna fil.								--> 
<!--													--> 
<!--		Revisionshistoria									--> 
<!-- 		=========================================					--> 
<!-- 		010207		1.0	En första version					--> 


// JavaScript client sniff. 

    function Is ()
{   // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase()

    // --- BROWSER VERSION ---
    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.ie   = (agt.indexOf("msie") != -1)
    this.ie3  = (this.ie && (this.major == 2))
    this.ie4  = (this.ie && (this.major == 4))

    this.opera = (agt.indexOf("opera") != -1)
     
    this.nav4up = this.nav && (this.major >= 4)
    this.ie4up  = this.ie  && (this.major >= 4)

    this.v4up = ((this.nav4up) || (this.ie4up));
    this.nav6 = this.nav && (this.major >= 6)
    this.ie6 = this.ie && (this.major >= 6)
}


var is = new Is();


<!--	Ladda stylesheet beroende på browser		 --> 
  if (is.nav) {
    document.write('<LINK REL="STYLESHEET" TYPE="text/css" HREF="/tns.css">');
  } else {
    document.write('<LINK REL="STYLESHEET" TYPE="text/css" HREF="/tie.css">');   
  }


function printDate(fClass) {
 outString ="";
 now = new Date();
 day = new Object();
 month = new Object();
 day[0] = "Söndag";
 day[1] = "Måndag";
 day[2] = "Tisdag";
 day[3] = "Onsdag";
 day[4] = "Torsdag";
 day[5] = "Fredag";
 day[6] = "Lördag";
 month[0] = "januari";
 month[1] = "februari";
 month[2] = "mars";
 month[3] = "april";
 month[4] = "maj";
 month[5] = "juni";
 month[6] = "juli";
 month[7] = "augusti";
 month[8] = "september";
 month[9] = "oktober";
 month[10] = "november";
 month[11] = "december";
 year = now.getYear();
 if (year < 1000) year += 1900;
 if (now.getDate()>2) outString = "<font class=\""+fClass+"\">"+day[now.getDay()] + " " +now.getDate() + ":e "+" "+ month[now.getMonth()] + "</font>"
else outString = "<font class=\""+fClass+"\">"+day[now.getDay()] + ", " +now.getDate() + ":a "+" "+ month[now.getMonth()] + "</font>";
  return outString;

}





function updatecart(){  
  fullurl="/se/se_bottom.jhtml"
  if (parent.bottom_frame) {
  parent.bottom_frame.location.href=fullurl;
  } else
   top.bottom_frame.location.href=fullurl;
  
}


function cartchangeredirect(theUrl) { 
  if (isSecure()) {
     if (toSecure(theUrl)) parent.main.location.href=theUrl
     else parent.location.href = leaveSecure(theUrl);
  }
  else {
     if (toSecure(theUrl)) parent.location.href=goSecure(theUrl)
        else parent.main.location=theUrl;
  }
}

function leaveSecure(url) {
  var referer=parent.location.href;
  var server=referer.substring(0,referer.indexOf(".com")+4);
  if (server.indexOf("https") != -1) {
     server = "http://w1.363.telia.com/~u36306141/?content="+url;
  } else {
    server=url;
  }

 // alert(server);
  return server;

}

function toSecure(url) {   
  if (url.indexOf("/secure/") != -1) {
     return true;
  } else {
    return false;
  }
}

function goSecure(url) {   
  if (url.indexOf("/secure/") != -1) {
     server = "http://w1.363.telia.com/~u36306141/?content="+url;
  } else {
    server=url;
  }

 // alert(server);
  return server;
}

function isSecure() {
  var referer=parent.location.href;
  var server=referer.substring(0,referer.indexOf(".com")+4);
  if (server.indexOf("https") != -1) {
     return true;
  } else {
    return false;
  }

}

function goToSecure(url) {   
  if (url.indexOf("/secure/") != -1) {
     adress = "http://w1.363.telia.com/~u36306141/?content="+url;
     parent.location.href = adress;
  } else {
    server=url;
    return server;
  }

 // alert(server);

}

function goToleaveSecure(url) {
  var referer=parent.location.href;
  var server=referer.substring(0,referer.indexOf(".com")+4);
  if (server.indexOf("https") != -1) {
     adress = "http://w1.363.telia.com/~u36306141/?content="+url;
     parent.location.href = adress;
  } else {
    server=url;
    return server;
  }

 // alert(server);

}

<!--		Öppnar nytt fönster med vald produkt			--> 
function eProductWindowOpen(theURL,wWidth,wHeight,canScroll,canResize,posX,posY) {
  this.factwindow = eWindowOpener('factwindow',wWidth,wHeight,canScroll,canResize,posX,posY);
  this.factwindow.location.href = theURL;
  this.factwindow.focus(); 
 }

<!--		Öppna fönster med parametrar				--> 
function eWindowOpener(theurl,theWindowName,dX,dY,canScroll,canResize,pX,pY) {
 var ourWindow=null;
 var ourWindowParams='width='+dX+',height='+dY+',scrollbars='+canScroll+',resizable='+canResize+',top='+pY+',left='+pX; 
 ourWindow = window.open(theurl,theWindowName, ourWindowParams);
 if (ourWindow != null) {
  if (ourWindow.opener == null)
   ourWindow.opener = parent;
 }
 return ourWindow; 
}

<!--    Öppnar fönster för att visa waphelpen                  -->
function eImgWin(theURL,dx,dy,openDoc) {
 if (parent.imgwin) {  
 // parent.imgwin.focus();  
 // parent.imgwin.close;
//  parent.imgwin=null;
 }
 
  var newURL = '/../'+theURL;

  parent.imgwin=eWindowOpener(newURL,'imgwin',dx,dy,'no','no','50','30');


  parent.imgwin.resizeTo(dx,dy);
  parent.imgwin.focus();  
}




<!-- 								-->
<!-- Intresserad av flexibla, rationella, kostnadseffektiva	-->
<!-- lösningar för e-handel, business-to-business?		-->
<!--  								-->
<!-- Räkna med full integration: Affärssystem & Logistik	-->
<!-- 								-->
<!-- Kontakta DATALINK NORDIC AB, 036-700 85			-->
<!-- 								-->
<!-- 								-->
<!-- Built on: 							-->
<!-- 								-->
<!--          eServ Java(r) Commerce Suite rev 1.2 		-->
<!--          ====================================		-->
<!--              (c) 1999 Datalink Nordic AB			-->
<!--                 Runs where Java(r) runs 	     		-->
<!--     		- on your server            		-->
<!--     				            		-->
<!--     				            		-->
<!--           Java(r) by Sun and development by        	-->
<!--     	Ola Samuelson and Sven Jonsson          	-->