
function checkEmpRegform()
{
    var why = "";
    why += checkUsername(document.ctis.uname.value);
    why += checkPassword(document.ctis.pwd.value);
    why += checkFirstname(document.ctis.fn.value);
    why += checkLastname(document.ctis.ln.value);
    why += checkMobile(document.ctis.mobile.value);
    why += checkEmail(document.ctis.email.value);
    why += checkAddress(document.ctis.addr.value);
    why += checkCity(document.ctis.city.value);
    why += checkState(document.ctis.state.value);
    why += checkCountry(document.ctis.cntry.value);
    if (why != "")
    {
       alert(why);
       return false;
    }
return true;
}



function checkSecname (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Section Name.\n";
 }
return error;
}

function checkSechead (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Section Head.\n";
 }
return error;
}

function checkSecDesc (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Section Description.\n";
 }
return error;
}

function checkDeptname (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Department Name.\n";
 }
return error;
}

function checkDepthead (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Department Head.\n";
 }
return error;
}

function checkDeptDesc (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Department Description.\n";
 }
return error;
}

function checkStorename (strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a Store Name.\n";
 }
 if ((strng.length < 4) || (strng.length > 20)) 
{
    error = "Store name must be more than 4 and less than 20 char\n";
}
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(strng)) 
{
       error = "The Store Name contains illegal characters.\n";
    } 
return error;
}

function checkVerifyPassword (strng) 
{
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a verify password.\n";
 }
    var illegalChars = /[\W_]/; 
    if ((strng.length < 5) || (strng.length > 8)) 
    {
       error = "The verify password is the wrong length.\n";
    }
    else if (illegalChars.test(strng))
    {
      error = "The verify password contains illegal characters.\n";
    }
    if(document.ctis.pwd.value!=strng)
    {
        error="Password and Retype Passwords are not same";
    }
return error;
}

function checkFirstname (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a first name.\n";
 }
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(strng)) 
{
       error = "The firstname contains illegal characters.\n";
    } 
return error;
}


function checkLastname (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a last name.\n";
 }
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(strng)) 
{
       error = "The lastname contains illegal characters.\n";
    } 
return error;
}
function checkSoftname (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Software.\n";
 }
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(strng)) 
{
       error = "The Software name contains illegal characters.\n";
    } 
return error;
}

function checkVersion (strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Version.\n";
 }
return error;
}

function checkUsername (strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a username.\n";
 }
 if ((strng.length < 4) || (strng.length > 10)) 
{
    error = "User name must be more than 4 and less than 10 char.\n";
}
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(strng)) 
{
       error = "The username contains illegal characters.\n";
    } 
return error;
}

function checkPassword (strng) 
{
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a password.\n";
 }
    var illegalChars = /[\W_]/; 
    if ((strng.length < 6) || (strng.length > 12)) 
    {
       error = "The password is the wrong length.\n";
    }
    else if (illegalChars.test(strng))
    {
      error = "The password contains illegal characters.\n";
    }
return error;
}

function checkEmail(strng)
{
var error = "";
 if (strng == "")
 {
    error = "You didn't enter a Email.\n";
 }
var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
if (strng.match(illegalChars)) 
{
   error = "The email address contains illegal characters.\n";
}
return error;
}

function checkReEmail(strng)
{
var error = "";
 if (strng == "")
 {
    error = "You didn't enter a Re Email.\n";
 }
if(strng==document.multi.email.value)
{

if (!(emailFilter.test(strng))) 
{ 
       error = "Please enter a valid email address.\n";
}
var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
if (strng.match(illegalChars)) 
{
   error = "The email address contains illegal characters.\n";
}
}
else
{
   error="Email and Reemail are not matiching.\n";
}
return error;
}
function checkPhone(strng)
{
var error = "";
 if (strng == "")
 {
    error = "You didn't enter a Phone Number.\n";
 }
return error;
}

function checkMobile(strng)
{
var error = "";
 if (strng == "")
 {
    error = "You didn't enter a Mobile.\n";
 }
var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');
/*strip out acceptable non-numeric characters*/
if (isNaN(parseInt(stripped))) 
{
   error = "The mobile number contains illegal characters.";
}
if (!(stripped.length == 10)) 
{
	error = "The mobile number is the wrong length.\n";
}
return error;
}

function checkFax(strng)
{
var error = "";
 if (strng == "")
 {
    error = "You didn't enter a Fax.\n";
 }
return error;
}

function isDifferent(strng) 
{
  var error = "";
  if (strng != "Can\'t touch this!") 
{
     error = "You altered the inviolate text area.\n";
  }
}

function checkAddress(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter Address Details\n";
 }
return error;
}

function checkAddress1(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter Address1 Details\n";
 }
return error;
}

function checkAddress2(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter Address2 Details\n";
 }
return error;
}
function checkDesc(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Description\n";
 }
return error;
}
function checkKey(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Licence Key\n";
 }
return error;
}
function checkDropdownDept(strng)
{
var error = "";
 if (strng == "Select")
 {
    error = "Please choose any Department\n";
 }
return error;
}

function checkDropdownSection(strng)
{
var error = "";
 if (strng == "Select")
 {
    error = "Please choose any Section\n";
 }
return error;
}
function checkDropdownEmpType(strng)
{
var error = "";
 if (strng == "Select")
 {
    error = "Please choose Employee Type\n";
 }
return error;
}

function checkDoj(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Date of Join\n";
 }
return error;
}
function checkDob(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Date of Birth\n";
 }
return error;
}

function checkQual(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Qualification\n";
 }
return error;
}

function checkExp(strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter the Experience\n";
 }
return error;
}
function checkSofttype(strng)
{
var error = "";
 if (strng == "Select")
 {
    error = "Please choose Software Type\n";
 }
return error;
}


function checkSoftcat(strng)
{
var error = "";
 if (strng == "Select")
 {
    error = "Please choose Software Category\n";
 }
return error;
}


function checkCity (strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a city.\n";
 }
return error;
}

function checkState (strng)
 {

 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a state.\n";
 }
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(strng)) 
{
       error = "The state name contains illegal characters.\n";
    } 
return error;
}

function checkCountry(strng)
 {
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a country.\n";
 }
var illegalChars = /\W/;
  // allow only letters, numbers, and underscores
    if (illegalChars.test(strng)) 
{
       error = "The counrty name contains illegal characters.\n";
    } 
return error;
}

function checkZip(strng)
{
 var error = "";
 if (strng == "")
 {
    error = "You didn't enter a Zip.\n";
 }
return error;
}