
function clickIE4(){
if (event.button==2){

return false;
}
}
 
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){

return false;
}
}
}


if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
 
document.oncontextmenu=new Function("return false")

function showLanguage()
{
	if (document.getElementById('language').style.display == 'block')
	{
		hideLanguage();
	}
	else
	{
		document.getElementById('language').style.display = 'block';
		document.getElementById('language_arrow').src = 'images/arrow_down.jpg';
		sIFR.replace(GothamRoundedBook, {
		  selector: '.topnav_item',
		  offsetTop: 2,
		  preventWrap: true,
		  css: ['.sIFR-root { color: #948177; font-size:10px; cursor:pointer;}', 'a {text-decoration:none; color:#948177}', 'a:hover {text-decoration:none; color:#948177}']
		});
	}
}

function hideLanguage()
{
	document.getElementById('language').style.display = 'none';
	document.getElementById('language_arrow').src = 'images/arrow_right.jpg';
}


function showMenu(menuId)
{
	document.getElementById('menu_'+menuId+'_1').src='images/menu_left_on.png';
	document.getElementById('menu_'+menuId+'_2').className='menu_on';
	document.getElementById('menu_'+menuId+'_3').src='images/menu_right_on.png';
}

function hideMenu(menuId)
{
	document.getElementById('menu_'+menuId+'_1').src='images/menu_left_off.png';
	document.getElementById('menu_'+menuId+'_2').className='menu_off';
	document.getElementById('menu_'+menuId+'_3').src='images/menu_right_off.png';
}

function rotateImage()
{
	imageCar.beginTransitions();
}

function changeImage(nr)
{
	if (nr != imageCar.options.currentImageIndex-1)
	{
		window.clearInterval(timeout);

		imageCar.options.currentImageIndex = nr;
		imageCar.beginTransitions();

		timeout = window.setInterval(rotateImage, 5000);
	}
}

function resetBrands()
{
	document.getElementById('logo_1').src = "images/brand_oilily_off.jpg";
	document.getElementById('logo_2').src = "images/brand_hagoort_off.jpg";
	document.getElementById('logo_3').src = "images/brand_quick_off.jpg";
	document.getElementById('logo_4').src = "images/brand_pip_off.jpg";
}

function highlightSub(arg)
{
	str = arg.id;
	Arrow = str.replace("subnav_","");
	document.getElementById('arrow_'+Arrow).src = "images/arrow_sub_on.jpg";
}

function dehighlightSub(arg)
{
	str = arg.id;
	Arrow = str.replace("subnav_","");
	document.getElementById('arrow_'+Arrow).src = "images/arrow_sub_off.jpg";
}


function URLDecode(encoded)
{
	var HEXCHARS = "0123456789ABCDEFabcdef";
	var plaintext = "";
	var i = 0;
	while (i < encoded.length) 
	{
		var ch = encoded.charAt(i);
		
		if (ch == "+") 
		{
			plaintext += " ";
			i++;
		} 
		else if (ch == "%") 
		{
			if (i < (encoded.length-2) && HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 && HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) 
			{
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			}
			else 
			{
				//alert( 'Bad escape combination near ...' + encoded.substr(i) );
				//plaintext += "%[ERROR]";
				i++;
			}
		} 
		else 
		{
			plaintext += ch;
			i++;
		}
	}
	return(plaintext);
}
