function searchLoad(p_lang, p_file, p_number) {
	if (p_lang == "" || p_file == "" || p_number == "") {return false;}

	OPEN('search' + p_number);
	document.all("float" + p_number + "content").innerHTML = '<IMG SRC="/_/_loading4.gif" ALT="" HSPACE="8">';

	var p_c = document.all("search_input_1").value;
	var p_k = document.all("search_input_2").value;
	var p_t = document.all("search_input_3").value;
	var p_y = document.all("search_input_4").value;
	var p_s = document.all("search_input_5").value;

	$(function() {
		$.post("/system/search/" + p_file + ".html", {lang:p_lang, c:p_c, k:p_k, t:p_t, y:p_y, s:p_s},
		function(data){
			document.all("float" + p_number + "content").innerHTML = data;

				var from = p_number*1 + 1;
				for (i=from; i<=5; i++) {
					document.all("search_input_"+i).value = "";
					document.all("search_text_"+i).innerHTML = "<I>" + document.all("search_text_"+i+"_empty").innerHTML + "</I>";
					}

			});
		});
	}



function mx_popupImg(URL,TTL) {
	var inc_y = 29; var inc_x = 10; params = "top=50, left=200,width=600, height=500, Status=no, toolbar=no, menubar=no, location=no, directories=no, scrollbars=no"; popupWin = window.open("","popupWin",params); popupWin.focus(); popupWin.document.open(); popupWin.document.write("<html><"+"head><"+"title>"+TTL+"</"+"title></"+"head>"); popupWin.document.write("<sc"+"ript language = JavaScript>"); popupWin.document.write("function closeWindow(){"); popupWin.document.write("parent.window.close() };"); popupWin.document.write("</"+"script>"); popupWin.document.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' BGCOLOR='#000000'><a href='' title='"+TTL+"'><i"+"mg sr"+"c='"+URL+"' border='0' name='cha1' onClick='closeWindow();' alt='"+TTL+"'  onload='window.resizeTo(window.document.images[0].width+"+inc_x+",window.document.images[0].height+"+inc_y+")'></"+"a></"+"body></"+"html>"); popupWin.document.close();
	}



function over(id, color, menu) {
	if (id == "") {return false;}
	if (color != "") {
		document.all(id).style.backgroundColor = '#'+color;
		}
	else {
		document.all(id).style.backgroundColor = '';
		}
	if (menu != "no") {
		document.all(id).style.cursor = 'pointer';
		}
	}
function out(id, color, menu) {
	if (id == "") {return false;}
	if (color != "") {
		document.all(id).style.backgroundColor = '#'+color;
		}
	else {
		document.all(id).style.backgroundColor = '';
		}
	if (menu != "no") {
		document.all(id).style.cursor = '';
		}
	}



function overn(id) {
	if (id == "") {return false;}
	document.all(id).style.backgroundColor = '#DEDEDE';
	document.all(id).style.cursor = 'pointer';
	}
function outn(id) {
	if (id == "") {return false;}
	document.all(id).style.backgroundColor = '';
	document.all(id).style.cursor = '';
	}
function selectn(id, value, text) {
	if (id == "") {return false;}
	if (text == "") {return false;}
	document.all("search_input_" + id).value = value.replace("<DIV>","").replace("<div>","").replace("</DIV>","").replace("</div>","");
	document.all("search_text_" + id).innerHTML = text.replace("<DIV>","").replace("<div>","").replace("</DIV>","").replace("</div>","") ;
	closeboxPause();
	}



function colOpen(id) {
	document.all(id).style.display = 'block';
	}



//-----------------------------------------------------------------------------------------
var FillTdMenu_Color="";
var FillTdMenu_Bg="_/bg_menu03.gif";
var FillTdSubMenu_Color="#999999";

var if_NN6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
var if_NN  = (document.layers) ? true : false;
var if_IE  = (document.all) ? true : false;
var ie = if_IE;
var active = 0;
var closeTimeout = 100;
var timerID;
var opened = -1;
var SubOpen=0;

