var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function GetUser_date()
{

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
{
 d = new Date();
 Time24H = new Date();
 Time24H.setTime(d.getTime() + (d.getTimezoneOffset()*60000) + 3600000);
 InternetTime = Math.round((Time24H.getHours()*60+Time24H.getMinutes()) / 1.44);
 if (InternetTime < 10) InternetTime = '00'+InternetTime;
 else if (InternetTime < 100) InternetTime = '0'+InternetTime;
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate=montharray[month]+" "+daym+" "+year+" | "+hours+":"+minutes+":"+seconds+"";
///alert(time_now);


document.contact_form.usrtime.value=cdate;


}


function GetUser_date2()
{

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
{
 d = new Date();
 Time24H = new Date();
 Time24H.setTime(d.getTime() + (d.getTimezoneOffset()*60000) + 3600000);
 InternetTime = Math.round((Time24H.getHours()*60+Time24H.getMinutes()) / 1.44);
 if (InternetTime < 10) InternetTime = '00'+InternetTime;
 else if (InternetTime < 100) InternetTime = '0'+InternetTime;
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate=montharray[month]+" "+daym+" "+year+" | "+hours+":"+minutes+":"+seconds+"";
///alert(time_now);


document.apply_online.usrtime.value=cdate;


}

//ale

function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Invalid E-mail ID")
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		alert("Invalid E-mail ID")
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Invalid E-mail ID")
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("Invalid E-mail ID")
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert("Invalid E-mail ID")
		return false
	 }
	 return true					
}


// JavaScript Document

	function validchar(val)
{
//*** Space removed ***///
	for(i=0;i<val.length;++i)
	{
		if(val.charAt(i) == "\'" || val.charAt(i) == "\\" || val.charAt(i) == "!" || val.charAt(i) == "@" ||  val.charAt(i) == "#" || val.charAt(i) == "$" || val.charAt(i) == "%" || val.charAt(i) == "^" ||  val.charAt(i) == "&" || val.charAt(i) == "*" ||  val.charAt(i) == "," || val.charAt(i) == ";" ||  val.charAt(i) == ":" || val.charAt(i) == "=" || val.charAt(i) == "+" || val.charAt(i) == "|" || val.charAt(i) == "?" || val.charAt(i) == "/" || val.charAt(i) == "\\" )
		{
			return false;
		}
	}
	return true;
}



function validchar1(val)
{
	for(i=0;i<val.length;++i)
	{
		if(val.charAt(i) == "\'" || val.charAt(i) == "\\" || val.charAt(i) == "!" || val.charAt(i) == "#" || val.charAt(i) == "$" || val.charAt(i) == "%" || val.charAt(i) == "^" || val.charAt(i) == "&" ||  val.charAt(i) == "*" || val.charAt(i) == ":" || val.charAt(i) == "=" || val.charAt(i) == "+" || val.charAt(i) == "|" || val.charAt(i) == "?" || val.charAt(i) == "/" || val.charAt(i) == "\\" || val.charAt(i) == " ")
		{
			return false;
		}
	}
	return true;
}

function Enq_Validate()
{




if(document.contact_form.fname.value=="")
	{
     alert("Please mention name"); 
	 document.contact_form.fname.focus();
	 return false;
	}


if (document.contact_form.fname.value!="")
{
	
	//check for fname
	nwstl=document.contact_form.fname.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.contact_form.fname.focus();
	return false;
	}
}


if(document.contact_form.fname.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.contact_form.fname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.contact_form.fname.select();
    return false;
  }
}

if(document.contact_form.fname.value!="")
	{

		if(document.contact_form.fname.value.length > 100)
		{
					alert("Name cannot be greater than 100 Characters");
					document.contact_form.fname.focus();
					return false;
		}
	}	
	


if(document.contact_form.address.value=="")
	{
     alert("Please mention address"); 
	 document.contact_form.address.focus();
	 return false;
	}


if (document.contact_form.address.value!="")
{
	
	//check for fname
	nwstl=document.contact_form.address.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.contact_form.address.focus();
	return false;
	}
}


if(document.contact_form.address.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.contact_form.address.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.contact_form.address.select();
    return false;
  }
}

