function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function build_lnk(obj, ref){
   obj.href = ref;
}

function rebuild_s4r(obj, ref){
	if (document.frm_city_box.global_id_city.value!=0) {
		href = ref+'-'+document.frm_city_box.global_id_city.value+'.html';
	}
	else {
		href = ref+'.html';
	}
	obj.href = href;
}


function popupWindow(sScript, sName, iWidth, iHeight) {
	var x = (640 - iWidth)/2;
	var y = (480 - iHeight)/2;

	if (screen) {
		y = (screen.availHeight - iHeight)/2;
		x = (screen.availWidth - iWidth)/2;
	}

	var oWin=window.open(sScript, sName, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+iWidth+',height='+iHeight+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	oWin.focus();
	return oWin;
}

function toggleOnOption(idHiddenField,idCheckObj,idCheckObjValue) {
	field = document.getElementById(idHiddenField);
	if (field) {
		field2 = document.getElementById(idCheckObj);
		if (field2) {
			if (idCheckObjValue == "checked") {
				if (field2.checked) {
				    field.style.display = '';
				} else {
	    			field.style.display = 'none';
				}
			}
			else {
				if (field2.value==idCheckObjValue) {
				    field.style.display = '';
				} else {
	    			field.style.display = 'none';
				}
			}
		}
	}
	return(idCheckObjValue);
}

function switchOnOption(idHiddenField) {
	field = document.getElementById(idHiddenField);
	if (field) {
		if (field.style.display == '') {
			field.style.display = 'none';
			result = false;
		}
		else {
			field.style.display = '';
			result = true;
		}
	}
	return(result);
}

function getAbsolutePos(el)
	{
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent)
		{
		var tmp = getAbsolutePos(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
		}
	return r;
	}
