//*****popup menu*************//

flagmenu="true";

function showdiv()
{

if (flagmenu=="true")
{
div1.style.left=document.body.scrollLeft+event.clientX-event.offsetX+418
div1.style.top=document.body.scrollTop+event.clientY-event.offsetY+10
div1.filters.revealTrans.transition=5;
div1.filters.revealTrans.apply()
div1.filters.revealTrans.play()
div1.style.visibility="visible"
flagmenu="false";
}
else
{
div1.filters.revealTrans.transition=4;
div1.filters.revealTrans.apply()
div1.filters.revealTrans.play()
div1.style.visibility="hidden"
flagmenu="true";
}
}



//*****Date Script*************//


function printdate()
{
var mydate=new Date()
day=mydate.getDay()
dat=mydate.getDate()
mon=mydate.getMonth()
yer=mydate.getYear()

switch (day)
{
case 0:
 day="Sunday"
 break;
case 1:
 day="Monday"
 break;
case 2:
 day="Tuesday"
 break;
case 3:
 day="Wednesday"
 break;
case 4:
 day="Thrusday"
 break;
case 5:
 day="Friday"
 break;
case 6:
 day="Saturday"
 break;
}
switch (mon)
{
case 0:
 mon="January"
 break;
case 1:
 mon="February"
 break;
case 2:
 mon="March"
 break;
case 3:
 mon="April"
 break;
case 4:
 mon="May"
 break;
case 5:
 mon="June"
 break;
case 6:
 mon="July"
 break;
case 7:
 mon="August"
 break;
case 8:
 mon="September"
 break;
case 9:
 mon="October"
 break;
case 10:
 mon="November"
 break;
case 11:
 mon="December"
 break;
}
finaldate=day + "," + mon + dat + "," + yer
document.form.txtdate.value=finaldate
}


//*****Time Script*************//


var mytimeout
var tempampm
function showtime()
{
mytime=new Date()
hour=mytime.getHours();
if (hour<12)
   wish="Morning"
  else
    if (hour<17)
      wish="Afternoon"
    else
      if (hour<20)
       wish="Evening"
        else
	  wish="Night"
//document.form.txtwish.value="Good "+wish+"!"

if (hour<=9)
{
hour="0" + hour
}
if (hour<=12)
{
tempampm="am"
}
else
{
tempampm="pm"
}

minute=mytime.getMinutes();
if (minute<=9)
{
minute="0" + minute
}

second=mytime.getSeconds();
if (second<=9)
{
second="0" + second
}

curtime=hour+":"+minute+":"+second+tempampm
document.form.txttime.value=curtime
mytimeout=window.setTimeout("showtime()",100)
}


//*****Flash Link Color Change*************//


var flashtimer
function changecolor()
{
  /*var countf=document.all.f1
  var l=document.all.f1.length
  for (i=0;i<l;i++)
  {
	if (countf[i].style.backgroundColor=="#336699")
	{
	    countf[i].style.backgroundColor="#669900"
	    countf[i].style.color="#FFFF00"
	}
	else
	{
	    countf[i].style.backgroundColor="#336699"
	    countf[i].style.color="#FFFFFF"
	}
  }
flashtimer=window.setTimeout("changecolor()",1000)
*/
}
/*************Prevent Right Click**************/

function rightclick(e) 
{
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
{
alert("Welcome to srikhetra.com");
return false;
}
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) 
{
alert("Welcome to shreekhetra.com");
return false;
}
return true;
}

// to prevent right click :
document.onmousedown=rightclick;

// to prevent right click on images include:
for (var i=0; i<document.images.length; i++)
{
document.images[i].onmousedown=rightclick;
}

/* to prevent right click on links include:
for (var i=0; i<document.links.length; i++)
{
document.links[i].onmousedown=rightclick;
}
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
{
window.onmousedown=rightclick;
}*/
/*************Sound Effect**************/

function cngcur()
{
document.play1.style.cursor="hand";
}

function cngcur1()
{
document.stop1.style.cursor="hand";
}

function play()
{
document.welbell.play();
}

function stop()
{
document.welbell.stop();
}


function keyDown(DnEvents)
{
  k=window.event.keyCode
  if(k==93)
  {
  alert("Welcome to shreekhetra.com");
  }
}

document.onkeydown = keyDown

var minfont=8;
var maxfont=18;
function increaseFontSize(divname) {
   var p = document.getElementById(divname).getElementsByTagName('font');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=maxfont) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}

function decreaseFontSize(divname) {
   var p = document.getElementById(divname).getElementsByTagName('font');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=minfont) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}

function linkthispage()
{
window.open('linkthispage.html', 'LinkToThisPage', 'width=500,height=270,scrollbars=no,resizable=no,status=yes');
}

function addfav()
{
   if (document.all)
   {
      window.external.AddFavorite
      ("http://www.shreekhetra.com","Shreekhetra - The Holy City of Lord Jagannath")
   }
}

function opendesktopshortcut()
{
window.open('popup/desktop.html', 'DesktopShortcut', 'width=500,height=400,scrollbars=yes,resizable=no,status=yes');
}

function opentellafriend()
{
window.open('popup/tellafriend.php', 'TellAFriend', 'width=500,height=370,scrollbars=yes,resizable=no,status=yes');
}

function linktous()
{
window.open('popup/linktous.html', 'LinkToUS', 'width=500,height=400,scrollbars=yes,resizable=no,status=yes');
}

