

function gradient(id, level)
{
	var box = document.getElementById(id);
	box.style.opacity = level;
	box.style.MozOpacity = level;
	box.style.KhtmlOpacity = level;
	box.style.filter = "alpha(opacity=" + level * 100 + ")";
	box.style.display="block";
	return;
}


function fadein(id) 
{
	var level = 0;
	while(level <= 1)
	{
		setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10);
		level += 0.01;
	}
}


// Open the lightbox


function openbox(formtitle, fadin)
{
	
 	   document.getElementById('CssBlogTBL').style.display='block';
	   document.getElementById('ButDownloadClose').style.display='none';

 var box = document.getElementById('NewPopbox'); 
  document.getElementById('NewPopfilter').style.display='block';

  var btitle = document.getElementById('NewPopboxtitle');
  btitle.innerHTML = formtitle;
  
  if(fadin)
  {
	 gradient("NewPopbox", 0);
	 fadein("NewPopbox");
  }
  else
  { 	
    box.style.display='block';
  } 
  document.frmvaildtax.txtName.value='';
  document.frmvaildtax.txtEmailId.value='';
}


// Close the lightbox

function closebox()
{
   document.getElementById('NewPopbox').style.display='none';
   document.getElementById('NewPopfilter').style.display='none';
}


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function vaildfrmtax(){
	
	if(document.frmvaildtax.txtName.value==''){
		alert("Please enter the Name");	
		return false;
	}else if(document.frmvaildtax.txtEmailId.value==''){
		alert("Please enter the Email address");	
		return false;
	}else if(echeck(document.frmvaildtax.txtEmailId.value)==false){
		document.frmvaildtax.txtEmailId.value='';	
		return false;
	}else{
	   //document.getElementById('NewPopbox').style.display='none';
	   document.getElementById('CssBlogTBL').style.display='none';
	   document.getElementById('ButDownloadClose').style.display='block';
	   document.frmvaildtax.txtEmailId.value='';
	   document.frmvaildtax.txtName.value='';
	}
}