<!--  
/*
#   $Source: /CVSROOT/yahoo/my/yplus/lib/my/sbc/ysbc_menu.js,v $
#   $Date: 01/05/2004
#   $Author: ava hristova $
*/
var ymy_isSec = 0;
var xAdjust = 12;
var yAdjust = 5;

function SlideList(id, width) {
	this.name = id;
	this.base = ylib_List;
	this.base(id,width);
	this.imgPath="http://us.i1.yimg.com/us.yimg.com/i/";
	if (document.URL.indexOf("https",0)!=-1) { this.imgPath="https://sec.yimg.com/i/";ymy_isSec=1; }
	this.css = "<style>\n";
	this.itemH = 22;
	this.cont = null; this.holder = null; this.shadow = null; this.loc = null;
	this.locX=this.locY=this.isOpen=this.isDone=0;
	this.hideEl = null;
	
	this.init2    = slInit2;
	this.add      = slAdd;
	this.build    = slBuild;
	this.over     = slOver;
	this.show     = slShow;
	this.locate   = slLocate;
	this.sShadow  = slsShadow;
	this.hShadow  = slhShadow;
	this.onSelect = slOnSelect;
	this.hideList = slHideList;
}
SlideList.prototype = new ylib_List;

function slInit2() {
	this.cont = ylib_getObj(this.id+'cont');
	this.holder = ylib_getObj(this.id+'holder');
	this.shadow = ylib_getObj(this.id+'shadow');
	this.loc = ylib_getObj('b_'+this.name+'Img');
	if (oBw.ie4up) { this.shadow.style.filter = 'Alpha(opacity = 30)'; }
	if (oBw.ns6) this.shadow.style.MozOpacity = '16%';
	pgLoaded=1;
}
// label, url, image src
function slAdd(items) {
	if (items==null) return;
	var l = items.length;
	for (var i=0; i<l; i++) {
		this.items[i] = new Array();
		this.items[i].selected = 0;
		this.items[i].hasChild = 0;
		this.items[i].text = items[i][0];
		this.items[i].value = items[i][1];
		this.items[i].lnk = '<a href="'+items[i][1]+'" class="glmenucss" target="_parent">';
		this.items[i].y = this.h;
		this.h += this.itemH;
	} 
}

function slBuild() {
	var cssArr = new Array();
	var divArr = new Array();
	var l = this.items.length;
	var hasClip = (oBw.ns)? ' left:1px; clip:rect(0 '+this.w+' '+this.itemH+' 0); layer-background-color:'+this.color.offBg+'':''
	var nspad = (oBw.ns)? 1:0;
	var i_shW = (oBw.ie)? 2:12;
	this.css += 'a.glmenucss { font-family:verdana; font-size: .85em; text-decoration: none; } a.glmenucss:hover { text-decoration: underline; } \n #'+this.id+'shadow { position:absolute; left:-500px; top:-'+(this.itemH*l+2)+'px; width:'+(this.w+i_shW)+'px; height:'+(this.itemH*l+2)+'px; background-image:url('+this.imgPath+'my/plus/sbc/dsl_dots2.gif); background-repeat:repeat; display:none; z-index:2; visibility:hidden; } \n#'+this.id+'cont { position:absolute; visibility:hidden; left:-500px; top:-500px; width:'+(this.w+2)+'px; height:'+(this.itemH*l+2)+'px; clip:rect(0 '+(this.w+25)+' '+(this.itemH*l+20)+' 0); } \n#'+this.id+'holder { position:absolute; left:0px; top:-'+(this.itemH*l+2)+'px; width:'+(this.w+((oBw.ns6)? 10:2))+'px; height:'+(this.itemH*l+((oBw.ns6)? 5:2))+'px; border:1px solid #cccccc; background-color:#ffffff; z-index:100; } \n'
	
	for (var i=0; i<l; i++) {
		if(i==0) { this.css += '#'+this.id+i } else { this.css += ', #'+this.id+i }
		cssArr[i] = '#'+this.id+i+' { top:'+(i*this.itemH+nspad)+'px; } \n'
		divArr[i] = '<div id='+this.id+i+'>'+this.items[i].lnk+this.items[i].text+'</a></div> \n'
	}
	
	this.css += ' { position:absolute; width:'+this.w+'px; height:'+(this.itemH-((oBw.ie&&oBw.mac)? 0:5))+'px; layer-background-color:'+this.color.offBg+'; padding: 3px 5px; left:0px; text-align:left; cursor:pointer; cursor:hand; '+hasClip+' }\n'  
	this.css += cssArr.join('')
	
	this.div += '<div id='+this.id+'cont>\n<div id='+this.id+'shadow>&nbsp;</div>\n<div id='+this.id+'holder>\n'
	this.div += divArr.join('')
	this.div += (oBw.ns)? '<img src="'+this.imgPath+'spacer.gif" width=10 height='+(this.itemH*l-10)+'>\n':'' // needed to create the height for ns
	this.div += '</div>\n</div>\n'
}

