    function setSize(size){    
        //make sure a parent exists containing an iframe named ifMain
        if (parent.document.getElementById('ifMain')==null){}
        else{        
            var iframeElement = parent.document.getElementById('ifMain'); 
            iframeElement.style.height = size; //100px or 100% 
            if (navigator.appVersion.indexOf("MSIE")!=-1){
                parent.frames['ifLeft'].location.reload('left.htm');
            }
        }
    }

    function setSize01(size){
        //make sure a parent exists containing an iframe named ifMain
        if (parent.document.getElementById('ifMain')==null){}
        else{        
            var iframeElement = parent.document.getElementById('ifMain'); 
            iframeElement.style.height = size; //100px or 100% 
            if (navigator.appVersion.indexOf("MSIE")!=-1){
                parent.frames['ifLeft'].location.reload('../left.htm');
            }
        }
    }


    function setSize01test(size){
        //make sure a parent exists containing an iframe named ifMain
        if (parent.document.getElementById('ifMain')==null){}
        else{        
            var iframeElement = parent.document.getElementById('ifMain'); 
            iframeElement.style.height = size; //100px or 100% 
            if (navigator.appVersion.indexOf("MSIE")!=-1){
                parent.frames['ifLeft'].location.reload('../left.htm');
            }
        }
    }


    function click() {if (event.button==2) { alert('Welcome to carmadirect.com'); } } document.onmousedown=click;
    //function click() {if (event.button==2) { window.status = "carmadirect.com" } } document.onmousedown=click
    
    function handleError() {
        if (n==1){
            document.getElementById('btnShowTeeTimes').disabled = false;
        }
	    return true;
    }

    window.onerror = handleError;


    function onClientClick_bookIt(str){
        //btn.src = selImage.src;
        s = new String();
        s = "";
        s = "Press OK to reserve the following Tee Time, or CANCEL to search again.\n\n" + str;
        /*
        var answer = confirm(s);
        if (answer) { 
            //confirm connection status before returning response.
            alert("Checking connection staus");
            return true;
        }
        else {
            return false;
        } */
        return confirm(s);       
    }
    
    //setFocus functions take the focus away from drop down boxes after a selection is made.
    //so that the box does not keep scrolling.
    function setFocusRdoBtn() { document.getElementById('Rollover1').focus(); }
    function setFocusCalendar() { document.getElementById('Rollover1').focus(); }
    function setFocusRdoPlayers() { document.getElementById('rdoPlayers').focus(); }
    function setFocusCalStartDate() { document.getElementById('fView_acctDetail').focus(); }


    //bridge functions copy text data for display between postbacks from 
    //javascript to ASP or viceversa
    //call in the form:  bridgeASPtoJS('hidStartDate','show_e');
    //provide the ID of each object
    function bridgeJStoASP(jsObject,aspObject) {  
        document.getElementById(aspObject).value = document.getElementById(jsObject).value;
    }
    
    function bridgeASPtoJS(aspObject,jsObject,jsHidObject) { 
        document.getElementById(jsObject).innerHTML = document.getElementById(aspObject).value;
        document.getElementById(jsHidObject).value = document.getElementById(aspObject).value;
    }
    
    function bridgeASPtoJStxt(aspObject,jsHidObject) { 
        document.getElementById(jsHidObject).value = document.getElementById(aspObject).value;
    }
    
   
    function setmydate(cal){
        cal.date = "2004/11/10";
        //document.getElementById("jsHidStartDate").value = "2004/11/10";
    }
    
    var n = 0;
    
    function dateChanged(calendar) {
        // Beware that this function is called even if the end-user only
        // changed the month/year.  In order to determine if a date was
        // clicked you can use the dateClicked property of the calendar:
        if (calendar.dateClicked) {
            var date = calendar.date;
            var y = calendar.date.getFullYear();
            var m = calendar.date.getMonth() + 1;     // integer, 0..11
            var d = calendar.date.getDate();      // integer, 1..31
            document.getElementById("jsHidStartDate").value = date.print("%A, %b %e, %Y"); //m + "/" + d + "/" + y;
            //document.getElementById("spanStartDate").innerHTML = date.print("%Y/%m/%d"); //m + "/" + d + "/" + y;
            document.getElementById("spanStartDate").innerHTML = date.print("%A, %b %e, %Y"); //m + "/" + d + "/" + y;
            document.getElementById("hidStartDate").value = date.print("%m/%d/%Y");      //m + "/" + d + "/" + y;
            document.getElementById("lblDt").innerText = date.print("%m/%d/%Y");      //m + "/" + d + "/" + y;
            var sp = document.getElementById("spanStartDate");
            sp.style.color = "#77773C";

            //based on the date selected, enable or disable the show tee time button.
            //var today = new Date();
            //today = setDate(getDate()-1);
            var today = new Date() ; with (today) setDate(getDate()-1);
            var dt = new Date(date.print("%Y/%m/%d"));
            if (dt < today) {
                //document.getElementById('btnShowTeeTimes').disabled = true; 
                document.getElementById("spanStartDate").innerHTML = "Please select a future date."; 
                sp.style.color = "#FF0000";
            }
            else {
                n=1;
                //if (document.getElementById('ddlCourseList').disabled == true) {
                //    document.getElementById('btnShowTeeTimes').disabled = false;
                //}
                //else {
                    //document.getElementById('btnShowTeeTimes').disabled = true;                
                //}
                //document.getElementById('hidBookItFlag').value = '1';
                n=0;
            }

        }        
    }

    function setupCalendar(){
        Calendar.setup(
            {
                flat            : "calendar-container", // ID of the parent element
                flatCallback    : dateChanged,           // our callback function
                weekNumbers     : false,
                date            : document.getElementById("spanStartDate").innerText
            }
        );        
    }
        
    function showDate() {
        var sp = document.getElementById("spanStartDate");
        
        if (sp.innerText.length > 10){
            sp.style.color = "#77773C";
        }
    }
        
    var pbwin = null;
         
    function StartProcess(id){
		//set default window size and coordinates:
		var newWinW = 240, newWinHt = 100, x = 0, y = 0;

		if (parseInt(navigator.appVersion)>3) {
			if (navigator.appName=="Netscape") {
				//Find the X coordinate for the new window
				windowWidth = self.outerWidth;
				widthDif = Math.round(windowWidth - newWinW);
				x = self.screenX + widthDif/2 ;

				//Find the Y coordinate for the new window (
				windowHeight = self.outerHeight;
				heightDif = Math.round(windowHeight - newWinHt);
				y = 300; //(self.screenY + (heightDif/2)) - 20 ;
			}
			else if (navigator.appName.indexOf("Microsoft")!=-1) {
				//Find the X coordinate for the new window
				windowWidth = document.body.offsetWidth;
				widthDif = Math.round(windowWidth - newWinW);
				x = (self.screenLeft) + widthDif/2 ;

				//Find the Y coordinate for the new window (
				windowHeight = document.body.offsetHeight + 110;
				heightDif = Math.round(windowHeight - newWinHt);
				y = 300; //(self.screenTop ) + heightDif/2 ;
			}
		}
		//str = "width="+newWinW+", "+"height="+newWinHt+", "+" visible="false" , resizable=no, toolbar=no, status=no, menubar=no, scrollbars=no,top="+y+",left="+x+'';
		str = "width=240, height=100," + "visible=false , resizable=no, toolbar=no, status=no, menubar=no, scrollbars=no,top="+y+",left="+x+'';
		pbwin = window.open('ProgressBar.aspx?id=' + id, "progress", str);
		return false;
	}


    //this function will close the progress bar window as soon as the calling page is fully unloaded.
    //place this call in the body opening tag  onunload="closePbwin();"
    function closePbwin() {
        if (pbwin && pbwin.open && !pbwin.closed) pbwin.close();
    }




