function validatemidc()
{
	if(window.document.midc.search.value=="")
	{
		alert("Please specify Search Text...");
		window.document.midc.search.focus();
		return false;
	}
	
	window.document.midc.action="MIDC search/midcsearch.asp";
	window.document.midc.submit();
	return true;
}


function accept()
{
	var opival = "c";

	if (window.document.opinion.optype[0].checked) 
	{
		opival="y";
	}

	if (window.document.opinion.optype[1].checked) 
	{
		opival="n";
	}

	if (window.document.opinion.optype[2].checked) 
	{
		opival="c";
	}
	ques=window.document.opinion.ques.value;
	opt1=window.document.opinion.option1.value;
	opt2=window.document.opinion.option2.value;
	opt3=window.document.opinion.option3.value;

	var fnam="asp/opinion7.asp?addflag=1&opival=" + opival + "&opt1=" + opt1 + "&opt2=" + opt2 + "&opt3=" + opt3+ "&ques=" + ques; 

	window.open(fnam,"poll","resizable=no,toolbar=0,location=0,menubar=0,status=0,height=400,width=300,,scrollbars=0");
}
function subme(t)
{
	var k=0;
	var unsubs="n";
	var emailpat =/^(\".*\"|[A-Za-z0-9]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z0-9]\w*(\.[A-Za-z0-9]\w*)+)$/;
	var matcharray = window.document.subscribe.email.value.match(emailpat);

    if (matcharray == null)
      { k=1;
        alert("Invalid E-mail Id");
        return false;
      }

	if (window.document.subscribe.unsub.checked)
	{
	unsubs="y";
	}

	if (k==0)
	{
	var email=t.email.value
	var fnam="asp/subscribe.asp?email=" + email + "&unsub=" + unsubs
	window.open(fnam,"_newwindow","resizable=no,toolbar=0,height=300,width=270,,scrollbars=0")
	}

	return true;
}

function showpoll2()
{
	ques=window.document.opinion.ques.value;
	var fnam="asp/opinion7.asp?ques=" + ques ;
	
	window.open(fnam,"_newwindow","resizable=no,toolbar=0,location=0,menubar=0,status=0,height=500,width=300,,scrollbars=0");
}

function valstd()
{
if(window.document.tsearch2.placename.value=="") 
{
alert("Please Type Place name to Search...Use Any for complete listing");
window.document.tsearch2.placename.focus();
return false;
}
window.document.tsearch2.action="asp/jalgaon telephones.asp";
window.document.tsearch2.submit();
return true;
}

function validatefrm()
{
if((window.document.tsearch.namesearch.value=="") && (window.document.tsearch.phonesearch.value==""))
{
alert("Please Type Name/ Telephone no. to search");
window.document.tsearch.namesearch.focus();
return false;
}
window.document.tsearch.action="asp/tsearch4.asp";
window.document.tsearch.submit();
return true;
}

function CheckForm () {

	if (document.frmSiteSearch.search.value==""){
		alert("Please enter at least one keyword to search");
		document.frmSiteSearch.search.focus();
		return false;
	}
	
	return true
}

var dt     = 0;
var possDt  = 0;
var tdChecked = false;
var tz     = 5;
var tzMin  = 30;
var id     = null;

function init() {

   adjustDate();
   displayTime();
      defaultSelected = 0;
      selectedIndex = 0;
}

function setPlace() 
{
tz = 5; tzMin = 30; possDt = 0;
tdChecked = false;
displayTime();
}

function adjustDate() {
   var base = new Date()
   var testDate = base
   testDate = testDate.toLocaleString()
   testDate = new Date(testDate)
   zoneError = (base.getTimezoneOffset() >= 720) ? (1000 * 60 * 60 * 24) : 0
   correctErrors = 2 * (testDate.getTime() - base.getTime()) - zoneError
}

function leadZero(x) {
   if (x < 10) {
       x = "0" + x;
   }
   return(x);
}

function getDt(x) {
   month = x.getMonth()+1;
   if (((month >= 4) && (month <= 10)) && (possDt == 1)) {
      dt = 1;
   }
   else if (((month <=4) || (month >= 10)) && (possDt == 2)) {
      dt = 1;
   }
   else if (((month <=3) || (month >= 11)) && (possDt == 3)) {
      dt = 1;
   }  
   else if (((month <=1) || (month >= 10)) && (possDt == 4)) {
      dt = 1;
   }  
   else {
      dt = 0;
   }
   tdChecked = true;
}

function formatDate(x) {
   daynames   = "SunMonTueWedThuFriSat";
   monthnames = "JanFebMarAprMayJunJulAugSepOctNovDec";
   month = x.getMonth();
   dom = x.getDate();
   dow = x.getDay();
   year = x.getYear();
   return(" "+daynames.substring(dow *3 ,dow * 3 +3)+", "+dom+" "+monthnames.substring(month * 3, month * 3 + 3)+" "+year);
}

function formatTime(x) {
   hour   = leadZero(x.getHours());
   minute = leadZero(x.getMinutes());
   second = leadZero(x.getSeconds());
   return(" "+hour+":"+minute+":"+second)
}

function displayTime(){
   var dummy = new Date();
   var target = new Date();

   if (!tdChecked) {
       getDt(dummy);
   }
   target.setTime(dummy.getTime() + ((tz + dt) * 60 + tzMin) * 60 * 1000 - correctErrors);
   time = target.toGMTString();
   target.setTime(Date.parse(time.substring(0, time.length -3)));

   document.worldclock.timeshow.value = formatTime(target);
   id = setTimeout("displayTime()",999);
}
function shayari()
{
	var fnam="today/shayaritoday.html"

	window.open(fnam,"shayari","resizable=no,toolbar=0,location=0,menubar=0,status=0,height=500,width=700,,scrollbars=1");

}
function jokewind()
{
	var fnam="today/joketoday.html"

	window.open(fnam,"joke","resizable=no,toolbar=0,location=0,menubar=0,status=0,height=500,width=500,,scrollbars=1");

}

function quotes()
{
	var fnam="today/quote of the day.htm"

	window.open(fnam,"Quote","resizable=no,toolbar=0,location=0,menubar=0,status=0,height=500,width=500,,scrollbars=1");

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
