var	CLR_OVER	=	'EEEEEE';
var	CLR_OUT		=	'#eeeeee';

var B_DOM 	= (document.getElementById) ? true : false;
var B_NS4 	= (document.layers) ? true : false;
var B_IE 	= (document.all) ? true : false;

var	currentItem = null;

function mOvr(src) {
	if(!B_IE && B_DOM){
		if(currentItem){
			//hide currentItem
			currentItem.bgColor = CLR_OUT;
		}
		currentItem = src;
	
		src.cursor = 'hand';
		src.bgColor = CLR_OVER;
	}
	else{
		if (!src.contains(event.fromElement)) {
			src.style.cursor = 'hand';
			src.bgColor = CLR_OVER;
		}
	}
}

function mOut(src, clrIn, event) {
	if(!B_IE && B_DOM)	return;
	
	if(!B_IE){
		if(ev.target == null || ev.target.tagName == null)	return;
		if(ev.target){
			//confirm(ev.target.tagName);
			if(inElement(ev.pageX, ev.pageY, ev.target))
				return;
		}
		src.style.cursor = 'default';
		src.bgColor = clrIn;
	}
	else{
		if (!src.contains(event.toElement)) {
			src.style.cursor = 'default';
			src.bgColor = clrIn;
		}
	}

	return false;
}
 
function mClk(src) {
	if(B_IE && !B_DOM){
		if(ev.srcElement.tagName=='TD') {
			src.children.tags('A')[0].click();
		}
	}
	else{
		if(B_DOM){
			if(src.firstChild){
				src.firstChild.click();
			}
		}
	}
}

function hide() {
		if(currentItem){
			currentItem.bgColor = CLR_OUT;
			currentItem = null;
		}
}
function change_item(){
	var it=document.editor.razdel.options[document.editor.razdel.selectedIndex].value;
	window.location.href="index_auth.php?edit=1&item="+it;

/*	switch(it){
		case 0:
			window.location.href="index_auth.php?edit=1&item=9";
		break;
		case 1:
			window.location.href="index_auth.php?edit=1&item=1";
		break;
		case 2:
			window.location.href="index_auth.php?edit=1&item=5";
		break;
		case 3:
			window.location.href="index_auth.php?edit=1&item=6";
		break;
		case 4:
			window.location.href="index_auth.php?edit=1&item=7";
		break;
		case 5:
			window.location.href="index_auth.php?edit=1&item=8";
		break;
		case 6:
			window.location.href="index_auth.php?edit=1&item=3";
		break;
	}
*/
}
function mhClk(src,page) {
	window.location.href="list_lyr.php?show_id="+src+"&page="+page;
}
function mpClk(src,page) {
	window.location.href="list_prose.php?show_id="+src+"&page="+page;
}
function maClk(src,page) {
	window.location.href="list_auth.php?show_auth="+src+"&page="+page;
}
function mtvClk(src,page,type) {
	if(type==0)
	window.location.href="list_lyr.php?show_id="+src+"&page="+page;
	else
	window.location.href="list_prose.php?show_id="+src+"&page="+page;
}
