// JavaScript Document
// Created by Ficient Web Solutions
// Remi R Paquette
// on Aug 13th 2004

function changeLang() {
     var URLstring = document.URL;
     var resLangE = URLstring.match("/en/");
     var resLangF = URLstring.match("/fr/");

     if (resLangE) {
         var URLbefore = URLstring.split("/en/");
         URLstring = URLbefore[0] + "/fr/" + URLbefore[1];
		 window.location = URLstring;
         }
     else if (resLangF) {
         var URLbefore = URLstring.split("/fr/");
         URLstring = URLbefore[0] + "/en/" + URLbefore[1];
		 window.location = URLstring;
         }	
     else {
	   alert('There is an error in the Language Script...');
	 }
     
}

function updateDisplay() {
	var category = document.getElementById("category");
	var displayHP = document.getElementById("displayHP");
	var summary = document.getElementById("summary");
	var photo = document.getElementById("photo");
	var url = document.getElementById("url");
	var type = document.forms[0].type;
	
	if ((type.options[type.selectedIndex].value == '0') ||
		(type.options[type.selectedIndex].value == '1') ||
		(type.options[type.selectedIndex].value == '2') ||
		(type.options[type.selectedIndex].value == '3')){
		category.style.visibility = "visible";
		category.style.display = "inline";
	} else {
		category.style.visibility = "hidden";
		category.style.display = "none";
	}
	if (type.options[type.selectedIndex].value == '1') {
		displayHP.style.visibility = "visible";
		displayHP.style.display = "inline";
	} else {
		displayHP.style.visibility = "hidden";
		displayHP.style.display = "none";
	}
	if (type.options[type.selectedIndex].value == '4') {
		summary.style.visibility = "hidden";
		summary.style.display = "none";
		url.style.visibility = "hidden";
		url.style.display = "none";
		photo.style.visibility = "visible";
		photo.style.display = "inline";						
	} else {
		summary.style.visibility = "visible";
		summary.style.display = "inline";
		url.style.visibility = "visible";
		url.style.display = "inline";
		photo.style.visibility = "hidden";
		photo.style.display = "none";						
	}
}