var menuSlider=function(){
	var m,e,g,s,q,i; e=[]; q=15; i=8;
	return{
		init:function(j,k){
			m=document.getElementById(j); e=m.getElementsByTagName('li');
			var i,l,w,p; i=0; l=e.length;
			c=document.getElementById('navhome');v=c.value; 
			if(v==1){s=c; w=c.offsetWidth; p=menuSlider.findY(c)}
			c.onmouseover=function(){menuSlider.mo(this)}; c.onmouseout=function(){menuSlider.mo(s)};
			
			c=document.getElementById('navcom');v=c.value; 
			if(v==1){s=c; w=c.offsetWidth; p=menuSlider.findY(c)}
			c.onmouseover=function(){menuSlider.mo(this)}; c.onmouseout=function(){menuSlider.mo(s)};
			
			c=document.getElementById('navgirls');v=c.value; 
			if(v==1){s=c; w=c.offsetWidth; p=menuSlider.findY(c)}
			c.onmouseover=function(){menuSlider.mo(this)}; c.onmouseout=function(){menuSlider.mo(s)};
			
			c=document.getElementById('navlinks');v=c.value; 
			if(v==1){s=c; w=c.offsetWidth; p=menuSlider.findY(c)}
			c.onmouseover=function(){menuSlider.mo(this)}; c.onmouseout=function(){menuSlider.mo(s)};
			 
			g=document.createElement('div');
			g.setAttribute('id',k);
			m.parentNode.appendChild(g);
			g.style.width=(w-30)+'px'; g.style.left=(p+15)+'px';
		},
		mo:function(d){
			clearInterval(m.tm);
			var el,ew; el=parseInt(menuSlider.findY(d)+15); ew=parseInt(d.offsetWidth-30);
			m.tm=setInterval(function(){menuSlider.mv(el,ew)},i);
		},
		findY:  function findPosY(obj)
		 {
		    var curtop = 0;
		    if(obj.offsetParent)
			while(1)
			{
			  curtop += obj.offsetLeft;
			  if(!obj.offsetParent)
			    break;
			  obj = obj.offsetParent;
			}
		    else if(obj.y)
			curtop += obj.y;
		    return curtop;
		 },
		mv:function(el,ew){
			var l,w; l=parseInt(g.offsetLeft); w=parseInt(g.offsetWidth);
			if(l!=(el)||w!=(ew)){
				if(l!=el){var ld,lr,li; ld=(l>el)?-1:1; lr=Math.abs(el-l); li=(lr<q)?ld*lr:ld*q; g.style.left=(l+li)+'px'}
				if(w!=ew){var wd,wr,wi; wd=(w>ew)?-1:1; wr=Math.abs(ew-w); wi=(wr<q)?wd*wr:wd*q; g.style.width=(w+wi)+'px'}
			}else{clearInterval(m.tm)}
}};}();
