function currentDate() {
var d=new Date()
var y=d.getYear()
var weekday=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
document.write(weekday[d.getDay()] + " ")
document.write(d.getDate() + "-")
document.write(monthname[d.getMonth()] + "-")
document.write(String(y).substr(2,4))
}

function currentTime(){
var d = new Date();
var curr_hr = d.getHours();
var curr_min = d.getMinutes();
document.write (curr_hr+ " : " +curr_min);

}
function MM_reloadPage(init) { 
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function show_cricket() {
window.open("http://www.andhrajyothy.com/cricket/livescore.asp","LiveScore","width=240,height=370,status=0,noresizable,scrollbars=no,toolbar=no,menubar=no,top=0,left=100");
}
function show_popup() {
window.open("popup.htm","window2","width=350,height=400,status=0,resizable=0,scrollbars=no,toolbar=no,menubar=no,top=350,left=10");
}
function criknow() {
window.open("http://www.andhrajyothy.com/cricket/livescore.asp","LiveScore","width=175,height=300,status=0,noresizable,scrollbars=no,toolbar=no,menubar=no,top=0,left=100");
}
function show_polls() {
window.open("asspolls.htm","window2","width=400,height=419,status=0,resizable=0,scrollbars=no,toolbar=no,menubar=no,top=350,left=10");
}
function show_gallery1() {
window.open("main/bottomcart.htm","window3","width=400,height=500,status=0,noresizable,scrollbars=no,toolbar=no,menubar=no,top=50,left=50");
}
function show_Cartoon1() {
window.open("main/cartoon1.htm","window3","width=400,height=500,status=0,noresizable,scrollbars=no,toolbar=no,menubar=no,top=50,left=50");
}
function show_ningi() {
window.open("main/ningiAd.htm","window3","width=981,height=682,status=0,noresizable,scrollbars=yes,toolbar=no,menubar=no,top=50,left=50");
}
function ums() {
window.open("../gallery/ums.htm","window3","width=650,height=650,status=0,noresizable,scrollbars=no,toolbar=no,menubar=no,top=50,left=50");
}
function weather() {
window.open("http://www.imd.gov.in/section/nhac/dynamic/apimd.htm","window3","width=600,height=400,status=0,noresizable,scrollbars=no,toolbar=no,menubar=no,top=50,left=50");
}
function show_polling() {
window.open("../gallery/polling.htm","window3","width=500,height=700,status=0,noresizable,scrollbars=no,toolbar=no,menubar=no,top=50,left=50");
}
function show_tara() {
window.open("main/side.htm","window3","width=170,height=320,status=0,noresizable,scrollbars=no,toolbar=no,menubar=no,top=50,left=50");
}

function ajaddsite() {
window.open("ajaddsite.htm","window3","width=400,height=200,status=0,scrollbars=no,toolbar=no,menubar=no,top=50,left=50");
}
function show_gallery20() {
galname=document.form2.photogallery.options[document.form2.photogallery.selectedIndex].value;
if(galname!="none");
{
window.open("gallery/"+galname+".htm","window3","width=600,height=500,status=0,resizable=0,scrollbars=yes,toolbar=no,menubar=no,top=8,left=50");
}
}
function call_district()
{
disname=document.form1.district.options[document.form1.district.selectedIndex].value;
if(disname!="none");
{
window.open("../../districts/districtshow.asp?qry="+disname,"_top");
}
}

function bookmark() {
if (document.all){
document.write('<A HREF="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.andhrajyothy.com\');">');
document.write('<img src="/i/images/homepage.jpg"></a>');
}
else if (document.getElementById){
document.write('<a href="http://www.andhrajyothy.com"><img src="/i/images/homepage.jpg"></a>');
}
else if (document.layers){
document.write('<b>Make this site your home page:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.');
}
else {
document.write('<b>Make this site your home page:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.');
}
}
function show_gallery20() {
galname=document.form2.photogallery.options[document.form2.photogallery.selectedIndex].value;
if(galname!="none");
{
window.open("gallery/"+galname+".htm","window3","width=600,height=500,status=0,resizable=0,scrollbars=yes,toolbar=no,menubar=no,top=8,left=50");
}
}
function ajaddsite() {
window.open("ajaddsite.htm","window3","width=400,height=200,status=0,scrollbars=no,toolbar=no,menubar=no,top=50,left=50");
}

// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function ValidateForm(){

	var yname=document.profile.yname
	var emailID=document.profile.emailid
	var Phone=document.profile.phno
	
	if ((yname.value==null)||(yname.value=="")){
		alert("Please Enter your Name")
		yname.focus()
		return false
	}

	

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	

	return true



		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 call_author()
{
disname=document.search.authorlist.options[document.search.authorlist.selectedIndex].value;
if(disname!="none");
{
window.open("AJSearchFinal1.asp?QS="+disname+"&QP=Eauthor","_top");
}
}

function call_contenttype()
{
catname=document.search2.category.options[document.search2.category.selectedIndex].value;
if(catname!="none");
{
window.open("AJSC.asp?QS="+catname+"&QP=ContentType","_top");
}
}