if(document.contact_form.address.value!="")
	{

		if(document.contact_form.address.value.length > 500)
		{
					alert("Address name cannot be greater than 500 Characters");
					document.contact_form.address.focus();
					return false;
		}
	}	

	


if(document.contact_form.phone.value=="")
	{
     alert("Please mention phone"); 
	 document.contact_form.phone.focus();
	 return false;
	}


if (document.contact_form.phone.value!="")
{
	
	//check for fname
	nwstl=document.contact_form.phone.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.contact_form.phone.focus();
	return false;
	}
}


if(document.contact_form.phone.value !="")
	{
var checkOK = "0123456789+ () - ";
  var checkStr = document.contact_form.phone.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert('Data are invalid.Only 0-9 + () are allowed');
    document.contact_form.phone.select();
    return false;
  }
}

if(document.contact_form.phone.value!="")
	{

		if(document.contact_form.phone.value.length > 100)
		{
					alert("Phone cannot be greater than 100 Characters");
					document.contact_form.phone.focus();
					return false;
		}
	}	

	

if(document.contact_form.email.value=="")
	{
     alert("Please mention email"); 
	 document.contact_form.email.focus();
	 return false;
	}


if (document.contact_form.email.value!="")
{
	
	//check for fname
	nwstl=document.contact_form.email.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.contact_form.email.focus();
	return false;
	}
}




if(document.contact_form.email.value!="")
	{

		if(document.contact_form.email.value.length > 100)
		{
					alert("Email cannot be greater than 100 Characters");
					document.contact_form.email.focus();
					return false;
		}
	
		var str=document.contact_form.email.value;
		var valid=echeck(str);

		if (valid==0)
		{
			//alert('Invalid email id');
			document.contact_form.email.focus();
			return false;
		}

	
	}	


if(document.contact_form.query.value=="")
	{
     alert("Please mention query / comments "); 
	 document.contact_form.query.focus();
	 return false;
	}


if (document.contact_form.query.value!="")
{
	
	//check for fname
	nwstl=document.contact_form.query.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.contact_form.query.focus();
	return false;
	}
}


if(document.contact_form.security_code.value=="")
	{
     alert("Please mention security code"); 
	 document.contact_form.security_code.focus();
	 return false;
	}


if (document.contact_form.security_code.value!="")
{
	
	//check for fname
	nwstl=document.contact_form.security_code.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.contact_form.security_code.focus();
	return false;
	}
}


}	

function ApplyOnline_Validate()
{

if(document.apply_online.position_applied_for.value=="#")
{
alert("Please mention position applied for"); 
document.apply_online.position_applied_for.focus();
return false;
}


if(document.apply_online.fname.value=="")
	{
     alert("Please mention name"); 
	 document.apply_online.fname.focus();
	 return false;
	}


if (document.apply_online.fname.value!="")
{
	
	//check for fname
	nwstl=document.apply_online.fname.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.apply_online.fname.focus();
	return false;
	}
}


if(document.apply_online.fname.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.apply_online.fname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.apply_online.fname.select();
    return false;
  }
}

if(document.apply_online.fname.value!="")
	{

		if(document.apply_online.fname.value.length > 100)
		{
					alert("Name cannot be greater than 100 Characters");
					document.apply_online.fname.focus();
					return false;
		}
	}	
	


if(document.apply_online.address.value=="")
	{
     alert("Please mention address"); 
	 document.apply_online.address.focus();
	 return false;
	}


if (document.apply_online.address.value!="")
{
	
	//check for fname
	nwstl=document.apply_online.address.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.apply_online.address.focus();
	return false;
	}
}


if(document.apply_online.address.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.apply_online.address.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.apply_online.address.select();
    return false;
  }
}

if(document.apply_online.address.value!="")
	{

		if(document.apply_online.address.value.length > 500)
		{
					alert("Address name cannot be greater than 500 Characters");
					document.apply_online.address.focus();
					return false;
		}
	}	

	


if(document.apply_online.phone_office.value=="")
	{
     alert("Please mention office phone"); 
	 document.apply_online.phone_office.focus();
	 return false;
	}


if (document.apply_online.phone_office.value!="")
{
	
	//check for fname
	nwstl=document.apply_online.phone_office.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.apply_online.phone_office.focus();
	return false;
	}
}


