var talk_omvc;
function getPosition(a1)
{
for (var lx=0,ly=0;a1!=null;lx+=a1.offsetLeft,ly+=a1.offsetTop,a1=a1.offsetParent); 
return {x:lx,y:ly};
}
var id_list;
function all_menu_id(a1)
{
id_list = a1.split(",");
}
function frist_menu(a1,a2)
{
var ema  = a2.getAttribute("ema");
var emb  = a2.getAttribute("emb");
if(a1 && ema && document.getElementById(a1+ema))
{
document.getElementById(a1+ema).style.display = "block";
document.getElementById(a1+ema).style.left    = getPosition(a2).x;
document.getElementById(a1+ema).style.top     = getPosition(a2).y +a2.offsetHeight-3;
}
}
function view_menu(a1,a2)
{
var ema  = a2.getAttribute("ema");
var emb  = a2.getAttribute("emb");
if(a1 && ema && document.getElementById(a1+ema))
{
document.getElementById(a1+ema).style.display = "block";
document.getElementById(a1+ema).style.left    = getPosition(a2).x +a2.offsetWidth;
document.getElementById(a1+ema).style.top     = getPosition(a2).y -1;
}
}
function enter_menu_table(a1,a2)
{
var ema  = a2.getAttribute("ema");
var emb  = a2.getAttribute("emb");
if(a1 && ema && document.getElementById(a1+ema))
{
document.getElementById(a1+ema).style.display = "block";
if(emb && document.getElementById(a1+emb))
{
enter_menu_table(a1,document.getElementById(a1+emb));
}
}
}
function none_menu(a1)
{
if(id_list)
{
for(var i=0;i<id_list.length;i++)
{
if(a1 && id_list[i] && document.getElementById(a1+id_list[i]))
{
document.getElementById(a1+id_list[i]).style.display = "none";
}
}
}
}
function open_web_talk(a1)
{
if(a1)
{
//window.showModalDialog(a1,window,"help:no;scroll:no;resizable:yes;status:no;dialogWidth:600px;dialogHeight:400px;center:yes" );  
	

	if(talk_omvc && talk_omvc.open && !talk_omvc.closed)
	{
	talk_omvc.focus(); 
	}
	else
	{
	talk_omvc = window.open(a1,"newwindow", "width=700, height=500, toolbar= no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no,top=100,left=300");
	}

}
}



function go_to_language(a1)
{
if(a1)
{
var my_url = a1.options[a1.selectedIndex].value;
top.document.location= my_url;
}
}
var lnms_find_menu;
var lnms_find_menu_form;
function view_find_select_menu(a1,a2,a3,a4)
{
if(a1 && a2 && a3 && a4)
{
lnms_find_menu = a2;
lnms_find_menu_form = a1;
a2.style.display = a2.style.display=="none"?"block":"none";
if(a2.style.display=='block')
{
a2.style.left = a3==1?(getPosition(a1).x - a2.offsetWidth):(getPosition(a1).x + a2.offsetWidth);
a2.style.top  = a4==1?(getPosition(a1).y + a1.offsetHeight):(getPosition(a1).y - a1.offsetHeight);
}
}
}
function lnms_menu_return(menu_id,menu_name)
{
lnms_find_menu.style.display = "none";
if(menu_id!='none')
{
if(menu_id>0)
{
if(lnms_find_menu_form.length>1)
{
lnms_find_menu_form.options[1].value = menu_id;
lnms_find_menu_form.options[1].text  = menu_name;
}
else
{
new_opt                              = document.createElement("option");
new_opt.value                        = menu_id;
new_opt.text                         = menu_name;
lnms_find_menu_form.add(new_opt);
lnms_find_menu_form.options[1].selected = true;
}
}
else
{
lnms_find_menu_form.length = 1;
}
}
}
function make_lnms_search_key(a1,a2,a3)
{
if(window.event.keyCode==13 && a1 && a2 && a3)
{
make_lnms_search(a1,a2,a3);
}
}
function make_lnms_search(a1,a2,a3)
{
if(a1 && a2 && a3)
{
if(a2.value)
{
a1.submit();
}
else
{
alert(a3);
}
}
}
function next_search(a1,a2)
{
if(a1 && a2)
{
a1.action = a2;
a1.submit();
}
}

function goto_my_se_menu(a1)
{
if(a1)
    {
var a2= a1.options[a1.selectedIndex].value;
window.open(a2);
    }
}
