// JavaScript Document

function fnForeceRollback()
{
	if (window.history.length > 0)
		{
			window.history.go(+1);
			document.getElementById('fname').value='';
			document.getElementById('lname').value='';
			document.getElementById('email').value='';
			
		}
}
// ..........................................................................................................................................
function jsf_makefullname()
{
	document.getElementById('p_name').value = document.getElementById('fname').value + ' ' + document.getElementById('lname').value;
}
// ..........................................................................................................................................
function jsf_validatesecuritycode(code)
{

	if(code != document.getElementById('sec_code').value)
	 {
		document.getElementById('img_send').style.visibility='hidden'; 
		document.getElementById('captcha_stat').innerHTML = '<< Invalid Code';
		C_ERROR = true;
		//setTimeout('window.location.reload()', 2000);
	 }
	else
	 {
		 document.getElementById('img_send').style.visibility='visible';
		 document.getElementById('captcha_stat').innerHTML = '<img src="images/valid.gif" border="0" title="Valid" alt="Valid" style="vertical-align: bottom" />';
		 C_ERROR = false;
	 }
	 
}
// ..........................................................................................................................................
function fnFormatTime(_value,_aux)
{
	var fmt_hrs;
	var ap;
	switch(_value)
	 {
	        case 13:
	        	fmt_hrs = 1;
	        	ap = "PM";
	                break;
	                
	        case 14:
	        	fmt_hrs = 2;
	        	ap = "PM";
	                break;
	                
	        case 15:
	        	fmt_hrs = 3;
	        	ap = "PM";
	                break;
	                
	        case 16:
	        	fmt_hrs = 4;
	        	ap = "PM";
	                break;
	                
	        case  17:
	        	fmt_hrs = 5;
	        	ap = "PM";
	                break;
	                
	        case  18:
	        	fmt_hrs = 6;
	        	ap = "PM";
	                break;
	                
	        case  19:
	        	fmt_hrs = 7;
	        	ap = "PM";
	                break;
	                
	        case  20:
	        	fmt_hrs = 8;
	        	ap = "PM";
	                break;
	                
	        case  21:
	        	fmt_hrs = 9;
	        	ap = "PM";
	                break;
	                
	        case  22:
	        	fmt_hrs = 10;
	        	ap = "PM";
	                break;
	                
	        case  23:
	        	fmt_hrs = 11;
	        	ap = "PM";
	                break;
	                
		default:
		        fmt_hrs = _value;
		        ap = "AM";
	 }
	 
	 if(_aux == 'ap')
	 {
	        return(ap);
	 }
	 else
	 {
		return(fmt_hrs);
	 }
}