function slsShadow() {
	if (oBw.op||oBw.ns||oBw.mac) {this.done=1;return;}
	var i_offsetY = (oBw.ie)? 8:12;
	ylib_moveTo(this.shadow,5,i_offsetY - 2);
	ylib_show(this.shadow,'block');
	this.done=1;
}

function slhShadow() {
	this.isOpen=0;
}

function slOver(idx) {
	 if (!this.items[idx].selected) { this.turnOn(ylib_getObj(this.id+idx)); }
}

function slShow() {
	var offsetY = (oBw.win)? 12:12; var offsetX = (oBw.ie)? 12:1; 
	this.locate();
	if (!this.isOpen) {    // slide menu down
		this.done=0;
		ylib_show(this.cont);
		ylib_moveTo(this.cont,(this.locX-this.w)+offsetX,this.locY+offsetY);
		ylib_setZ(this.cont,2000);
		ylib_slide(this.holder,0,2,9,this.id+".sShadow()");
		hideSelect(1);
		this.isOpen=1;
	} else { // slide menu up
		if (!this.done) return;
		this.done=0;
		ylib_slide(this.holder,0,-(this.h+10),9,this.id+".hShadow()"); // +10 b/c of ns6
		if (!oBw.ns) { ylib_moveTo(this.shadow,-500,-500);ylib_hide(this.shadow,'none'); }
		setTimeout("ylib_hide("+this.id+".cont)",100);
		hideSelect(0);
	}
	return false;
}

function hideSelect(s) {
	if (oBw.ie) {
		var oCol = document.getElementsByTagName('select');
		if (s) { for (i=0; i<oCol.length; i++) { ylib_hide(oCol[i]); } }
		else { for (i=0; i<oCol.length; i++) { ylib_show(oCol[i]); } }
	}
}
function slLocate() { this.locX = ylib_getPageX(this.loc) - xAdjust; this.locY = ylib_getPageY(this.loc) - yAdjust; }
function slOnSelect() { if (!oBw.mac&&oBw.ie) window.location.href = this.lnk; }
function slHideList() { this.show(); }

function ylib_slide(e,x,y,sp,funcCall,xNow,yNow){
 var num;
 if(typeof e!='object'){ num=e; e=ylib_slide.all[num]; e.sliding=true; }
 else{if(e.sliding)return}
 eLT = ylib_getX(e); eRT = ylib_getY(e);
 xNow=xNow||parseInt(eLT); yNow=yNow||parseInt(eRT);
 x = (x==null)? eLT:x; y = (y==null)? eRT:y;
 distX=Math.abs(xNow-x); distY=Math.abs(yNow-y);
 if(Math.round(xNow)!=x)xNow+=(distX/(11-sp)*sign(xNow,x));
 if(Math.round(yNow)!=y)yNow+=(distY/(11-sp)*sign(yNow,y));
 ylib_setX(e,px(Math.round(xNow)));
 ylib_setY(e,px(Math.round(yNow)));
 if(num==null){num=ylib_slide.all.length;ylib_slide.all[num]=e;}
  if(Math.round(xNow)!=x||Math.round(yNow)!=y)setTimeout('ylib_slide('+num+','+x+','+y+','+sp+',"'+funcCall+'",'+xNow+','+yNow+')', 30);
 else{
  e.sliding=false;
  if(funcCall!='undefined')eval(funcCall);
 }
};
ylib_slide.all=[];
function sign(x,y){return(x<y)?1:-1};
function px(n){return n+(!oBw.ns&&!oBw.op?'px':0)};
//-->

