
//function UpdateLayerControl() {return window.open('../MapControl/MapLayerControl.aspx?TimeIndex=' + timestamp(), null,'center:yes;status:no;dialogWidth:375px;dialogHeight:450px;dialogHide:true;help:no;scroll:yes');}
function UpdateLayerControl() {return window.open('../MapControl/MapLayerControl.aspx?TimeIndex=' + timestamp(), null,'status=no,width=375,height=450,left=20,top=20,toolbar=no,menubar=no,location=no,resizeable=no,scrollbars=yes');}

function mapprint() {window.open('../MapControl/MapPrint.aspx?TimeIndex=' + timestamp(), null,'status=no,width=800,height=600,left=20,top=20,toolbar=no,menubar=yes,location=no,resizeable=no,scrollbars=yes');return false;}

function maplegend() {window.open('../MapControl/MapLegend.aspx?TimeIndex=' + timestamp(), null,'status=no,width=150,height=200,left=20,top=20,toolbar=no,menubar=no,location=no,resizeable=no,scrollbars=yes');}
//function maplegend() {window.showModalDialog('../MapControl/MapLegend.aspx?TimeIndex=' + timestamp(), null,'center:yes;status:no;Width:150px;Height:200px;dialogHide:true;help:no;scroll:yes');}

function mapfind() {window.open('../MapControl/MapFind.aspx?TimeIndex=' + timestamp(), null,'status=no,width=600,height=200,left=20,top=20,toolbar=no,menubar=no,location=no,resizeable=no,scrollbars=yes');}
//function mapfind() {window.open('../MapControl/MapFind.aspx?TimeIndex=' + timestamp(), null,'center:yes;status:no;dialogWidth:600px;dialogHeight:200px;dialogHide:true;help:no;scroll:no');}

function maptheme() {window.open('../MapControl/MapTheme.aspx?TimeIndex=' + timestamp(), null,'center:yes;status:no;dialogWidth:400px;dialogHeight:600px;dialogHide:true;help:no;scroll:no');}
//function maptheme() {window.open('../MapControl/MapTheme.aspx?TimeIndex=' + timestamp(), null,'center:yes;status:no;dialogWidth:400px;dialogHeight:600px;dialogHide:true;help:no;scroll:no');}


function timestamp()
{
	var ut=new Date();
	var h,m,s;
	var time="";
	h=ut.getHours();
	m=ut.getMinutes();
	s=ut.getSeconds();
	if(s<=9) s="0"+s;
	if(m<=9) m="0"+m;
	if(h<=9) h="0"+h;
	time+=h+":"+m+":"+s;
	return time;
}

function WriteObjToFile(DataTransferFileName,LayerName,UID,FeatureDescr,EditMode) { 
alert("Creating file " + DataTransferFileName); 
// the next may fail on some PCs
// this needs proper error trapping
var fso = new ActiveXObject('Scripting.FileSystemObject'); 
alert("File created");
if (fso.FileExists(DataTransferFileName)) { 
var a, ForAppending, file; 
ForAppending = 8; 
file = fso.OpenTextFile(DataTransferFileName, ForAppending, false); 
} 
else { 
var file = fso.CreateTextFile(DataTransferFileName, true); 
} 
file.WriteLine(UID); 
file.WriteLine(LayerName); 
file.WriteLine(FeatureDescr); 
file.WriteLine(EditMode); 
file.Close(); 
} 
