// Procédures globales du projet
function zindex(o1,o2,o3,o4)
{
	document.getElementById(o1).style.zIndex="1"; 
	document.getElementById(o2).style.zIndex="-1"; 
	document.getElementById(o3).style.zIndex="-1";
	document.getElementById(o4).style.zIndex="-1";
	
}
function tinyInit(sElement)
{
	tinyMCE.init({
	mode : "none", 
	theme : "advanced", width:'421', height:'300',plugins: " fullscreen, table,advimage,contextmenu",
	theme_advanced_buttons1 : "bold,italic,underline,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent,|,bullist,numlist",
	theme_advanced_buttons2 : "fontselect,fontsizeselect,|,cleanup,|,link,unlink,image,|,fullscreen,code",
	theme_advanced_buttons3 : "tablecontrols",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : false
	})
}

function tinyToggle(id)
{
	if (!tinyMCE.get(id)) {
		tinyInit();
		tinyMCE.execCommand('mceAddControl', false, id);
	} else
		tinyMCE.execCommand('mceRemoveControl', false, id);
}
function tinyRemove(id)
{
	tinyMCE.triggerSave();
	tinyMCE.execCommand('mceRemoveControl', false, id);
}
function tinySetContent(html)
{
tinyMCE.setContent("abc");
}

function myCustomOnInit()
{
  tinyMCE.getInstanceById('mce_editor_0').getWin().document.body.style.backgroundColor='#00FF00';
}

function analytics()
{
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	try {
		var pageTracker = _gat._getTracker("UA-3924308-6");
		pageTracker._trackPageview();
	} catch(err) {}
}
function allelements()
{
	var theForm = document.forms[0]
	
	for(i=0; i<theForm.elements.length; i++){
		var alertText = ""
		alertText += "Element Type: " + theForm.elements[i].type + "\n"
		
		if(theForm.elements[i].type == "text" || theForm.elements[i].type == "textarea" || theForm.elements[i].type == "button"){
			alertText += "Element Value: " + theForm.elements[i].value + "\n"
			}
		else if(theForm.elements[i].type == "checkbox"){
			alertText += "Element Checked? " + theForm.elements[i].checked + "\n"
			}
		else if(theForm.elements[i].type == "select-one"){
			alertText += "Selected Option's Text: " + theForm.elements[i].options[theForm.elements[i].selectedIndex].text + "\n"
			}
		alert(alertText)
		}
}


