function findxpos(elem)
{           
	if (elem==null)           
		return 0;           
	else           
	{           
		if ((elem.style.position=='absolute' || elem.style.position=='relative') && !skm_IsSubMenu(elem.id)) return 0;           
		return elem.offsetLeft+findxpos(elem.offsetParent);           
	}           
}           

function findypos(elem)
{           
	if (elem==null)           
		return 0;           
	else {           
		if ((elem.style.position=='absolute' || elem.style.position=='relative') && !skm_IsSubMenu(elem.id)) return 0;           
		return elem.offsetTop+findypos(elem.offsetParent);           
	}           
}           

function showsm(obj,sm,mt,hor)
{
var x = new getObj(sm);
var parent=document.getElementById(mt);
if (hor)
{
x.style.left=findxpos(obj) - parent.border;           
x.style.top=findypos(parent)+parent.offsetHeight - parent.border;           
if (x.offsetWidth<obj.offsetWidth) x.tyle.width=obj.offsetWidth;           
}
else
{
x.style.left=findxpos(parent)+parent.offsetWidth - parent.border;           
x.style.top=findypos(obj) - parent.border;           
var visibleWidth=parseInt(window.outerWidth?window.outerWidth-9:document.body.clientWidth,10);           
if ((parseInt(x.offsetLeft,10)+parseInt(x.offsetWidth,10))>visibleWidth) {           
x.style.left=visibleWidth-parseInt(x.offsetWidth,10);}
}
document.getElementById(sm).style.visibility="visible";
}

function showsmleft(obj,sm,mt)
{
var x = new getObj(sm);
var parent=document.getElementById(mt);
var child=document.getElementById(sm);
x.style.left=findxpos(parent)+parent.offsetWidth - parent.border-parent.width-child.width;           
x.style.top=findypos(obj) - parent.border;           
var visibleWidth=parseInt(window.outerWidth?window.outerWidth-9:document.body.clientWidth,10);           
if ((parseInt(x.offsetLeft,10)+parseInt(x.offsetWidth,10))>visibleWidth) {           
x.style.left=visibleWidth-parseInt(x.offsetWidth,10);}
document.getElementById(sm).style.visibility="visible";
}

function hidesm(submenuid)
{
document.getElementById(submenuid).style.visibility="hidden"
}

function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}

function smvison(obj)
{
document.getElementById(obj.id).style.visibility="visible"
}

function smvisoff(obj)
{
document.getElementById(obj.id).style.visibility="hidden"
}

function smvisonbyid(idname)
{
document.getElementById(idname).style.visibility="visible"
}

function smvisoffbyid(idname)
{
document.getElementById(idname).style.visibility="hidden"
}
