
    /* This javascript function opens the calendar pop-up. If you want to change 
    the position where the pop-up appears on the screen, alter the values for top 
    and left below. Note that position is based on the top left edge of the computer 
    screen, not the browser window. */

    function openCalendar( FormElement, path ){
    	var calendarwindow;
    	url = ( path + "/ihotelier-calendar.html?formname=resform&formelement=" + FormElement );
    	calendarwindow = window.open( url, "calendar", "toolbar=no,width=200,height=144,top=50,left=50,status=no,scrollbars=no,resize=no,menubar=no" );
    	calendarwindow.focus();
    }

    function getDateStr() {
    	var today = new Date();
    	var todayStr = ( today.getMonth() + 1 ) + "/" + today.getDate() + "/" + today.getFullYear();
    	document.resform.DateIn.value = todayStr;
    }

    function trapCheck( Y, Q, U ) {
        var V = Y.options[ Y.selectedIndex ].value;
        if ( V == Q ) { trapADS( Y, Q, U ); }
    }

    function trapADS( X, W, U ) {
        var siv = X.options[ X.selectedIndex ].value;
        // var sit = X.options[ X.selectedIndex ].text;
        // alert( 'text is "' + sit + '" but the actual value is "' + siv + '"' );
        if ( siv == W ) { // alert( 'matching success! routing you now, condor...' );
            // location.replace( U ); // impedes "back" button function
            // location.href = U; // back button works
            window.open( U ); // opens in new tab or window
            return false;
        } else { // alert( 'these are not the droids we are looking for. move along...' );
            return true;
        }
    }



