// JScript source code
function over(t)
{
t.style.backgroundColor='#F6E8BD';
}

function out(t)
{
t.style.backgroundColor='#DDC98C';
}

function over2(t)
{
t.style.borderTop='#DDC98C 1px solid';t.style.borderBottom='#DDC98C 2px solid';
}

function out2(t)
{
t.style.borderBottom='#DDC98C 1px solid';t.style.borderTop='#FFFAEA 2px solid';
}

r=254
g=242
b=206

function fadetext(){ 
  if(b>0) { //If color is not black yet
    r-=10;g-=10;b-=10; // increase color darkness
    document.getElementById("sample").style.color=
                      "rgb("+r+","+g+","+b+")";
    setTimeout("fadetext()",200); 
  }
  else
 fadetext2();
}

function fadetext2(){ 
	if(b<200)
		{
		r+=1;g+=1;b+=1; // increase color darkness
		 document.getElementById("sample").style.color="rgb("+r+","+g+","+b+")";
		setTimeout("fadetext2()",20); 
		}
		else
		{
			r=254
			g=242
			b=206
			setTimeout("fadetext()",500);
		}
}

function validate()
{
if(document.fm.firstname.value=="")
{
alert("Name can not be blank");
document.fm.firstname.focus();
return;
}

if(document.fm.email.value.indexOf("@")==-1 || document.fm.email.value.indexOf(".")==-1)
{
alert("Invalid email address");
document.fm.email.focus();
return;
}

if(document.fm.pass.value=="")
{
alert("Password can not be blank");
document.fm.pass.focus();
return;
}

document.fm.submit();

}

function countryvalidate()
{
if(document.international.firstname.value=="")
{
alert("Name can not be blank");
document.international.firstname.focus();
return;
}

if(document.international.email.value.indexOf("@")==-1 || document.international.email.value.indexOf(".")==-1)
{
alert("Invalid email address");
document.international.email.focus();
return;
}


document.international.submit();

}



function newsletter()
{

if(newsemail.value.indexOf("@")==-1 || newsemail.value.indexOf(".")==-1)
{
alert("Invalid email address");
newsemail.focus();
return;
}
location.href="http://www.india-yellow-pages.com/newsletter.asp?email="+newsemail.value;
}
