////////////////////////////
function runClock() {
theTime = window.setTimeout("runClock()", 1000);
var today = new Date();
var yea = today.getYear();
var display= today.toLocaleString();
display+=" NST";
document.f1.face.value=display;
}
///////////////////////

///////////////////////
var timerID = null;
var timerRunning = false;
 function MakeArray(size) 
  {
	  this.length = size;
	  for(var i = 1; i <= size; i++)
  	{
  		this[i] = "";
  	}
  	return this;
  }

function stopclock ()
{
	if(timerRunning)
	clearTimeout(timerID);
	timerRunning = false;
}
function showtime () 
{
	 var now = new Date();
	 var year = now.getCentury();
	 var month = now.getMonth() + 1;
	 var date = now.getDate();
	 var hours = now.getHours();
	 var minutes = now.getMinutes();	
	 var seconds = now.getSeconds()
	 var day = now.getDay();
	 Day = new MakeArray(7);
	 Day[0]="Sun";
	 Day[1]="Mon";
	 Day[2]="Tue";
	 Day[3]="Wed";
	 Day[4]="Thu";
	 Day[5]="Fri";
	 Day[6]="Sat";
	var timeValue = "";
	var timeValue = "";
	timeValue += ((month < 10) ? " 0" : " ") + month + "-";
	timeValue += date + "-" + year + "  ";
	timeValue += ((hours <= 12) ? hours : hours - 12);
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
	timeValue += (hours < 12) ? " AM" : " PM";
	timeValue += " NST";
	//document.f1.face.value=now;

document.f1.face.value=timeValue;
	timerID = setTimeout("showtime()",1000);
	timerRunning = true;
}
function startClock() {
stopclock();
showtime();
}


/*var timerID = null;
var timerRunning = false;

function stopclock (){
        if(timerRunning)
                clearTimeout(timerID);
        timerRunning = false;
}


function showtime () {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds()
        var timeValue = "" + ((hours >12) ? hours -12 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds
        timeValue += (hours >= 12) ? " P.M." : " A.M."
    	 document.f1.face.value=timeValue;
        timerID = setTimeout("showtime()",1000);
        timerRunning = true;
}
function startClock () {
        stopclock();
        showtime();
}*/
////////////////////////////////////////////

	function showimg(theURL,winName,features)
	{ 	 
		  window.open(theURL,winName,features);
  	}
	function showgalimage(ee)
	{
	
	showimg("showgal.php?iid="+ee,"JKJ","resizable=yes,scrollbars=yes")	

	}
	
	function showpollres()
	{
	showimg("thanks.php","JKJ","resizable=no,scrollbars=yes width=250,height=100")	
	}

	function showpollgraph(value)
	{
	showimg(value,"JKJ","resizable=no,scrollbars=yes width=250,height=100")	
	}
	
	function getresults(value)
	{
		showimg("findpollresult.php?pollid="+value,"JKJ","resizable=no,scrollbars=yes width=400,height=300");
	}

	function checkfield(thisform)
	{
		for(j=0;j<thisform.forms.length;j++)
		{
				if(document.forms[j].name=="frmfeedback")
				{
					document.forms[j].txtname.focus();
				}
		}
		
	}
		
	function showfeedbackres()
	{
	showimg("thanks2.php","JKJ","resizable=no,scrollbars=yes width=250,height=100")	
	}



function isemail(formemail) 
{
	v=formemail.txtemail.value;
	pos= (v.indexOf("@"));
	pos2=(v.indexOf("."));
	if(pos==-1 || pos2==-1)
	{
		alert ("Please enter Valid EmailID");
		return false;
	}
	else
	{
		return true;
	}
			
}
