function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no' );
}

var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus) {
if(pos=="random") { 
myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100; }
if(pos=="center") {
myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100; }
else if((pos!='center' && pos!="random") || pos==null) { myleft=0;mytop=20 }
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus(); }

function seturl(url) {
opener.document.form.avatar.value = url;
}

function Popup(url, window_name, window_width, window_height, scrollbars) 
{ 
	left_pos=(screen.width)?(screen.width-window_width)/2:100;
	top_pos=(screen.height)?(screen.height-window_height)/2:100;
	settings="toolbar=no,location=no,directories=no,"+"status=no,menubar=no,scrollbars="+scrollbars+","+"resizable=yes,width="+window_width+",height="+window_height+",left="+left_pos+",top="+top_pos;
	NewWindow=window.open(url,window_name,settings);
	NewWindow.focus(); 
}

function AddText(text) {

	if (document.input.message.createTextRange && document.input.message.caretPos) {
	var caretPos = document.input.message.caretPos;
	caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;

	document.input.message.focus();


	} else {

	document.input.message.value  += text;

	document.input.message.focus();


	}

}

function icon(text) {
	AddText(text);
}

function storeCaret(textEl) {
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'" ); 
  if (restore) selObj.selectedIndex=0; 
} 


var remember = new Array();
var remember2 = new Array();
var checkIt;

var DHTML = (document.getElementById || document.all || document.layers);

function show(name,lvl,obj)
{
	if (!DHTML) return;
	changeDiv('base','none')
	checkUserInput();
	if (remember[lvl] && remember[lvl] == name) return;
	if (remember[lvl])
	{
		closeAll(lvl);
	}
	if (name)
	{
		var x = getObj(name);
		x.visibility = 'visible';
	changeDiv('base','none')
             	}
	remember[lvl] = name;
	if (obj.parentNode) y = obj.parentNode;
	else if (obj.parentElement) y = obj.parentElement;
	else return;
	if (y.className) return;
	y.className = 'over';
	if (remember2[lvl]) remember2[lvl].className = '';
	remember2[lvl] = y;
}

function closeAll(lvl)
{
	for (i=remember.length - 1;i>=lvl;i--)
	{
		if (remember[i]) //IE4 Mac
		{
			var x = getObj(remember[i]);
			x.visibility = 'hidden';
			changeDiv('base','block')
		}
		remember[i] = null;
		if (remember2[i])
		{
			remember2[i].className = '';
			remember2[i] = null;
		}
	}

}

function checkUserInput()
{
	if (checkIt) clearTimeout(checkIt);
	checkIt = setTimeout('closeAll(1)',6000);
}

function getObj(name)
{
  if (document.getElementById)
  {
    return document.getElementById(name).style;
  }
  else if (document.all)
  {
    return document.all[name].style;
  }
  else if (document.layers)
  {
    return document.layers[name];
  }
  else return false;
}

function getStyleObject(objectId) {
  if (document.getElementById && document.getElementById(objectId)) {
    return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
    return document.all(objectId).style;
  } else {
    return false;
  }
}

var kordval
var kordval2
var pinlink
var useNS6 = document.getElementById && !document.all ? 1:0;

function memClicked() {
		kordxy=new Array;
		kordval = document.mmview.memberName.options[document.mmview.memberName.selectedIndex].value;
		kordxy = kordval.split(",",3);

		if (document.all) {
			document.all.pin.style.position = "absolute";
			document.all.pin.style.top = kordxy[1] + "px";
			document.all.pin.style.left = kordxy[0] + "px";
			document.all.pin.style.visibility = "visible";
		}
		if(useNS6) {
			document.getElementById('pin').style.position = "absolute";
			document.getElementById('pin').style.top = kordxy[1] + "px";
			document.getElementById('pin').style.left = kordxy[0] + "px";
			document.getElementById('pin').style.visibility = "visible";
		}

}

function  viewProfile()
{
		kordxy=new Array;
		kordval = document.mmview.memberName.options[document.mmview.memberName.selectedIndex].value;
		kordxy = kordval.split(",");
		location.href="member.php?action=viewpro&member="+kordxy[2];
	}

function mmeditWindow(URL,WindowName)
{
	var newWindow = open(URL,WindowName,"Resizable=Yes,ScrollBars=No,MenuBar=No,Directories=No,ToolBar=No,Location=No,Status=No,Width=780,Height=550,left=0,top=0'");
	if (newWindow.opener == null)
		newWindow.opener = self;
	if (newWindow.focus)
		newWindow.focus();
}

var on = new Image(6,6)
on.src = "/images/entdot2.gif"

var off = new Image(6,6)
off.src = "/images/entdot.gif"

function changeDiv(the_div,the_change)
{
  var the_style = getStyleObject(the_div);
  if (the_style != false)
  {
    the_style.display = the_change;
  }
}

function RegHover(region,subtot,status,legend) {
	i=1
	while(i < (subtot +1)) {
		var nname = 'pin'+region+i;
		document.images[nname].src = status.src; 
		i++
	}
}

function EntHover(region,nr,status) {
	var nname = 'pin'+region+nr;
	document.images[nname].src = status.src; 
}

function conClicked(x,y,show) {
		if (document.all) {
			document.all.pin.style.position = "absolute";
			document.all.pin.style.top = y + "px";
			document.all.pin.style.left = x + "px";
			document.all.pin.style.visibility = show;
		}
		if(useNS6) {
			document.getElementById('pin').style.position = "absolute";
			document.getElementById('pin').style.top = y + "px";
			document.getElementById('pin').style.left = x + "px";
			document.getElementById('pin').style.visibility = show;
		}

}