function hideElement( elmID, overDiv )
{
  if( ie )
  {
	for( i = 0; i < document.getElementsByTagName( elmID ).length; i++ )
	{
	  obj = document.getElementsByTagName( elmID )[i];
	  if( !obj || !obj.offsetParent )
	  {
		continue;
	  }
  
	  // Find the element's offsetTop and offsetLeft relative to the BODY tag.
	  objLeft   = obj.offsetLeft;
	  objTop    = obj.offsetTop;
	  objParent = obj.offsetParent;
	  
	  while( objParent.tagName.toUpperCase() != "BODY" )
	  {
		objLeft  += objParent.offsetLeft;
		objTop   += objParent.offsetTop;
		objParent = objParent.offsetParent;
	  }
  
	  objHeight = obj.offsetHeight;
	  objWidth = obj.offsetWidth;
  
	  if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft );
	  else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop );
	  else if( overDiv.offsetTop >= ( objTop + objHeight ));
	  else if( overDiv.offsetLeft >= ( objLeft + objWidth ));
	  else
	  {
		obj.style.visibility = "hidden";
	  }
	}
  }
}
 
/*
* unhides <select> and <applet> objects (for IE only)
*/
function showElement( elmID )
{
  if( ie )
  {
//	aler.a;
	for( i = 0; i < document.getElementsByTagName( elmID ).length; i++ )
	{
	  obj = document.getElementsByTagName( elmID )[i];
	  
	  if( !obj || !obj.offsetParent )
	  {
		continue;
	  }
	
	  obj.style.visibility = "";
	}
  }
}


//-----------------------------------------------------------------------------------------
function nameIt(id) {
	if (id == "-1") {return false;}
	if (if_IE)	{return eval('document.all["'+id+'"].style');}
		else		{var temp = document.getElementById(id); return temp.style;}

	}

function nameCell(id) {
	if (if_IE)	{return eval('document.all["'+id+'"]');}
	else		{if  (if_NN6)  {return document.getElementById(id);}
		else return eval('document["'+id+'"]' );}
	}
//-----------------------------------------------------------------------------------------
function closebox(num)
	{
	var did = num;
	temp = nameIt(did);
	if (temp != false) {
		temp.visibility = 'hidden';
		opened = -1;
		UNCOLOR(num);
		}
	}
//-----------------------------------------------------------------------------------------
function openbox(num)
	{
	if  (num != 999)
		{
		var did = num;
		temp = nameIt(did);
		temp.visibility = 'visible';
		hideElement('SELECT', temp);
		if  (opened != -1) closebox( opened );
		opened = num;
		COLOR(num);
		}
	else	{
		closebox(opened);
		showElement('SELECT', window);
	}
	}
//-----------------------------------------------------------------------------------------
function openboxPause()
	{
	if  (!active) clearTimeout(timerID);
	active=1;
	}
function closeboxPause()
	{
	active = 0;
	timerID = setTimeout('openbox(999)', closeTimeout);
	}
//-----------------------------------------------------------------------------------------
function OPEN(n)
	{
  	if (SubOpen==n && opened != -1) {
    	openboxPause();
    }
    else {
  	  openbox(n);
  	  openboxPause();
  	  SubOpen=n;
    }
	}
function CLOSE(n)
	{
	if (!active) return;
	SubOpen=0;
	closebox(n);
	closeboxPause();
	}
//-----------------------------------------------------------------------------------------
function COLOR(n)
	{
	var temp=nameCell("COLOR"+n);
	if (temp && FillTdMenu_Color) 	{temp.bgColor=FillTdMenu_Color; temp.style.cursor = "default";}
	if (temp && FillTdMenu_Bg) 	{temp.style.backgroundImage="url("+FillTdMenu_Bg+")"; temp.style.cursor = "default";}
	}
function UNCOLOR(n)
	{
	var temp=nameCell("COLOR"+n);
	if (temp && FillTdMenu_Color) 	temp.bgColor="";
	if (temp && FillTdMenu_Bg) 	temp.style.backgroundImage="";
	}
//-----------------------------------------------------------------------------------------
function FILL(id)	{var temp = nameCell(id); temp.bgColor=FillTdSubMenu_Color; temp.style.cursor = "pointer";}
function UNFILL(id)	{var temp = nameCell(id); temp.bgColor = "";}
function GOTO(url) {document.location.href = url;}
//-----------------------------------------------------------------------------------------


