// JavaScript Document

function MM_effectAppearFade(targetElement, duration, from, to, toggle) {
	Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}
function MM_effectBlind(targetElement, duration, from, to, toggle) {
	Spry.Effect.DoBlind(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}

function controlPanel(c, a) {
	target = document.getElementById(c);
	if (a == "1") {
		MM_effectAppearFade(target, 500, 0, 100, false);
		//target.style.visibility = "visible";
		target.style.display = "block";
	} else {
		MM_effectAppearFade(target, 500, 100, 0, false);
		//target.style.visibility = "hidden";
		target.style.display = "none";
	}
}

function showEvent(ev) {
	MM_effectBlind(ev, 250, '100%', '270%', true);
	if (ev.style.borderColor) {		
		ev.style.borderColor = "";
	} else {
		ev.style.borderColor = "#FF3333";
	}
}

function HiliteFLD(me) {
	me.style.backgroundColor = "#ffcccc";
}
function restoreFLD(me) {
	me.style.backgroundColor = "";
}

function showMSG(msg, act) {
	target = document.getElementById("msgBox");
	if (act == "show") {		
		target.innerHTML = msg;
		MM_effectAppearFade(target, 500, 0, 100, false);	
		return false;	
	} else {
		target.innerHTML = "";
		target.style.visibility = "hidden";		
	}	
}

function toggleDisplay(a) {
	target = document.getElementById(a);
	if (target.style.visibility == "hidden") {
		target.style.visibility = "visible";
	} else {
		target.style.visibility = "hidden";
	}
}

function mapControl(a) {
	win = "MapWindow";
	//MM_effectBlind(win, 350, '0px', '510px', true);
	Spry.Effect.DoBlind(win, {duration: 250, from: '0px', to: '350px', toggle: true, finish: toggleDisplay(win)});
}

function clearText(me) {
	target = document.getElementById(me);
	target.value = "";
}

function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}
// SubClasses
