function hide(katman) {
	if (document.all) {document.all[katman].style.display="none";}
	else {document.getElementById(katman).style.display="none";}	
}
function show(katman) {
	if (document.all) {	document.all[katman].style.display="block";}
	else {document.getElementById(katman).style.display="block";}	
}
if (document.images) {
    resim1on = new Image();
    resim1on.src = "/Style%20Library/Images/tab1_aan.jpg";
    resim1off = new Image();
    resim1off.src = "/Style%20Library/Images/tab1_uit.jpg";
	resim2on = new Image();
    resim2on.src = "/Style%20Library/Images/tab2_aan.jpg";
    resim2off = new Image();
    resim2off.src = "/Style%20Library/Images/tab2_uit.jpg";
	resim3on = new Image();
    resim3on.src = "/Style%20Library/Images/tab3_aan.jpg";
    resim3off = new Image();
    resim3off.src = "/Style%20Library/Images/tab3_uit.jpg";
	resim4on = new Image();
    resim4on.src = "/Style%20Library/Images/tab4_aan.jpg";
    resim4off = new Image();
    resim4off.src = "/Style%20Library/Images/tab4_uit.jpg";
	resim5on = new Image();
    resim5on.src = "/Style%20Library/Images/tab5_aan.jpg";
    resim5off = new Image();
    resim5off.src = "/Style%20Library/Images/tab5_uit.jpg";
	resim6on = new Image();
    resim6on.src = "/Style%20Library/Images/tab6_aan.jpg";
    resim6off = new Image();
    resim6off.src = "/Style%20Library/Images/tab6_uit.jpg";
	resim7on = new Image();
    resim7on.src = "/Style%20Library/Images/tab7_aan.jpg";
    resim7off = new Image();
    resim7off.src = "/Style%20Library/Images/tab7_uit.jpg";
	resim8on = new Image();
    resim8on.src = "/Style%20Library/Images/tab8_aan.jpg";
    resim8off = new Image();
    resim8off.src = "/Style%20Library/Images/tab8_uit.jpg";
}
function rol(isim) {
    if (document.images) {
        imgOn = eval(isim + "on.src");
        document [isim].src = imgOn;
    }
}
function geri(isim) {
    if (document.images) {
        imgOff = eval(isim + "off.src");
        document [isim].src = imgOff;
    }
}
function gaVoor(nummer) {
	hide("tab_inhoud_1"); hide("tab_inhoud_2"); hide("tab_inhoud_3"); hide("tab_inhoud_4"); hide("tab_inhoud_5");	
	eval("show('tab_inhoud_"+ nummer + "')");	
	geri("resim1"); geri("resim2"); geri("resim3"); geri("resim4"); geri("resim5"); 
	eval("rol('resim"+ nummer + "')");
}

function gaVoorCase(nummer) {
	hide("tab_inhoud_6"); hide("tab_inhoud_7"); hide("tab_inhoud_8");	
	eval("show('tab_inhoud_"+ nummer + "')");	
	geri("resim6"); geri("resim7"); geri("resim8"); 
	eval("rol('resim"+ nummer + "')");
}

function doKeypress(obj, ev){
	var maxLength = obj.getAttribute("maxlen");
	if(maxLength && obj.value.length > maxLength-1){
		if(isFFBrowser())
		{
			ev.stopPropagation();
			ev.preventDefault();
		}
		ev.returnValue = false;
	}
}
// Cancel default behavior
function doBeforePaste(obj, ev){
	var maxLength= obj.getAttribute("maxlen");
	if(maxLength)
	{
		if(isFFBrowser())
		{
			ev.stopPropagation();
			ev.preventDefault();
		}
		ev.returnValue = false;
	}
}
// Cancel default behavior and create a new paste routine
function doPaste(obj, ev){
	var maxLength= obj.getAttribute("maxlen");
	if(maxLength)
	{
		if(isFFBrowser())
		{
			ev.stopPropagation();
			ev.preventDefault();
		}
		ev.returnValue = false;
		maxLength = parseInt(maxLength);
		var oTR = obj.document.selection.createRange();
		var iInsertLength = maxLength - obj.value.length + oTR.text.length;
		var sData = window.clipboardData.getData("Text").substr(0,iInsertLength);
		oTR.text = sData;
	}
}
function isFFBrowser()
{
	return(navigator.userAgent.toLowerCase().indexOf('firefox') != -1);
}

function addHoverEvents()
{
	images = document.getElementsByTagName("img");
	for (i = 0; i < images.length; i++)
	{
		if(images[i].getAttribute("id"))
		{
			if(images[i].getAttribute("id").substr(0, 5) == "email")
			{
				images[i].onmouseover = function(e) {hoverImage(this)};
				images[i].onmouseout = function(e) {unhoverImage(this)};
				images[i].onclick = function(e) {sendEmail(this)};
			}
		}
	}
}

function hoverImage(image)
{
	var path = image.src.substr(0, image.src.lastIndexOf(".png")) + "_Hover.png";
	image.src = path;
}

function unhoverImage(image)
{
	var path = image.src.substr(0, image.src.lastIndexOf("_Hover.png")) + ".png";
	image.src = path;
}

function sendEmail(image)
{
	var email = "";
	
	switch(image.id)
	{
		case "emailinfo":
			email = "mailto:info@levi9.com";
			break;
		case "emailserbia":
			email = "mailto:serbia@levi9.com";
			break;
		case "emailromania":
			email = "mailto:romania@levi9.com";
			break;
		case "emailukraine":
			email = "mailto:ukraine@levi9.com";
			break;
		case "emailturkey":
			email = "mailto:turkey@levi9.com";
			break;
		case "emailbernhard":
			email = "mailto:bernhard@levi9.com";
			break;
		case "emailmenno":
			email = "mailto:menno@levi9.com?subject=Contact via de website";
			break;
		case "emailjobs":
			email = "mailto:jobs@levi9.com";
			break;
		case "emailjobsserbia":
			email = "mailto:jobs-serbia@levi9.com";
			break;
		case "emailjobsromania":
			email = "mailto:jobs-romania@levi9.com";
			break;
		case "emailjobsukraine":
			email = "mailto:jobs-ukraine@levi9.com";
			break;
		case "emailnetherlands":
			email = "mailto:netherlands@levi9.com";
			break;
	}
	
	if(email != "")
		window.location = email;
}