// DISABLE RIGHT CLICK
var message="";
function clickIE() 
{
  if (document.all) 
  {
    (message);
    return false;
  }
}
function clickNS(e) 
{
  if (document.layers || (document.getElementById && !document.all)) 
  {
    if (e.which==2||e.which==3) 
    {
      (message);
      return false;
    }
  }
}
function KEYPRESS() 
{
  if ((event.keyCode==16) || (event.keyCode==17) || (event.keyCode==18) || (event.keyCode==65) || (event.keyCode==93))
  (message);
}
if (document.layers) 
{
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown=clickNS;
}
else
{
  document.onmouseup=clickNS;
  document.oncontextmenu=clickIE;
}
document.onkeydown=KEYPRESS;
document.oncontextmenu=new Function("return false")


// STATUS BAR WELCOME MESSAGE
window.defaultStatus='Welcome to Chinese-Astrology - http://www.chinese-astrology.co.uk';
//window.status = "Welcome to Chinese-Astrology - http://www.chinese-astrology.co.uk";


// BOOKMARK
function bookmark()
{
  var bookmarkurl="http://www.chinese-astrology.co.uk"
  var bookmarktitle="Chinese-Astrology"
  var ver = navigator.appName;
  var num = parseInt(navigator.appVersion);
  if ((ver == "Microsoft Internet Explorer") && (num >= 4))
  {
    window.external.AddFavorite(bookmarkurl,bookmarktitle)
  }
  else
  {
    alert("Press (Ctrl+D) to Bookmark this link");
  }
}


// HOMEPAGE
function homePage(URL)
{
var ver = navigator.appName
var num = parseFloat(navigator.appVersion)
  if ((ver == "Netscape") && (num <= 4.03))
  {
    var Text = '';
    Text += 'Due to Netscapes security handling, making this page your homepage, will show you a dialog with a warning. If you do not wish to grant this site the access to your browser settings,';
    Text += ' you can manually copy the current location and paste it in the location field in Edit Preferences / Navigator.';
    if (confirm (Text))
    {
      netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
      navigator.preference('browser.startup.homepage',URL);
    }
  }
  else 
  if (!document.all)
  {
    alert('Sorry, not supported in this browser, please change this setting manually');
  }
}


// GREETING
day = new Date()
hr = day.getHours()
var greeting;

if((hr==0)||(hr==1)||(hr==2)||(hr==3)||(hr==4)||(hr==5)||(hr==6)||(hr==7)||(hr==8)||(hr==9)||(hr==10)||(hr==11)) 
{
  greeting = "Good Morning";
}
else
{
  if((hr==12)||(hr==13)||(hr==14)||(hr==15)||(hr==16)||(hr==17))
  {
    greeting = "Good Afternoon";
  }
  else
  {
    if((hr==18)||(hr==19)||(hr==20)||(hr==21)||(hr==22)||(hr==23))
      {
        greeting = "Good Evening";
      }
  }
}


//// WHATUSEEK SEARCH
//function CheckWhatUSeek()
//{
//  if (whatuseek.query.value == "")
//  {
//    alert("\nYou have not entered search keyword(s).\nPlease check and submit your search again.")
//    whatuseek.query.focus()
//    return false;   
//  }
//}


//// OPEN RECOMMEND THIS PAGE WINDOW
//function RecommendThisPage() 
//{
//  RecommendThisPageWin = window.open("recommendthispage.html","RecommendThisPageWin","toolbar=no,width=440,height=480,status=no,scrollbars=no,resize=no,menubar=no");
//}


// COST OF CALL TO DMCLUB PERSONAL NUMBER
function Start() 
{
  CostOfCall = window.open("costofcall.html","CostOfCall","toolbar=no,width=500,height=450,status=no,scrollbars=no,resize=no,menubar=no");
}


// CHECK FEEDBACK FORM MESSAGE STATUS
function CheckForm()
{
  if (document.form.realname.value == "")
  {
    alert("\nYou have not entered your name.\nPlease check and re-enter your name.")
    document.form.realname.focus()
    return false;   
  }

  if (document.form.email.value.indexOf ('@',0) == -1 || document.form.email.value.indexOf ('.',0) == -1)
  {
    alert("\nYou have entered an invalid email address.\nPlease check again and re-enter your email address.")
    document.form.email.focus()
    return false;   
  }

  if (document.form.contactphone.value == "")
  {
    alert("\nYou have not entered a contact phone or mobile number.\nPlease check and re-enter your details.")
    document.form.contactphonecode.focus()
    return false;   
  }

  if (document.form.recipient.selectedIndex == 0)  
  {
    alert("\nYou have not selected a recipient.\nPlease check and submit again.")
    document.form.recipient.focus()
    return false;   
  }

  if (document.form.comment.value == "" )
  {
    alert("\nYou have not entered your design requests.\nPlease complete, check and submit your details.")
    document.form.comment.focus()
    return false;   
  }

}


function GL_otherfield(prefix,id) 
{
	verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
	if (app.indexOf('Microsoft') != -1) 
	{
		if (eval('document.form.' + prefix + '.options[document.form.' + prefix + '.selectedIndex].text') == '(Other) >>>') 
		{
			eval(id + '.style.display = ""');
		}
		else 
		{
			eval(id + '.style.display="none"');
		}
	}	 
}


// OPEN GLOSSARY POP-UP WINDOW WHEN SITE FIRST OPENS
//function popUpPollWindow()
//{
//  Glossary = window.open("popupwindow.html","Glossary","toolbar=no,width=350,height=350,status=no,scrollbars=no,resize=no,menubar=no");
//}
