// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function jump_to(j_url)
{
	location.href = j_url;
}
function del_one(dmsg,urlpage)
{
	if( confirm(dmsg) ) location.href = urlpage
}

function select_manage(obj,check_var){

	for(var i = 0;i<obj.elements.length;i++)
	{
		if(obj.elements[i].type == "checkbox")
		{
			if(document.getElementById('check_all').checked){
				obj.elements[i].checked = true;
			}else{
				obj.elements[i].checked = false;
			}
		}
	}
}

function change_color(check_var,row_id)
{
	if(check_var)
	{	document.getElementById(row_id).style.backgroundColor = '#DFEFF6';
		temp_color = document.getElementById(row_id).style.backgroundColor;
	}else{
		document.getElementById(row_id).style.backgroundColor = 'white';
		temp_color = document.getElementById(row_id).style.backgroundColor;
	}
}
function change_colorall(check_var,y){
	for(x=1;x <= y;x++)
	{
		if(check_var)
			document.getElementById(x).style.backgroundColor = '#DFEFF6';
		else
			document.getElementById(x).style.backgroundColor = 'white';
	}
}

function over_color(row_id){
	temp_color = document.getElementById(row_id).style.backgroundColor;
	document.getElementById(row_id).style.backgroundColor = '#F6F3D3';
}

function out_color(row_id){
	document.getElementById(row_id).style.backgroundColor = temp_color;
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function command_show(layer_id,command_msg){
	x = event.clientX;
	y = event.clientY + document.documentElement.scrollTop;
	document.getElementById(layer_id).innerHTML 	= command_msg;
	document.getElementById(layer_id).style.left	= x+15;
	document.getElementById(layer_id).style.top		= y;
	document.getElementById(layer_id).style.display	= "block";
}

function command_hide(layer_id){
	document.getElementById(layer_id).style.display = "none";
}

function w_close(){
	window.opener.location.reload();
	window.close();
}

function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}

