// Tabs JavaScript Document
var ids =  new Array('div1','div2','div3','div4','div5','div6','div7','div8','div9','div10','div11','div12','div13','div14','div15','div16','div17','div18','div19','div20','div21','div22','div23','div24','div25','div26');

function switchid(id){	
			hideallids();
			showdiv(id);
}

function hideallids(){		//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {		//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
	if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { 	// IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {	//safe function to show an element with a specified id  
	if (document.getElementById) { 	// DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';		
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';			
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}
   function isInteger (s)
   {
      var i;
      s = s.replace(".","");
      if (isEmpty(s))
      if (isInteger.arguments.length == 1) return 0;
      else return (isInteger.arguments[1] == true);

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c)) return false;
      }

      return true;
   }
   function isEmpty(s)
   {
      return ((s == null) || (s.length == 0))
   }

   function isDigit (c)
   {
      return ((c >= "0") && (c <= "9"))
   }
   
   function emailcheck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){		   
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){		   
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){		   
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){		    
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){		    
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){		   
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){		    
		    return false;
		 }

 		 return true;					
}

