/*
 *
 * Version       : WeekPix 1.0 (PHP5/MySQL5)
 * Author        : Stucki Gael
 * Last Modified : 14.09.2006 
 *
 *
*/


/*
 *
 * Function   : mouseMO
 * Return     : /
 *
*/

	function mouseMO(imgID, imgSRC){
	
		var img = document.getElementById(imgID);
		img.src = imgSRC;
	
	}


/*
 *
 * Function   : isEmpty
 * Return     : /
 *
*/
	function isEmpty(str){ 
		strRE = new RegExp( ); 
	  strRE.compile( '^[s ]*$', 'gi' ); 
	  return strRE.test(str); 
	} 


/*
 *
 * Function   : notValidEmail
 * Return     : /
 *
*/
	function notValidEmail( str ){ 
		mailRE = new RegExp( ); 
    mailRE.compile( '^[._a-z0-9-]+@[.a-z0-9-]+[.]{1}[a-z]{2,4}$', 'gi' ); 
    return !(mailRE.test(str)); 
	}
	


/*
 *
 * Function   : isValidRegularExpression
 * Return     : /
 *
*/
	function isValidRegularExpression( str, regularExpression ){ 
		
		spcRE = new RegExp( ); 
    spcRE.compile(regularExpression, 'gi' ); 
    return spcRE.test(str);
    
	}
	
	
/*
 *
 * Function   : isNotValidRegularExpression
 * Return     : /
 *
*/
	function isNotValidRegularExpression( str, regularExpression ){ 
			
    return !isValidRegularExpression(str , regularExpression);
    
	}
	
	
/*
 *
 * Function   : goToPage
 * Return     : /
 *
*/
	function goToPage( url ){ 
		
		window.location = url;
		
	}
	
/*
 *
 * Function   : goToPage_Iframe
 * Return     : /
 *
*/
	function goToPage_Iframe( idIframe, urlIframe, paramsIframe){ 
		
		//document.getElementById(idIframe).src = treePhoto_root_linkPath + urlIframe;
		document.getElementById(idIframe).src = urlIframe + paramsIframe;
		
	}
  
 
 
 /*
 *
 * Function   : listRedirectToPage
 * Return     : /
 *
*/
  
  function listRedirectToPage(list){
  
	var cList = document.getElementById(list);
	var cValue = cList.options[cList.selectedIndex].value;
	
  //if (cValue != -1){
	  
	  location.href = cValue;
	  
	//}
	
}
	


/*
 *
 * Function   : checkAll
 * Return     : /
 *
*/
	function checkAll(formName, ctrlName, ctrlsName){ 
		
		with(eval("document."+formName)){
			
			try{
				var ctrl = eval(ctrlName); 
				var ctrls = eval(ctrlsName); 
				
				if (ctrls.length == undefined){
					
					ctrls.checked = ctrl.checked;
					
				}else{
					
					for (var i = 0; i<ctrls.length; i++){
					
						ctrls[i].checked = ctrl.checked;
					
					}	
					
				}
				
			}catch(exc){
				
				// nothing
				
			}
		}
		
	}
	
	
	
	/*
 *
 * Function   : showFreezeWindow
 * Return     : /
 *
*/
	function showFreezeWindow(pWFreeze, toShow){ 
		
		resizeFreezeWindow(pWFreeze);
		var wFreeze = document.getElementById(pWFreeze);
		wFreeze.style.visibility = (toShow) ? "visible" : "hidden";
		
	}
	

/*
 *
 * Function   : resizeFreezeWindow
 * Return     : /
 *
*/
	function resizeFreezeWindow(pWFreeze){ 
		
		var w = (document.body.clientWidth);
		var h = (document.body.clientHeight);
		var wFreeze = document.getElementById(pWFreeze);
		
		wFreeze.style.width = w;
		wFreeze.style.height = h;
		
	}
  
  
  /*
 *
 * Function   : openCloseCatNavigation
 * Return     : /
 *
*/
	function openCloseCatNavigation(idDiv){ 
		
		var divCatNav = document.getElementById(idDiv);
    
    divCatNav.className = (divCatNav.className == "catNavClose") ? "catNavOpen" : "catNavClose";
		
	}
  
  
  
   /*
 *
 * Function   : sendSearch()
 * Return     : /
 *
*/
	function sendSearch(){ 
	
    document.frmHiddenSearch.idfMAT.value = document.frmSearch.cbMatieres.value;
    document.frmHiddenSearch.idfCOU.value = document.frmSearch.cbCountries.value;
    document.frmHiddenSearch.idfCNT.value = document.frmSearch.cbCantons.value;
    document.frmHiddenSearch.words.value = document.frmSearch.words.value;
		document.frmHiddenSearch.submit();
		
	}
  
  
/*
 *
 * Function   : resizeFreezeWindow
 * Return     : /
 *
*/
	function doDelete(){ 
		
		if(confirm('Voulez-vous vraiment supprimer la demande de cours?')){
		
			document.frmCouradom.submit();
		
		}

	}
	