function productsUN(osoite) {
	var pagelocation = osoite;
	if (pagelocation != '#') {
	 // window.self.name="enstosite";		// name for parent window
    window.open(pagelocation, "EnstoProducts", "left=80, resizable=1, scrollbars=1, location=1, toolbar=1, status=1")
	}
}
function productsEC(osoite) {
	var pagelocation = osoite;
	if (pagelocation != '#') {
	//  window.self.name="enstosite";		// name for parent window
    window.open(pagelocation, "EnstoProducts", "left=80, resizable=1, scrollbars=1, location=1, toolbar=1, status=1")
	}
}
function productsBT(osoite) {
	var pagelocation = osoite;
	if (pagelocation != '#') {
	//  window.self.name="enstosite";		// name for parent window
    window.open(pagelocation, "EnstoProducts", "left=80, resizable=1, scrollbars=1, location=1, toolbar=1, status=1")
	}
}
function popups(osoite,nimi,options) {
	window.self.name="enstosite";		// name for parent window
  window.open(osoite, nimi, options)
}

function popupwindow(osoite,leveys,korkeus,resize,scrolli) {
	window.self.name="enstosite";		// name for parent window
	var leveyss = parseInt(leveys);
	var korkeuss = parseInt(korkeus);
	if (resize) {resize = resize} else {resize = "no"};
	if (scrolli) {scrolli = scrolli} else {scrolli = "no"};
	options =
  "width="+leveyss+",height="+korkeuss+",resizable="+resize+","
+ "screenX=50,screenY=50,"		// netscape
+ "left=50, top=50,"			// IE
+ "location=yes,scrollbars=no,menubar=no,"
+ "toolbar=no,titlebar=no,personalbar=no,"
+ "personalbar=no,directories=no,"
+ "fullscreen=no"; 		// IE only
	window.open(osoite, "EnstoPopup", options);
}

function setActiveStyleSheet(title) {
if (document.getElementsByTagName) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}
}

function getActiveStyleSheet() {
if (document.getElementsByTagName) {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}
}

function getPreferredStyleSheet() {
if (document.getElementsByTagName) {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);


function swapimage(painike) {
  if (painike == 'smaller') {
    document.images.abc1.src = '#';
    document.images.abc2.src = '#';
    document.images.abc3.src = '#';
  } else if (painike == 'normal') {
    document.images.abc1.src = '#';
    document.images.abc2.src = '#';
    document.images.abc3.src = '#';
  } else if (painike == 'bigger') {
    document.images.abc1.src = '#';
    document.images.abc2.src = '#';
    document.images.abc3.src = '#';
  }
}



function abc1() {
if (document.getElementsByTagName) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();

  if (title == 'smaller') {
    document.write('<a href=\"javascript: void(0)\" title=\"Pieni teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'smaller\'); swapimage(\'smaller\'); return false;\"><img src=\"images/b_abc1_on.gif\" name=\"abc1\" id=\"abc1\" alt=\"Pieni teksti\" width=\"30\" height=\"19\" border=\"0\"></a>');
    document.write('<a href=\"javascript: void(0)\" title=\"Normaali teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'normal\'); swapimage(\'normal\'); return false;\"><img src=\"images/b_abc2.gif\" name=\"abc2\" id=\"abc2\" alt=\"Normaali teksti\" width=\"30\" height=\"19\" border=\"0\"></a>');
    document.write('<a href=\"javascript: void(0)\" title=\"Suuri teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'bigger\'); swapimage(\'bigger\'); return false;\"><img src=\"images/b_abc3.gif\" name=\"abc3\" id=\"abc3\" alt=\"Suuri teksti\" width=\"34\" height=\"19\" border=\"0\"></a>&nbsp;&nbsp;<br>');
  } else if (title == 'normal') {
    document.write('<a href=\"javascript: void(0)\" title=\"Pieni teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'smaller\'); swapimage(\'smaller\'); return false;\"><img src=\"images/b_abc1.gif\" name=\"abc1\" id=\"abc1\" alt=\"Pieni teksti\" width=\"30\" height=\"19\" border=\"0\"></a>');
    document.write('<a href=\"javascript: void(0)\" title=\"Normaali teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'normal\'); swapimage(\'normal\'); return false;\"><img src=\"images/b_abc2_on.gif\" name=\"abc2\" id=\"abc2\" alt=\"Normaali teksti\" width=\"30\" height=\"19\" border=\"0\"></a>');
    document.write('<a href=\"javascript: void(0)\" title=\"Suuri teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'bigger\'); swapimage(\'bigger\'); return false;\"><img src=\"images/b_abc3.gif\" name=\"abc3\" id=\"abc3\" alt=\"Suuri teksti\" width=\"34\" height=\"19\" border=\"0\"></a>&nbsp;&nbsp;<br>');
  } else if (title == 'bigger') {
    document.write('<a href=\"javascript: void(0)\" title=\"Pieni teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'smaller\'); swapimage(\'smaller\'); return false;\"><img src=\"images/b_abc1.gif\" name=\"abc1\" id=\"abc1\" alt=\"Pieni teksti\" width=\"30\" height=\"19\" border=\"0\"></a>');
    document.write('<a href=\"javascript: void(0)" title=\"Normaali teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'normal\'); swapimage(\'normal\'); return false;\"><img src=\"images/b_abc2.gif\" name=\"abc2\" id=\"abc2\" alt=\"Normaali teksti\" width=\"30\" height=\"19\" border=\"0\"></a>');
    document.write('<a href=\"javascript: void(0)" title=\"Suuri teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'bigger\'); swapimage(\'bigger\'); return false;\"><img src=\"images/b_abc3_on.gif\" name=\"abc3\" id=\"abc3\" alt=\"Suuri teksti\" width=\"34\" height=\"19\" border=\"0\"></a>&nbsp;&nbsp;<br>');
  } else {
    document.write('<a href=\"javascript: void(0)\" title=\"Pieni teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'smaller\'); swapimage(\'smaller\'); return false;\"><img src=\"images/b_abc1.gif\" name=\"abc1\" id=\"abc1\" alt=\"Pieni teksti\" width=\"30\" height=\"19\" border=\"0\"></a>');
    document.write('<a href=\"javascript: void(0)\" title=\"Normaali teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'normal\'); swapimage(\'normal\'); return false;\"><img src=\"images/b_abc2_on.gif\" name=\"abc2\" id=\"abc2\" alt=\"Normaali teksti\" width=\"30\" height=\"19\" border=\"0\"></a>');
    document.write('<a href=\"javascript: void(0)\" title=\"Suuri teksti\" class=\"button\" onclick=\"setActiveStyleSheet(\'bigger\'); swapimage(\'bigger\'); return false;\"><img src=\"images/b_abc3.gif\" name=\"abc3\" id=\"abc3\" alt=\"Suuri teksti\" width=\"34\" height=\"19\" border=\"0\"></a>');
  }
}
}