var ms_ontimer=[];
function ms_on(id,or,w,h,oldw,oldh,el,t){
var d=tf.content.document;
function getbtn(id,dir,oldn,n){var imgprefix=(typeof(tf.isEntryPage)!='undefined'&&tf.isEntryPage?(tf.lang!=tf.baseLang?'../':'')+'contents':'..');return '<span id="ms_'+dir+'" onMouseDown="tf.utils.ms_set('+oldn+','+n+',8,20);" onMouseUp="tf.utils.ms_set('+oldn+','+n+',3,20);" onMouseover="tf.utils.ms_set('+oldn+','+n+');tf.utils.ms_'+dir+'(\''+id+'\')" onMouseout="tf.utils.ms_stop(\''+dir+'\')"><img src="'+imgprefix+'/media/mscr_'+dir+'.png" width="16" height="16" style="margin-'+(dir=='lt'||dir=='rt'?'left:2px':'top:2px')+';line-height:16px;"></span>';}
function reattach(id,children){var el=d.getElementById('ms_'+id);if(el)for(var n=0,num=children.length;n<num;n++)el.appendChild(children[n]);}
function gen(id,el,elHTML){
var children=[];
for(var n=0,nn=0,num=el.childNodes.length;n<num;n++){if(el.childNodes[nn].nodeType==1&&el.childNodes[nn].nodeName!='SCRIPT')children.push(d.body.appendChild(el.childNodes[nn]));else nn++;}
el.innerHTML=elHTML;
if(tf.isFF){clearTimeout(ms_ontimer[id]);ms_ontimer[id]=setTimeout(function(){reattach(id,children);},50);}
else reattach(id,children);
}
if(or=='h'){
var btnPrev=getbtn(id,'lt',oldw,w-36),btnNext=getbtn(id,'rt',oldw,w-36);
gen(id,el,'<table border=0 cellpadding=0 cellspacing=0 width='+w+'"><tr><td valign=middle><div style="position:relative;width:'+(w-36)+'px;line-height:'+h+';overflow:hidden"><div id="ms_'+id+'" style="position:relative;left:0;width:'+(oldw)+'px;"></div></div></td><td valign=middle>'+btnPrev+btnNext+'</td></tr></table>');
}
else{
if(!tfc.mfhObj){
var elPar=el.offsetParent;
if(elPar.currentStyle)var pos=elPar.currentStyle.position;
else var pos=d.defaultView.getComputedStyle(elPar, '').position;
h-=(pos=='absolute'?el.offsetTop:elPar.offsetTop);
}
var btnPrev=getbtn(id,'up',oldh,h-18),btnNext=getbtn(id,'dn',oldh,h-18);
gen(id,el,'<div style="height:'+h+';"><div style="position:relative;height:'+(h-18)+'px;overflow:hidden"><div id="ms_'+id+'" style="position:relative;top:'+t+'px;height:'+(oldh+oldh-h)+'px;"></div></div><div style="text-align:center;white-space:nowrap;">'+btnPrev+'&nbsp;'+btnNext+'</div></div>');
}}
function ms(id,w,h,dd) {
var d=tf.content.document,or='h',oldw,oldh,top=0,el=null,ret=false;
if(typeof(id)!='undefined')el=d.getElementById(id);
if(el&&tf.utils.pngIE){
var elMS=d.getElementById('ms_'+id);
if(elMS){
try{top=elMS.offsetTop;}catch(e){}
for(var n=0,nn=0,cnt=elMS.childNodes.length;n<cnt;n++)if(elMS.childNodes[nn].nodeType==1&&elMS.childNodes[nn].nodeName!='SCRIPT')el.appendChild(elMS.childNodes[nn]);else nn++;
for(var m=cnt-nn,n=0,cnt=el.childNodes.length-m;n<cnt;n++){el.removeChild(el.childNodes[0]);}
}
if(!isNaN(w)&&w>0)or='h';if(!isNaN(h)&&h>0)or='v';
var el2=el.childNodes;
if(dd){for(var n=0;n<el2.length;n++){if(el2[n].nodeName!='SCRIPT'&&el2[n].nodeType==1){el2=el2[n];break;}}}else{el2=el;}
oldw=el2.scrollWidth;oldh=el2.scrollHeight;
el.style.visibility='visible';
if((oldw>w&&w>0)||(oldh>h&&h>0)){ms_done=1;ms_on(id,or,w,h,oldw,oldh,el,top);tf.utils.pngIE();}
if(typeof(ms_done)=='undefined')ms_done=1;else ms_done++;
ret=true;
}
else{setTimeout('ms("'+id+'",'+w+','+h+','+dd+')',100);}
return ret;
}
// $Revision: 3083 $
// $HeadURL: svn://3d3-p432/ShopFactory/branches/V9_05/bin/Templates/Website/shared_files/menu_scroller.js $

