function cssClassChange(cl,theid) {
	var e = document.getElementById(theid);
    e.setAttribute("className",cl);//for IE       
    e.setAttribute("class",cl);
}
function confirmSubmit(){
	var agree=confirm("Are you sure you want to delete this?");
	if (agree){
		return true ;
	}else{
		return false ;
	}
}
var timecounter1=0,timestamp1=0,timecounter2=0,timestamp2=0,currentApt='',currentPlan='';

if (document.images){
	pdfOn= new Image(22,27);
	pdfOn.src="/images/pdfHL.png";  
	pdf= new Image(22,27);
	pdf.src="/images/pdf.png"; 
}

//START THE MENU LOOP TO TIMEOUT SUBS
setInterval('menuloop()', 300);

function dropdown(theid){

	//Hide menu DIV
	killsubs();
	//Reset timer
	timestamp1=0;
	
	//show menu DIV
		document.getElementById(theid).style.visibility="visible";
}

//Here's the functions to hide the MENUS***************************************************
function killsubs(){
	timestamp1=0;
			document.getElementById("menua").style.visibility="hidden";
			document.getElementById("menub").style.visibility="hidden";
			document.getElementById("menuc").style.visibility="hidden";
			document.getElementById("menud").style.visibility="hidden";
			document.getElementById("menue").style.visibility="hidden";
}

function menuloop(){
	timecounter1++;
	timecounter2++;
	if(timestamp1 && timestamp1 < timecounter1){
		killsubs();
	}
	if(timestamp2 && timestamp2 < timecounter2){
		killAptHL();
	}
}
function killAptHL(){
	//alert('out ' + currentApt + ' - ' + timestamp2);
	timestamp2=timecounter2=0;
	if(currentApt!=''){
		document.getElementById(currentApt).style.display = "none";
		currentApt='';
	}
}
function onsub(){
	timestamp1 = timecounter1 = 0;
	timestamp2 = timecounter2 = 0;
}
function outsub(){
	timestamp1 = timecounter1 + 1;
	timestamp2 = timecounter2 + 1;
		//alert('out ' + currentApt);
}
function updateBKG(){
	var winHeight=0;
	var newHeight=0;
	if (isIE){
		winHeight=document.body.offsetHeight;
	}else{
		winHeight=window.innerHeight;
	}
	newHeight = winHeight-276;
	if(newHeight < 124){
		newHeight = 124;
	}
	document.getElementById('scrollArea').style.height = newHeight + 'px';
}
function hideApt(theID){
	if(currentApt==theID){
		currentApt='';
	}
	document.getElementById(theID).style.display = "none";
}
function showApt(theID){
	timestamp2 = 0;
	if(currentApt!=theID && currentApt!=''){
		document.getElementById(currentApt).style.display = "none";
	}
	currentApt=theID;
	document.getElementById(theID).style.display = "block";
}
function showPlan(theID){
	if(currentPlan!=theID && currentPlan!=''){
		document.getElementById(currentPlan).style.display = "none";
	}
	currentPlan=theID;
	document.getElementById(theID).style.display = "block";
}
function closePlan(theID){
	if(currentPlan==theID){
		currentPlan='';
	}
	document.getElementById(theID).style.display = "none";
}

var playingClip=1;
function displayClip(clipNum){
	var clipID='';
	//document.getElementById('thumb').style.display = "none";
	var theDiv = document.getElementById('clip');
	//theDiv.style.display = "none";
				//while (theDiv.hasChildNodes()) {
			theDiv.innerHTML='';
    			//theDiv.removeChild(theDiv.firstChild);
	    //}
	if(clipNum==2){	
		clipID='35978311';
	}else if(clipNum==3){
		clipID='35979891';
	}else if(clipNum==1){
		clipID='35968947';
	}
	theDiv.innerHTML='<object id="clipper1" width="485" height="274"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + clipID + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=1&amp;loop=0" /><embed id="clipper2" src="http://vimeo.com/moogaloop.swf?clip_id=' + clipID + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=1&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="485" height="274"></embed></object>';
	theDiv.style.display = "block";
}
function displayInnerClip(clipNum){
	var theDiv = document.getElementById('innerClip');
	theDiv.innerHTML='<object id="clipper1" width="585" height="330"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + clipNum + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=1&amp;loop=0" /><embed id="clipper2" src="http://vimeo.com/moogaloop.swf?clip_id=' + clipNum + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=1&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="585" height="330"></embed></object>';
	document.getElementById('popClip').style.display = "block";
}
function hideClip(){
	var theDiv = document.getElementById('innerClip');
	theDiv.innerHTML='';
	document.getElementById('popClip').style.display='none';
}
function switchThumb(thumbNum){
		document.getElementById('thumb' + thumbNum).style.display='none';
		document.getElementById('thumb' + playingClip).style.top = document.getElementById('thumb' + thumbNum).style.top;
		document.getElementById('thumb' + playingClip).style.display='block';
		playingClip = thumbNum;
}
function updateSrchFrm(){
	if(document.getElementById('srchType').value=='Acheter'){
		document.getElementById('soin').style.display='none';
	}else{
		document.getElementById('soin').style.display='block';
	}
}

