
function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility


function hideAll() {
    // note: we've stored the currently-visible popup on the global object window.currentlyVisiblePopup
    //if(window.currentlyVisiblePopup) {
	//changeObjectVisibility(window.currentlyVisiblePopup, 'hidden');
	//window.currentlyVisiblePopup = false;
	
	var styleObject = getStyleObject('menu_village'); styleObject.visibility = 'hidden';
	var styleObject = getStyleObject('menu_dojo'); styleObject.visibility = 'hidden';
	var styleObject = getStyleObject('menu_tea'); styleObject.visibility = 'hidden';
	var styleObject = getStyleObject('menu_garden'); styleObject.visibility = 'hidden';
	return true;
		
    
} // hideCurrentPopup



function toggleObjectVisibility(objectId) {
    // get a reference to the cross-browser style object and make sure the object exists
   hideAll(); // Hide all Div
   
   
   var styleObject = getStyleObject(objectId);
    if(styleObject) {
    		if(styleObject.visibility=='visible') {
    			styleObject.visibility = 'hidden';
    			return true;
    		}
    		else {
    			styleObject.visibility = 'visible';
    			return true;
    		}
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility




function SelectLg(lg) {
	
	document.Selection.lg.value="lg";

}

function SelectCon(con) {
	
	document.Selection.con.value="con";

}

function SelectLg(lg) {

	// Initialisation des boutons
	var styleObject = getStyleObject('button_fr'); styleObject.backgroundImage= "url(none)";
	var styleObject = getStyleObject('button_eng'); styleObject.backgroundImage= "url(none)";
	var styleObject = getStyleObject('button_jp'); styleObject.backgroundImage= "url(none)";
	
	// Invisibilité des forms
	var styleObject = getStyleObject('open_con_form_fr'); styleObject.visibility = "hidden";
	var styleObject = getStyleObject('open_con_form_eng'); styleObject.visibility = "hidden";
	var styleObject = getStyleObject('open_con_form_jp'); styleObject.visibility = "hidden";
	
	var ploum = "button_"+lg;
	
	//var styleObject = getStyleObject(ploum); styleObject.borderColor = "#39C";
	
	var styleObject = getStyleObject(ploum); styleObject.backgroundImage= "url(images/petit_mon.png)";
	var styleObject = getStyleObject(ploum); styleObject.backgroundRepeat= "no-repeat";
	var styleObject = getStyleObject(ploum); styleObject.backgroundPosition= "left center";
	
		
	
	if(lg=="fr")
		{
			var styleObject = getStyleObject('open_con_form_fr'); styleObject.visibility = "visible";
		}
		
	if(lg=="eng")
		{
			var styleObject = getStyleObject('open_con_form_eng'); styleObject.visibility = "visible";
		}
		
	if(lg=="jp")
		{
			var styleObject = getStyleObject('open_con_form_jp'); styleObject.visibility = "visible";
		}
	
	
	
	
	document.Selection.select_lg.value=lg;
	
	/*if(document.Selection.con.value != "")
		{
			document.Selection.submit();
		}
	else
		{
			window.alert("Vous devez choisir une vitesse de connexion\nDo you need to choose a connexion speed\n");
		}*/
	
	return true;
 }
 
 
 function SelectCon(con) {

	var styleObject = getStyleObject('button_low'); styleObject.borderColor = "#FFF";
	var styleObject = getStyleObject('button_high'); styleObject.borderColor = "#FFF";
	var styleObject = getStyleObject('button_vhigh'); styleObject.borderColor = "#FFF";
	
	var ploum = "button_"+con;
	
	var styleObject = getStyleObject(ploum); styleObject.borderColor = "#39C";
	document.Selection.select_con.value=con;
	
	if(document.Selection.select_lg.value != "")
		{
			document.Selection.submit();
		}
	else
		{
			window.alert("Vous devez choisir une langue\nDo you need to choose a language");
		}
	
	return true;
 }
 
 

 
 function OpenIllustrationWindow(img) {
  	var attribute = "toolbar=no,status=no,location=no,resizable=no,scroll=no,directories=no,menubar=no,top=10,left=10,width=600,height=500";
 	var name = "Illustration";
	var url = img;
	window.open(url,name,attribute);
 }
 
 
 function OpenMovieWindow(mov) {
	var attribute = "toolbar=no,status=no,location=no,resizable=no,scrollbars=no,directories=no,menubar=no,top=10,left=10,width=600,height=500";
 	var name = "Movie";
	var url = mov;
	window.open(url,name,attribute);
	
 }
 
 function OpenGalleryWindow(mov) {
	var attribute = "toolbar=no,status=no,location=no,resizable=yes,scrollbars=no,directories=no,menubar=no,top=10,left=10,width=600,height=650";
 	var name = "Gallery";
	var url = mov;
	window.open(url,name,attribute);
 }
 
/*  function Test(mov) {
	var attribute = "toolbar=no,status=yes,location=no,resizable=yes,scrollbars=no,directories=no,menubar=no,top=10,left=10,width=600,height=650";
 	var name = "Gallery";
	var url = mov;
	window.open(url,name,attribute);
	//window.open(url,name);
 }
*/ 
 
  function OpenFullResPicture(mov) {
	var attribute = "toolbar=no,status=no,location=no,resizable=yes,scrollbars=no,directories=no,menubar=no,top=10,left=10";
 	var name = "Picture";
	var url = mov;
	window.open(url,name,attribute);
 }