if(document.apply_online.phone_office.value !="")
	{
var checkOK = "0123456789+ () - ";
  var checkStr = document.apply_online.phone_office.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert('Data are invalid.Only 0-9 + () are allowed');
    document.apply_online.phone_office.select();
    return false;
  }
}

if(document.apply_online.phone_office.value!="")
	{

		if(document.apply_online.phone_office.value.length > 100)
		{
					alert("Phone cannot be greater than 100 Characters");
					document.apply_online.phone_office.focus();
					return false;
		}
	}	




if(document.apply_online.phone_mobile.value=="")
	{
     alert("Please mention mobile No."); 
	 document.apply_online.phone_mobile.focus();
	 return false;
	}


if (document.apply_online.phone_mobile.value!="")
{
	
	//check for fname
	nwstl=document.apply_online.phone_mobile.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.apply_online.phone_mobile.focus();
	return false;
	}
}


if(document.apply_online.phone_mobile.value !="")
	{
var checkOK = "0123456789+ () - ";
  var checkStr = document.apply_online.phone_mobile.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert('Data are invalid.Only 0-9 + () are allowed');
    document.apply_online.phone_mobile.select();
    return false;
  }
}

if(document.apply_online.phone_mobile.value!="")
	{

		if(document.apply_online.phone_mobile.value.length > 100)
		{
					alert("Mobile cannot be greater than 100 Characters");
					document.apply_online.phone_mobile.focus();
					return false;
		}
	}	

	
	

if(document.apply_online.email.value=="")
	{
     alert("Please mention email"); 
	 document.apply_online.email.focus();
	 return false;
	}


if (document.apply_online.email.value!="")
{
	
	//check for fname
	nwstl=document.apply_online.email.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.apply_online.email.focus();
	return false;
	}
}




if(document.apply_online.email.value!="")
	{

		if(document.apply_online.email.value.length > 100)
		{
					alert("Email cannot be greater than 100 Characters");
					document.apply_online.email.focus();
					return false;
		}
	
		var str=document.apply_online.email.value;
		var valid=echeck(str);

		if (valid==0)
		{
			//alert('Invalid email id');
			document.apply_online.email.focus();
			return false;
		}

	
	}	



if(document.apply_online.salary.value=="")
	{
     alert("Please mention present salary"); 
	 document.apply_online.salary.focus();
	 return false;
	}


if (document.apply_online.salary.value!="")
{
	
	//check for fname
	nwstl=document.apply_online.salary.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.apply_online.salary.focus();
	return false;
	}
}


if(document.apply_online.salary.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.apply_online.salary.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.apply_online.salary.select();
    return false;
  }
}

if(document.apply_online.salary.value!="")
	{

		if(document.apply_online.salary.value.length > 100)
		{
					alert("Present salary cannot be greater than 100 Characters");
					document.apply_online.salary.focus();
					return false;
		}
	}	
	



if(document.apply_online.file_resume.value=="")
	{
     alert("Please attach resume"); 
	 document.apply_online.file_resume.focus();
	 return false;
	}


if (document.apply_online.file_resume.value!="")
{
	
	//check for fname
	nwstl=document.apply_online.file_resume.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.apply_online.file_resume.focus();
	return false;
	}
}



if(apply_online.file_resume.value!=""){

						var typeArr=Array("pdf","PDF","doc","DOC","rtf","RTF","odt","ODT");
						var fileName=apply_online.file_resume.value;
						var fileArr=fileName.split(".");
						var len=fileArr.length;
						var arrLn=len-1;
						var typ=fileArr[arrLn];

						var chk=0;
						for(var i=0 ;i <8 ;i++){
							if (typeArr[i]==typ)
							{
								chk=1;
								break;
							}

						}

						if(chk==0){
							alert("Allowed file type : pdf,doc,rtf,odt");
							return false;
						}	
					}




if(document.apply_online.security_code.value=="")
	{
     alert("Please mention security code"); 
	 document.apply_online.security_code.focus();
	 return false;
	}


if (document.apply_online.security_code.value!="")
{
	
	//check for fname
	nwstl=document.apply_online.security_code.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.apply_online.security_code.focus();
	return false;
	}
}


}

		

		
		function OnlyNumber()
		{
			jv_keyCode = window.event.keyCode
			if(!(jv_keyCode >= 48 && jv_keyCode <= 57))
			{
				window.event.keyCode = 0
			}
		}