//alert ('here');
var thisWin = null;


function windowCleanup() {
if (thisWin) {
		//alert('ok 1 2');	
	if (thisWin.open) {
		thisWin.close();
		thisWin = null;
	}
	}
return;
}

function refresh(){
	if (navigator.appVersion.indexOf("Mac") != -1) {
 		//alert("This alert message causes the window to refresh on a Mac.");
 	}
	return;
}

function openWindow(thisLoc,w,h,scr,loc){
//windowCleanup ();

// default values for arguments that are not passed
if (!w) w = 750;
if (!h) h = 550;
if (!scr) scr = 1;
if (!loc) loc = 0;

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scr+',resizable,location='+loc;

	// if there is no object or if the window has been closed, 
	// initialize the var (otherwise the new window will have 
	// the same attributes as the old) and cast a new instance.
	if (!thisWin || thisWin.closed || !thisWin.open) {
	    //refresh();
		thisWin = window.open(thisLoc,'rentalWindow',settings);
		
		}
	if (thisWin.open) {
    //refresh();
	thisWin.location.href=thisLoc;
	
	}
	thisWin.focus();
}

//end