var currentObject = "";
var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=480,height=540,scrollbars=yes';

winLeft = (screen.width-680)/2;
winTop = (screen.height-(480+110))/2;

var _POPUP_INTRO_FEATURES = 'location=0,statusbar=0,menubar=0,width=680,height=480,left=' + winLeft + ',top=' + winTop + ',scrollbars=np';


///

function showCity(id) {

	var obj = document.getElementById(id);
	var display1 = "none";
	var display2 = "block";

	document.body.style.visibility = "hidden";
	document.body.style.visibility = "visible";

	if(currentObject!="" && currentObject!=id)  {
		document.getElementById(currentObject).style.display = display1;		
	}
	currentObject = id;
		
	if (obj) {
		if(obj.style.display == display1 || obj.style.display == "")
		{
			obj.style.display = display2;	
			
		}
		else
		{
			obj.style.display = display1;
			currentObject = "";
		}
	}

}

function swindowopen (id) {

	var obj = document.getElementById(id);
	var display2 = "block";

	document.body.style.visibility = "hidden";
	document.body.style.visibility = "visible";

	obj.style.display = display2;	

}

function swindowclose(id) {

	var obj = document.getElementById(id);
	var display2 = "none";

	//document.body.style.visibility = "hidden";
	//document.body.style.visibility = "visible";

	obj.style.display = display2;	

}

function raw_popup(url, target, features) {
	// pops up a window containing url optionally named target, optionally having features
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target  )) target   = '_blank';
    var theWindow = window.open(url, target, features);
    theWindow.focus();
    return theWindow;
}

function link_popup(src, features) {

    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

function intro(src) {

    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
    return raw_popup(src, '_blank', _POPUP_INTRO_FEATURES);
}
