	/**
	 * 
	 * Javascript functions for all the website.
	 * 
	 * @name module_movies
	 * @author Vincent Cantin Bellemare
	 * @since 2006-07-06
	 * @version 1.0.0
	 * @package reptileframework
	 * 
	 * 
	 */
	
	function is_phones(phone1,phone2)
	{
		if(is_phone(phone1))
		{
			return true;	
		}
	
		if(is_phone(phone2))
		{
			return true;	
		}
		
		return false;		
	}
	
	function is_credit_card(creditCard)
	{	
		if(creditCard > 1000000000000000 && creditCard < 10000000000000000)
		{
			return true;
		}
		else
		{
			return false;
		}		
	}
	
	function is_int(theInt)
	{
		
		if(isNaN(theInt))
		{
			return false;			
		}

		if(theInt > 0)
		{
			return true;
		}
	
		return false;
	}
	
	function is_expiration(expiration)
	{
		expirationArray = Array
		expirationArray = expiration.split('/');
		
		if(expirationArray.length != 2)
		{
			return false;	
		}

		/*
		The year is harcoded because we can't be shure to get the good year by javascript
		*/
		return (expirationArray[0] > 0 && expirationArray[0] < 13 &&  expirationArray[1] >= 07 && expirationArray[1] < 99  );	
	}
		
	function is_phone(phone)
	{		
		if(phone.length<3)
		{
			return false;				 
		}

		if(phone.match(/[\<\>\,\;\:\\\"\[\]]/) || phone.match(/[a-zA-Z]/))
		{
			return false;				 
		}
		 
		return true;			
	}
	
	function is_empty(theField)
	{
		if(theField.length > 0)
		{
			return true;				 
		}		
		
		return false;
	}
	
	function is_priceFormat(price)
	{
		var reg = /^\d+[.]{1}\d{2}$/;
		return reg.test(price);
	}
	
	function is_timeFormat(time)
	{
		var reg = /^(\d{1}|\d{2})[:]{1}\d{2}$/;
		return reg.test(time);
	}
	
	function is_email (strng) 
	{
		if (strng == "") 
		{
		 	return false;
		}
		
		var emailFilter=/^.+@.+\..{2,3}$/;
		
		if (!(emailFilter.test(strng))) 
		{ 
		   return false;
		}
		else 
		{
		   var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
		
			if (strng.match(illegalChars)) 
			{
			  return false;
		   	}
		}
		
		return true;    
	}
	
	function is_year(theYear)
	{
		if(theYear > 1968 && theYear < 2500 )
		{
			return true
		}
		
		return false	
	}

	function is_positive_int(theNumber)
	{
		if(theNumber > 0 )
		{
			return true
		}
		
		return false	
	}

	function trace(logprint)
	{
		if( window.console ) 
		{
			window.console.log( logprint ) ;
		}			
	}

	function trace(logprint)
	{
		if( window.console ) 
		{
			window.console.log( logprint ) ;
		}		
	}
	
	function is_explorer()
	{
		return (typeof document.body.style.maxHeight != "undefined") ? 0 : 1 ;		
	}

	function _displayNoneTimer(divToHide)
	{
		$(divToHide).style.display = 'none';
	}
	
	function displayNoneTimer(divToHide, timer)
	{
		if($(divToHide))
		{	
			RRRtimer = window.setTimeout("_displayNoneTimer('" + divToHide + "')",timer);
		}
		else
		{
			trace('Errreur de id sur : ' + divToHide );	
		}
	}

	function onOffDiv(theDiv)
	{
		displayDiv = $(theDiv).style.display	

		if(displayDiv == 'none')
		{
			$(theDiv).style.display = 'block'
		}
		else
		{
			$(theDiv).style.display = 'none'			
		}
	}
	
	function priceFomat(num) 
	{
		num = num.toString().replace(/\$|\,/g,'');
	
		if(isNaN(num))
		{
			num = "0";		
		}
	
		sign = (num == (num = Math.abs(num)));
		num = Math.floor(num*100+0.50000000001);
		cents = num%100;
		num = Math.floor(num/100).toString();
	
		if(cents<10)
		{
			cents = "0" + cents;			
		}

		for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
		{
			num = num.substring(0,num.length-(4*i+3))+','+
			num.substring(num.length-(4*i+3));		
		}

		return (((sign)?'':'-') + '' + num + '.' + cents + ' $');
	}
	
	
	function submenu_on()
	{
		if ($('top_submenu'))
		{
			if ($('top_submenu').style.display != "block")
			{
				$('top_submenu').style.display = "block";
			}
		}
	}

	function submenu_off()
	{
		if ($('top_submenu'))
		{
			if ($('top_submenu').style.display == "block")
			{
				$('top_submenu').style.display = "none";
			}
		}
	}

	
	