
var currentSize=100;
var Path='/includes/sys/countrygif.asp?country=';

function CngMap(obj){
	index=obj.selectedIndex;
	if (index<1){ return; }
	document.getElementById('map').src=Path+obj.options[index].value;
	}

function swap() {
	this.className="msie"
	}

function swapBack() {
	this.className="dropdown"
	}
	
function swapfocus() {
	this.parentNode.parentNode.parentNode.className="msie"
	}
	
function swapblur() {
	this.parentNode.parentNode.parentNode.className="dropdown"
	}
	
function SetupEvents() {

	
	if (document.getElementById){
		
		var cookmenuLI = document.getElementsByTagName("li");
		var totcookmenuLI= cookmenuLI.length;
		
		for(var x=0;x<totcookmenuLI;x++){ 
			if(cookmenuLI[x].parentNode.parentNode.className=="dropdown")
				{
					cookmenuLI[x].firstChild.onfocus=swapfocus;
					cookmenuLI[x].firstChild.onblur=swapblur;
				}
				
			if(cookmenuLI[x].className=="dropdown")	
				{
					cookmenuLI[x].onmouseover=swap;
					cookmenuLI[x].onmouseout=swapBack;
				}
		}
	}
	
	MM_preloadImages()

	if (document.getElementById('PRODUCT2')) {
	document.getElementById('PRODUCT2').focus()
	}
}

function SetupEvents2() {
	if (document.getElementById){
		
		var cookmenuLI = document.getElementsByTagName("li");
		var totcookmenuLI= cookmenuLI.length;
		
		for(var x=0;x<totcookmenuLI;x++){ 
			if(cookmenuLI[x].parentNode.parentNode.className=="dropdown")
				{
					cookmenuLI[x].firstChild.onfocus=swapfocus;
					cookmenuLI[x].firstChild.onblur=swapblur;
				}
				
			if(cookmenuLI[x].className=="dropdown")	
				{
					cookmenuLI[x].onmouseover=swap;
					cookmenuLI[x].onmouseout=swapBack;
				}
		}
	}
	
	MM_preloadImages()

	__utmSetTrans()

}

function setFontSize(ev, percentage, prevent) {
    if (document.getElementsByTagName) {
	currentSize = percentage;
	document.getElementsByTagName("body")[0].style.fontSize = currentSize + '%';

	if (window.event) {
	    window.event.returnValue = false;
	} else {
	    ev.preventDefault();
	}
    }
}


function decreaseFontSize(ev){

	setFontSize(ev, currentSize / 1.10, true);
	currentSize=100/1.10;
	createCookie("size", currentSize, 365);
}

function defaultFontSize(ev){
	
    setFontSize(ev, 100, true);
	currentSize=100;
	createCookie("size", currentSize, 365);
}

function increaseFontSize(ev){
	
    setFontSize(ev, currentSize * 1.10, true);
	currentSize=100*1.10;
	createCookie("size", currentSize, 365);
}

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) {
	SetupEvents()
    var size = readCookie("size");
	if (size) setFontSize(e, size, false);
}

window.onunload = function(e) {
  createCookie("size", currentSize, 365);
}