/*
# ********************************************
# Project : SIT-EASYCERT
# Manager : GUK
# Author  : GVS
# Created : 050117
# Graphics: XXX
# Edits By: XXX, XXX, XXX
# Doc Role: contains all the functions which are 
# commonly used throughout the application
# ******************************************** 
*/

function DoNav(xRowId){
	var row = document.getElementById(xRowId);
		if(row.className=='pro_list_box')
		{	
			row.className='pro_list_box_hover';
			row.onmouseout = new Function("this.className='pro_list_box'");		
		}
		else if(row.className=='pro_list_box_alternet')
		{
			row.className='pro_list_box_hover';
			row.onmouseout = new Function("this.className='pro_list_box_alternet'");	
		}
}

function validateEmails(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}
function trim(par)
{
	var y = par.length;
	var ret = '';
	var ex=0;
	var bl=0;
	for (i=0;i<y;i++)
	{
		if (par.charAt(i) == ' ')
			bl = bl+1
		else
		{
			ret=ret+par.charAt(i);
			ex = ex+1
		}
	}
	if (bl==y)
		return true;
	else 
		return false;
	
}