var contents;
var mywin;
var mysitewin;
function closechild(){
	try{
	if(mysitewin && mysitewin.open && !mysitewin.closed){
		mysitewin.close();
	}
	
	
	}	
	catch(e)
	{}
	try{
		if(myhwin && myhwin.open && !myhwin.closed){
			myhwin.close();
		}

	}
	catch(e)
	{}

	try{
		if(mywin && mywin.open && !mywin.closed){
			mywin.close();
		}

	}

	catch(e){}
	
	try{
		if(contents && contents.open && !contents.closed){
			contents.close();
		}
	}
	catch(e){}

}

// other_field is used to pull a value not to allow use in this field
function ShowDateEx(date_form, date_field, et, other_field)
{
    var pageTop = 0;
    var pageLeft = 0;

    if (date_field == "specific_time") {
        try {
            document.finalize.time[1].checked = true;

        }
        catch (e) {
            pageTop = et.screenY;
            pageLeft = et.screenX;
        }
    }




    if (et.pageX || et.pageY) {
        pageTop = et.pageY;
        pageLeft = et.pageX;
    }
    else if (et.clientX || et.clientY) {
        pageTop = et.clientY
        pageLeft = et.clientX
    }




    pageTop = et.screenY;
    pageLeft = et.screenX;


    url = '/bfr_cal.asp?date_form=' + date_form + '&date_field=' + date_field;

    if (other_field != undefined && other_field != null) {
        var obj = document.getElementById(other_field);
        if (obj != undefined && obj != null) {
            url += "&rsrv=" + obj.value;
        }
    }

    contents = window.open(url, "_blank", "height=210,width=350,left=" + pageLeft + ",top=" + pageTop + ",screenY=" + pageTop + ",screenX=" + pageLeft + ",resizable=no,location=no,status=no,directories=no,toolbar=no,menubar=no;");
}

function ShowDate(date_form, date_field, et)
  {
	var pageTop = 0;
	var pageLeft = 0;

	if(date_field == "specific_time")
	{
		try{
			document.finalize.time[1].checked = true;
							
 		}
		catch(e){pageTop = et.screenY;
			 pageLeft = et.screenX;}
	}

	
	
	
	if(et.pageX || et.pageY)
	{	
		pageTop = et.pageY;
		pageLeft = et.pageX;
	}
	else if(et.clientX || et.clientY)
	{
		pageTop = et.clientY
		pageLeft = et.clientX 
	}

	
	

	pageTop = et.screenY;
	pageLeft = et.screenX;

	
		url = '/bfr_cal.asp?date_form=' + date_form + '&date_field=' + date_field;
	
	contents=window.open(url,"_blank","height=210,width=350,left="+ pageLeft+",top="+pageTop+",screenY="+pageTop+",screenX="+pageLeft+",resizable=no,location=no,status=no,directories=no,toolbar=no,menubar=no;");
	//window.showModalDialog(url);
	
  }

function changeMCursor(eid){

document.getElementById(eid).style.cursor="pointer";
}

function openFormWin(url){

	formwin = window.open(url,'FWindow','menubar=no,width=900,height=800,scrollbars=yes,location=no,status=no,directories=no,toolbar=no');
	
	formwin.focus();

}
