﻿//function disableButt() { //used to prevent a double-click on login buttons
//document.getElementById('btnLogin').className='mybtndis'
//if (document.getElementById('btnVisitor')) {document.getElementById('btnVisitor').className='mybtndis'}
//}

function dummyUL() {
 //firefox and safari use "bfcache" - when user uses back-button, will restore form AS IT AS WHEN IT WAS LEFT (doesn't re-execute onload etc.). So if we disabled the button that the user clicked on, it will still be disabled!
    //having an onunload event cancels this behavior - https://developer.mozilla.org/En/Using_Firefox_1.5_caching   
 }
function govideo() {
//window.open("http://www.tennisreservations.com/membervideo/logindemo.aspx","demo","width=1000,height=720,scrollbars=1,resizable=1"); 
var wd
var ht
if (screen.height<=768) {
	wd=screen.width;ht=screen.height
}else {
	wd=977;ht=768
}
mypopup("http://tennisbookings.com/memberdemo_demo/memberdemo_demo.htm","ddemo","width="+wd+",height="+ht+",scrollbars=1,resizable=1");
return false
}
function goNews() {
    var p = "ClubNews.aspx?f=" +f
    window.open(p, "cq", "width=800,height=600,scrollbars=1,resizable=1,toolbar=0")
}
function getPassword() {
document.getElementById('LinkButton2').click()
}
function InitFunctions()
{//out 9/1/10 - this interferes w/ rowayton where its in an iframe. Not needed anyway cos TimedOut.htm does this same thing.
//if (top.location != location) {
   // cannot READ top.location.href if from another domain (permission denied) if (top.location.href.indexOf('Default.aspx')> -1) {
  //      top.location.href = document.location.href;
   // }
    //}

    if (burstFrame==true) {
        if (top.location !=self.location) { //even though can't read top.location CAN do equality test! Being in frame causes PayPal to fail.
            top.location.href = document.location.href;
        }
   } 
	GetScreenResForLog();
	SetFocusToFirstTextBox();
}

function GetScreenResForLog()
{
	var nres = document.getElementById("screenres");
	nres.value = screen.width + " x " + screen.height;
}

function SetFocusToFirstTextBox() {

    
//    if (f==5 && document.location.search.indexOf("escapef")==-1) { // add a flag to querystring to trap re-entry ---Cornell - cos PayPal chokes if in frame (as when from ReisTennisCenter.com)
//        try {
//            var addr = document.location.href
//            addr+=(document.location.search=="","?","&") + "escapef=1"
//            top.location.href = addr
//            return false
//        } catch (e) {
//        }
//    }
	checkjavascript();
	var nname = document.getElementById("txtUsername");	
	if (document.getElementById ('txtPassword').value!='') {	
		document.getElementById('btnLogin').focus
	}
	else {
		if (nname.value=='') { nname.focus()} else {document.getElementById ('txtPassword').focus()}
	}
}

function checkjavascript()
{	
	document.getElementById("checkjs").value = 'SCRIPTS';
}

function valConf() {
sss='printusermessage.aspx?I=' + myid
	mypop=window.open(sss,'sp','width=650,height=500,scrollbars=yes,addressbar=0,resizable')
	if (timerID!="" && timerID!=null) { //clear any existing timer first
	window.clearTimeout (timerID)
	}
	timerID=setTimeout("checkpopup()",2000)
}

