function redirectTo(sPage){
	window.location=sPage;
}

function popupPic(sPicURL) { 
	window.open("imgpopup.html?"+sPicURL, "", "resizable=1,height=200,width=200");
}

function openPopup(URL, width, height){
	window.open(URL,"my_window","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height)
}

function alternate(id){
	if(document.getElementById){
		var table = document.getElementById(id);
		var rows = table.getElementsByTagName("tr");
		for(i = 0; i < rows.length; i++){
			if(i % 2 == 0){
				rows[i].className = "a_RowHighlightOff";
			}else{
				rows[i].className = "a_RowHighlightOn";
			}
		}
	}
}

function checkForm(form_id){
	if(document.getElementById("name").value==""){
		alert("Please fill out your name.");
		document.getElementById("name").focus();
		return false;
	}
	if(document.getElementById("country").value==""){
		alert("Please select a country.");
		document.getElementById("country").focus();
		return false;
	}
	if(document.getElementById("email").value==""){
		alert("Please fill out your email address.");
		document.getElementById("email").focus();
		return false;
	}
	else if(!isValidEmail(document.getElementById("email").value)){
		alert("The email address you specified is not valid.");
		document.getElementById("email").focus();
		return false;
	}
	if(document.getElementById("comment").value==""){
		alert("Please fill out your comment or question.");
		document.getElementById("comment").focus();
		return false;
	}
	//return false;
	return true;
}

function isValidEmail(sEmail){
    var isValid;
	var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    if (!sEmail.match(re)) {
        isValid = false; 
    }
	else {
		isValid = true; 
	}
    return isValid;
}

/*function toggleProdInfo(bttn_id, div_id){
	var oDiv=document.getElementById(div_id);
	var oBttn=document.getElementById(bttn_id);
	if(oDiv.style.display=="none"){
		oDiv.style.display="inline";
		oBttn.src="img/b_collapse.gif";
	}
	else if(oDiv.style.display=="inline"){
		oDiv.style.display="none";
		oBttn.src="img/b_expand.gif";
	}
}*/

function showDivContent(bttn_id, div_id){
	closeAll(div_id);
	var oDiv=document.getElementById(div_id);
	if(oDiv.style.display=="none"){
		oDiv.style.display="inline";
	}
	else if(oDiv.style.display=="inline"){
		oDiv.style.display="none";
	}
}
	
function closeAll(div_id){
	//alert("Hoi");
	oDiv = document.getElementById("div_products");
	oInfoDivs = oDiv.getElementsByTagName('div');
	for (i = 0; i < oInfoDivs.length; i++){
  		if(oInfoDivs[i].id!=div_id){
			oInfoDivs[i].style.display="none";
		}
	}
}