function popupPseudoTags(){
	var win = window.open('popup_pseudotags.aspx','winPT','width=500,height=500')	
}


function calcLeft(intLeft){
	return Math.max(document.body.clientWidth,780)/2-390+intLeft;
}

activeMenu = '';

function menuOpen(_lyr,_but,_x,_y){
	imgButton[_but].img.hi();
	imgButton[_but].locked = true;
	
	eval(activeMenu);
	activeMenu = 'menuCloseReally(\''+_lyr+'\',\''+_but+'\')';

    var div = document.getElementById(_lyr);
    if (div) {
        div.style.left = _x + 'px';
        div.style.top = _y + 'px';
        div.style.visibility = 'visible';
	}
}

function menuClose(_lyr,_but){
	imgButton[_but].locked = false;
	window.setTimeout('menuCloseReally(\''+_lyr+'\',\''+_but+'\')',1000);
}

function menuCloseReally(_lyr,_but){
	if(!imgButton[_but].locked){
	    imgButton[_but].img.lo();

        var div = document.getElementById(_lyr); 
		if (div) div.style.visibility = 'hidden';
	}
}




var imgButton = new Array();

//initialize button
function imgButtonInit(_lyr){
	if(_lyr == null){
		_lyr = document
	}
	
	for(var i=0; i < _lyr.images.length;i++){
		if(_lyr.images[i].name.indexOf('but') != -1){
			imgButton[_lyr.images[i].name] = new ImgButton(_lyr.images[i]);
		}
	}
}



//button class
function ImgButton(_img) {	
	this.imgLo = new Image();
	this.imgHi = new Image();
	
	this.imgLo.src = _img.src;
	this.imgHi.src = _img.src.replace('_lo','_hi');
	
	this.locked = false;
	
	_img.button = this;
	this.img = _img;
	
	_img.lo = ImgButtonLo;
	_img.hi = ImgButtonHi;
	
	_img.lock = ImgButtonLock;
	_img.unlock = ImgButtonUnlock;
}

function ImgButtonLo(){
	if(!this.button.locked) this.src = this.button.imgLo.src
}

function ImgButtonHi(){
	if(!this.button.locked) this.src = this.button.imgHi.src;
}

function ImgButtonLock(){
	this.button.locked = true;
}

function ImgButtonUnlock(){
	this.button.locked = false;
}








var imgButton = new Array();

//initialize button
function imgButtonInit(_lyr){
	if(_lyr == null){
		_lyr = document
	}
	
	for(var i=0; i < _lyr.images.length;i++){
		if(_lyr.images[i].name.indexOf('but') != -1){
			imgButton[_lyr.images[i].name] = new ImgButton(_lyr.images[i]);
		}
	}
}



//button class
function ImgButton(_img) {	
	this.imgLo = new Image();
	this.imgHi = new Image();
	
	this.imgLo.src = _img.src;
	this.imgHi.src = _img.src.replace('_lo','_hi');
	
	this.locked = false;
	
	_img.button = this;
	this.img = _img;
	
	_img.lo = ImgButtonLo;
	_img.hi = ImgButtonHi;
	
	_img.lock = ImgButtonLock;
	_img.unlock = ImgButtonUnlock;
}

function ImgButtonLo(){
	if(!this.button.locked) this.src = this.button.imgLo.src
}

function ImgButtonHi(){
	if(!this.button.locked) this.src = this.button.imgHi.src;
}

function ImgButtonLock(){
	this.button.locked = true;
}

function ImgButtonUnlock(){
	this.button.locked = false;
}
