var newwinwidth_leh = 580;var newwinheight_leh = 415;var newwinwidth_lhasa = 580;var newwinheight_lhasa = 415;var newwinwidth_lhasashoel = 580;var newwinheight_lhasashoel = 415;var mapwindow_leh;var mapwindow_lhasa;var mapwindow_lhasashoel;/*** @see forkMapWindow(windowid, forkdocaddress, datadocument, changedocaddress)*/function forkMapWindow(windowid, forkdocaddress){    forkMapWindow(windowid, forkdocaddress, null, null);}/*** forks flashmap-window and stores reference in parent.frame['menuFrame'].*/function forkMapWindow(windowid, forkdocaddress, datadocument, changedocaddress){    var state = 0;    for (i = 0 ; i < parent.frames.length ; i++) {    	//alert("parent.frames[" + i + "].name = " + parent.frames[i].name);	if (parent.frames[i].name == "menuFrame") {	    if (windowid == "flashmap_leh") {   		if (parent.frames[i].mapwindow_leh == null) {		    mapwindow_leh = window.open(forkdocaddress, windowid, "width=" + newwinwidth_leh + ",height=" + newwinheight_leh + ", resizable=no");	    	    parent.frames[i].mapwindow_leh = mapwindow_leh;		    state = 1;		} else {		    parent.frames[i].mapwindow_leh.focus();		    state = 2;		}	    } else if (windowid == "flashmap_lhasa") {   		if (parent.frames[i].mapwindow_lhasa == null) {   		    mapwindow_lhasa = window.open(forkdocaddress, windowid, "width=" + newwinwidth_lhasa + ",height=" + newwinheight_lhasa + ", resizable=no");	    	    parent.frames[i].mapwindow_lhasa = mapwindow_lhasa;		    state = 1;		} else {		    parent.frames[i].mapwindow_lhasa.focus();		    state = 2;		}	    } else if (windowid == "flashmap_lhasashoel") {   		if (parent.frames[i].mapwindow_lhasashoel == null) {   		    mapwindow_lhasashoel = window.open(forkdocaddress, windowid, "width=" + newwinwidth_lhasashoel + ",height=" + newwinheight_lhasashoel + ", resizable=no");	    	    parent.frames[i].mapwindow_lhasashoel = mapwindow_lhasashoel;		    state = 1;		} else {		    parent.frames[i].mapwindow_lhasashoel.focus();		    state = 2;		}	    } else {   		alert("no mapwindow defined for windowid=" + windowid);		state = 2;	    }	    break;	}    }    if (state == 1) {        if ((datadocument != null) & (changedocaddress != null)) {	    datadocument.location.href = changedocaddress;	}    } else if (state != 2) {    	alert("no mapwindow defined for windowid=" + windowid);    }}/*** gets flashmap-window-reference stored in parent.frame['menuFrame'] and calls flash-function.*/function showBuildingOnMap(/*buildingid, */id_x, id_y, region){    //alert("id_x = " + id_x + ", id_y = " + id_y + ", region = " + region);    var targetmapwindow;        var state = 0;    for (i = 0 ; i < parent.frames.length ; i++) {      	//alert("parent.frames[" + i + "].name = " + parent.frames[i].name);	if (parent.frames[i].name == "menuFrame") {	    if (region == "Leh") {	    	targetmapwindow = parent.frames[i].mapwindow_leh;		/*		if (targetmapwindow == null) {		    forkMapWindow("flashmap_leh", "../../2_lhasa/2_02/2_02_12_en.html", null, null);		}		*/		state = 1;	    } else if (region == "Lhasa") {	    	targetmapwindow = parent.frames[i].mapwindow_lhasa;		state = 1;	    } else if (region == "Lhasa/Shoel") {	    	targetmapwindow = parent.frames[i].mapwindow_lhasashoel;		state = 1;	    } else {	    	break;	    }	    //alert("flash-map = " + targetmapwindow.map);	    targetmapwindow.map.SetVariable("id_x", id_x);	    targetmapwindow.map.SetVariable("id_y", id_y)	    targetmapwindow.focus();	    break;	}    }    if (state != 1) {    	alert("no mapwindow defined for region=" + region);    }}/****/function newin(adresse){     mywin = window.open(adresse, "w"+(new Date()).getTime(),"menubar=no,status=no,location=no,toolbar=no,directories=no,alwaysRaided=yes,scrollbars=yes");    mywin.focus();}
