function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
	toolbar_str   = toolbar   ? 'yes' : 'no';
	menubar_str   = menubar   ? 'yes' : 'no';
	statusbar_str = statusbar ? 'yes' : 'no';
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'yes' : 'no';
	
	window.open (url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

var googleMapWindow = null;

function showGoogleMap(lat, lng, hc)
{
	if (googleMapWindow != null && googleMapWindow.closed) {
		googleMapWindow = null;
	}

    var wndWidth  = 500;
	var wndHeight = 350;

    if (googleMapWindow) {
	    googleMapWindow.focus();
    	googleMapWindow.location.href = '/rate/googlemap.php?hc=' + hc + '&lat=' + lat + '&lng=' + lng;
        return true;
	}

    var leftPos = (screen.width  - wndWidth) / 2;
	var topPos  = (screen.height - wndHeight) / 2 - 20;
    var features = 'toolbar=no, location=no, directories=no, menubar=no, scrollbars=no, resizable=no, status=no, width=' + wndWidth + ', height=' + wndHeight + ', top=' + topPos + ',left=' + leftPos;

    googleMapWindow = window.open('/rate/googlemap.php?hc=' + hc + '&lat=' + lat + '&lng=' + lng, null, features);
	googleMapWindow.focus();

    return true;
}

function showGoogleMapR(lat, lng, hc)
{
	if (googleMapWindow != null && googleMapWindow.closed) {
		googleMapWindow = null;
	}

    var wndWidth  = 500;
	var wndHeight = 350;

    if (googleMapWindow) {
	    googleMapWindow.focus();
    	googleMapWindow.location.href = '/rate/rgooglemap.php?res_id=' + hc + '&lat=' + lat + '&lng=' + lng;
        return true;
	}

    var leftPos = (screen.width  - wndWidth) / 2;
	var topPos  = (screen.height - wndHeight) / 2 - 20;
    var features = 'toolbar=no, location=no, directories=no, menubar=no, scrollbars=no, resizable=no, status=no, width=' + wndWidth + ', height=' + wndHeight + ', top=' + topPos + ',left=' + leftPos;

    googleMapWindow = window.open('/rate/rgooglemap.php?res_id=' + hc + '&lat=' + lat + '&lng=' + lng, null, features);
	googleMapWindow.focus();

    return true;
}

