

//************* Images array **********************//


var arrImages=new Array();


	arrImages[0]="images/slide/1.jpg";

	arrImages[1]="images/slide/2.jpg";

	arrImages[2]="images/slide/3.jpg";

	arrImages[3]="images/slide/4.jpg";

	arrImages[4]="images/slide/5.jpg";
	



var arrImages=new Array();

var rotate_delay = 4500; // delay in milliseconds (5000 = 5 secs)
var current = 0;
var first = true;
var timeOut;


function rotate()
{
 	if(arrImages.length>0)
	{
		
		
 

  		document.getElementById("slide").src  = arrImages[current] ;
 
 		if (current == arrImages.length-1)
		{
			current=0;
		}
		else
			current++;
			
 		timeOut = window.setTimeout("rotate()", rotate_delay);
		
	}
	else	
		clearTimeout(timeOut);
}


 
  
  
function showHideTable(menuId){
    var obj=document.getElementById(menuId);
    obj.style.visibility=(obj.style.visibility=="visible"?"hidden":"visible");
 
}

function hideTable(menuId){
		var obj=document.getElementById(menuId);
		obj.style.visibility="hidden";
}


function showhide(ob){
	
   var obj=document.getElementById(ob).style;
    
   if (obj.display=="none"){
      obj.display="block";
   }
   else {
      obj.display="none";

   }
}


 
function trim(str) 
{
	while (str.substring(0,1) == ' ')
	{
		str = str.substring(1, str.length);
	}
	while (str.substring(str.length-1, str.length) == ' ')
	{
		str = str.substring(0,str.length-1);
	}
	return str;
}


function popUp(URL,width,height,win) {
	Mytop = getSize("height");
	Myleft = getSize("width");
	//Mytop = 150;
	//Myleft =Myleft/2-150;
	Winrc = window.open(URL,win, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height  + ',left = '+ Myleft + ',top = '+Mytop);
}
function getSize(what) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  if (what=="height")
	return myHeight ;
  else
	return myWidth ;
}
 
 
function alphanumeric(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
		  {
		  }
		else	{
			 return false;
		  }
		}
 return true;
}

function alpha(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
 		  if((hh >= 1488 && hh<=1514) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==32)
		  {
		  }
		else	{
			 return false;
		  }
		}
 return true;
}
 
 
function checkEmail(email) {
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email)) 
	return false;
return true;
}

function checkLen(field){

	var maxLen=200;
 
	if (document.getElementById(field).value.length > maxLen) // if too long...trim it!
		document.getElementById(field).value = document.getElementById(field).value.substring(0, maxLen);
 

}

 
var letters=' ABC?DEFGHIJKLMN?OPQRSTUVWXYZabc?defghijklmn?opqrstuvwxyz????????????????????????'
var numbers='1234567890'
var signs=',.:;@-\''
var mathsigns='+-=()*/'
var custom='<>#$%&?¿'

function alpha(e,allow) {
var k;
k=document.all?parseInt(e.keyCode): parseInt(e.which);
return (allow.indexOf(String.fromCharCode(k))!=-1);
//onkeypress="return alpha(event,numbers)"
}

 

