function popUp(URL,w,h) {
			
		day = new Date();
		id = day.getTime();			
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+(w)+',height='+(h)+',left = 345.5,top = 217.5');");
}
function popUp2(URL,w,h) {
			
		day = new Date();
		id = day.getTime();			
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+(w)+',height='+(h)+',left = 345.5,top = 217.5');");
}

function alertCon(){
	alert('Under Construction');
}


		leftBg = new Image();
		leftBg.src = 'images/fix/left/blue_.gif';
		leftBg1 = new Image();
		leftBg1.src = 'images/fix/left/red.gif';
		topBg = new Image();
		topBg.src = 'images/fix/top/top_.gif';


		//select home_1
		var aba1 = '1';
		tab11on = new Image();
		tab11on.src = 'images/home/select1/tab1off.gif';
		tab11off = new Image();
		tab11off.src = 'images/home/select1/tab1.gif';
		
		tab21on = new Image();
		tab21on.src = 'images/home/select1/tab2off.gif';
		tab21off = new Image();
		tab21off.src = 'images/home/select1/tab2.gif';
		
		tab31on = new Image();
		tab31on.src = 'images/home/select1/tab3off.gif';
		tab31off = new Image();
		tab31off.src = 'images/home/select1/tab3.gif';
		
	function stAba1(menu1,conteudo1)
	{
		this.menu1 = menu1;
		this.conteudo1 = conteudo1;
	}

	var arAbas1 = new Array();
	arAbas1[0] = new stAba1('td_cadastro1','div_cadastro1');
	arAbas1[1] = new stAba1('td_consulta1','div_consulta1');
	arAbas1[2] = new stAba1('td_manutencao1','div_manutencao1');
	
	
	function AlternarAbas1(menu,conteudo,aban1)
	{
	    for (i=0;i<arAbas1.length;i++)
		{
			document.getElementById(arAbas1[i].menu1).className = 'menu';
			document.getElementById(arAbas1[i].conteudo1).style.display = 'none';
		}
		document.getElementById(menu).className = 'menu-sel';
		document.getElementById(conteudo).style.display = '';
		
		switch(aba1){
			case '1':{
				roll('tab11',0);
				break;
				}
			case '2':{
				roll('tab21',0);
				break;
				}
			case '3':{
				roll('tab31',0);
				break;
				}
		}
		aba1 = aban1;
		
		switch(aban1){
			case '1':{
				roll('tab11',1);
				break;
				}
			case '2':{
				roll('tab21',1);
				break;
				}
			case '3':{
				roll('tab31',1);
				break;
				}
		}	
	}
	
	
	
	
			//select_Home
		var aba = '1';
		tab1on = new Image();
		tab1on.src = 'images/home/select/tab1off.gif';
		tab1off = new Image();
		tab1off.src = 'images/home/select/tab1.gif';
		
		tab2on = new Image();
		tab2on.src = 'images/home/select/tab2off.gif';
		tab2off = new Image();
		tab2off.src = 'images/home/select/tab2.gif';
		
		tab3on = new Image();
		tab3on.src = 'images/home/select/tab3off.gif';
		tab3off = new Image();
		tab3off.src = 'images/home/select/tab3.gif';
		
	function roll(imgName,a){
	   imgState=a==0?eval(imgName + 'on.src'):eval(imgName + 'off.src');
	   document.images[imgName].src = imgState;
	}
		
	function stAba(menu,conteudo)
	{
		this.menu = menu;
		this.conteudo = conteudo;
	}

	var arAbas = new Array();
	arAbas[0] = new stAba('td_cadastro','div_cadastro');
	arAbas[1] = new stAba('td_consulta','div_consulta');
	arAbas[2] = new stAba('td_manutencao','div_manutencao');
	
	
	function AlternarAbas(menu,conteudo,aban)
	{
	    for (i=0;i<arAbas.length;i++)
		{
			document.getElementById(arAbas[i].menu).className = 'menu';
			document.getElementById(arAbas[i].conteudo).style.display = 'none';
		}
		document.getElementById(menu).className = 'menu-sel';
		document.getElementById(conteudo).style.display = '';
		
		switch(aba){
			case '1':{
				roll('tab1',0);
				break;
				}
			case '2':{
				roll('tab2',0);
				break;
				}
			case '3':{
				roll('tab3',0);
				break;
				}
		}
		aba = aban;
		
		switch(aban){
			case '1':{
				roll('tab1',1);
				break;
				}
			case '2':{
				roll('tab2',1);
				break;
				}
			case '3':{
				roll('tab3',1);
				break;
				}
		}	
	}
	
	
	//Tips
	tip = new Array();
	tip[1] = 'tip1';
	tip[2] = 'tip2';
	tip[3] = 'tip3';
	tipn = 1;
	function nextt(){
		document.getElementById(tip[tipn]).style.display = 'none';
		if(tipn+1 == 4){
			tipn = 0;
		}
		document.getElementById(tip[tipn+1]).style.display = '';
		tipn = tipn+1;
	}
	function prevt(){
		document.getElementById(tip[tipn]).style.display = 'none';
		if(tipn-1 == 0){
			tipn = 4;
		}
		document.getElementById(tip[tipn-1]).style.display = '';
		tipn = tipn-1;
	}
	
	
	
	//Movies
	mov = new Array();
	mov[1] = 'mov1';
	mov[2] = 'mov2';
	mov[3] = 'mov3';
	movn = 1;
	function nextmov(){
		document.getElementById(mov[movn]).style.display = 'none';
		if(movn+1 == 4){
			movn = 0;
		}
		document.getElementById(mov[movn+1]).style.display = '';
		movn = movn+1;
	}
	function prevmov(){
		document.getElementById(mov[movn]).style.display = 'none';
		if(movn-1 == 0){
			movn = 4;
		}
		document.getElementById(mov[movn-1]).style.display = '';
		movn = movn-1;
	}
	
	
	
	
	
	
	//Classifields
	cla = new Array();
	cla[1] = 'cla1';
	cla[2] = 'cla2';
	cla[3] = 'cla3';
	cla[4] = 'cla4';
	clan = 1;
	function selectCla(clanN){
		document.getElementById(cla[clan]).style.display = 'none';
		document.getElementById(cla[clanN]).style.display = '';
		clan = clanN;
	}
	
	
	
	
	
	//Health
	hea = new Array();
	hea[1] = 'hea1';
	hea[2] = 'hea2';
	hea[3] = 'hea3';
	hea[4] = 'hea4';
	hea[5] = 'hea5';
	hea[6] = 'hea6';
	hea[7] = 'hea7';
	hea[8] = 'hea8';
	hea[9] = 'hea9';
	hean = 1;
	function selectHea(heaN){
		document.getElementById(hea[hean]).style.display = 'none';
		document.getElementById(hea[heaN]).style.display = '';
		hean = heaN;
	}
	
	
	
	
	//top_news
	topi = new Array();
	topi[1] = 'top1';
	topi[2] = 'top2';
	topi[3] = 'top3';
	topi[4] = 'top4';
	topi[5] = 'top5';
	var oldtop = 1;
	function divch(numtop) {
		document.getElementById(topi[oldtop]).style.display = 'none';
		document.getElementById(topi[numtop]).style.display = '';
		oldtop = numtop;
	}
	function next() {
		document.getElementById(topi[oldtop]).style.display = 'none';
		
		if(oldtop+1 == 6){
			oldtop = 0;
		}
		document.getElementById(topi[oldtop+1]).style.display = '';
		oldtop = oldtop+1;
	}
	function prev(){
		document.getElementById(topi[oldtop]).style.display = 'none';
		if(oldtop-1 == 0){
			oldtop = 6;
		}
		document.getElementById(topi[oldtop-1]).style.display = '';
		oldtop = oldtop-1;
	}
	
	
	
	
	function submitReg(){  
		if (document.register.name.value.length < 3){
			alert('Please enter your name');
			return false;
		}
		if (document.register.email.value == ''){
			alert('Please enter your email');
			document.register.email.focus();
			return false;
		}
		if(!isEmail(document.register.email.value)){
			alert('Invalid email Address');
			document.register.email.focus();
			return false;

		
		}
    }
	
	
	
	function submitSubs(){
		if(isBlank(document.register1.name.value)){
			alert('Please enter your Name');
			document.register1.name.focus();
			return false;
		}
		if(isBlank(document.register1.adress.value)){
				alert('Please enter your Adress');
				document.register1.adress.focus();
				return false;
		}
		if(isBlank(document.register1.phone.value)){
					alert('Please enter your Phone');
					document.register1.phone.focus();
					return false;
		}
		if(isBlank(document.register1.email.value)){
						alert('Please enter your Email');
						document.register1.email.focus();
						return false;
		}				
		if(!isEmail(document.register1.email.value)){
						alert('Invalid email address');
						document.register1.email.focus();
			return false;
		}				

}
	
	
//Added Below
//-------------------------------------------------------------------
// isBlank(value)
//   Returns true if value only contains spaces
//-------------------------------------------------------------------
function isBlank(val){
	if(val==null){return true;}
	for(var i=0;i<val.length;i++) {
		if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
		}
	return true;
	}
//Check Email and return true if correct email
	function isEmail(curfield)
{

    fieldValue  = curfield;
    fieldLength = curfield.length; 
    if (fieldLength < 8)
	{
		return false;
    }
	else
	{
        if( /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fieldValue))
		{
			return true;
        }
		else
		{
			return false;
        }
    }























}
//end 
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	