function cleanMenu(bt){
	if(bt) {
	  $$(bt).each(function(bt){
	    bt.className='btna_b';
	    $(bt.id+'_div').style.display = "none";
	  });
	  $('tab01_btn7').setAttribute('src', '/images/converse/11.gif');
    $('tab01_btn7_div').hide();
	}
}

function nav_pwd() {
	var pwd = window.location.href;
	var r1  = /http\:\/\/shoes.mop.com\/{0,1}$/;
	var r2  = /http\:\/\/shoes.mop.com\/shoes/;
	var r3  = /ishoes\/topic/;
	var r5  = /ishoes\/website/;
	var r6  = /ishoes\/magazine/;
	if (pwd.match(r1)) {
		$('nav_1').removeClassName('btn_b').addClassName('btn_a');
		return false;
	};
	if (pwd.match(r2)) {
		$('nav_2').removeClassName('btn_b').addClassName('btn_a');
		return false;
	};
	if (pwd.match(r3)) {
		$('nav_3').removeClassName('btn_b').addClassName('btn_a');
		return false;
	};
	if (pwd.match(r6)) {
		$('nav_6').removeClassName('btn_b').addClassName('btn_a');
		return false;
	};
	if (pwd.match(r5)) {
		$('nav_5').removeClassName('btn_b').addClassName('btn_a');
		return false;
	};
}

////// SDGlobal.js

// JScript File

var g_numSeed = 1;
var g_strSeed = "topic";

function SD_GetRandomStr()
{
    var name = g_strSeed;
    name += g_numSeed;

    g_numSeed++;
    return name;
}

function SDImageScroll(hostT, width, height, list)
{
    this.speed = 200;
    this.width = width;
    this.height = height;
    this.szDiv0 = SD_GetRandomStr();
    this.szDiv1 = SD_GetRandomStr();
    this.szDiv2 = SD_GetRandomStr();
    var pNode = $(hostT);
		var divT = $('topic1');
    var div_tpl = new Template('<div><div class="blank8"></div><p><a href="#{url}" target="_blank"><img src="#{img}" border="0"></a></p><div class="jz textleft" style="padding: 3px 3px 3px 10px;background: rgb(0, 0, 0) none repeat scroll 0%;width: 227px;"><img src="/images/in_22.gif" align="absmiddle"> <a href="#{url}" target="_blank" class="cgreen fb">#{title}</a></div><p><img src="/images/in_21.gif"></p></div>');

    var div1 = document.createElement("div");
    div1.id = this.szDiv1;

    for(p=0; p<list.length; p++)
    {
      var div_p = div_tpl.evaluate(list[p]);
      div1.innerHTML += div_p; 
    }   

    var div2 = document.createElement("div");
    div2.id = this.szDiv2;   
    divT.appendChild( div1 );
    divT.appendChild( div2 );
    div2.innerHTML = div1.innerHTML;
    divT.scrollTop = divT.scrollHeight;
};


SDImageScroll.prototype.start = function( speed )
{
    this.speed = speed;
    var div = $( this.szDiv0 );
    var div1 = $( this.szDiv1 );   
    var div2 = $( this.szDiv2 ); 

    var me = this;

    this.MarqueeT = function(){
        var div = $( me.szDiv0 );
        var div1 = $( me.szDiv1 );   
        var div2 = $( me.szDiv2 );   

       if(div1.offsetTop - div.scrollTop >= 0)
            div.scrollTop += div2.offsetHeight;
        else
            div.scrollTop--;
    }

    div.onmouseover = function() {
        clearInterval(me.MyMar);
    }
    div.onmouseout = function() {
        me.MyMar = setInterval(me.MarqueeT,me.speed);
    }

    this.MyMar = setInterval( this.MarqueeT, this.speed);    
}

function autoScroll() {
  var imgscr = new SDImageScroll("topics_list", "280px", "600px", topics_list);   
  imgscr.start(100);
}

window.onload = function() {
	nav_pwd();
	if ($("topics_list" && typeof(topics_list) != "undefined")) {
		autoScroll();
	}
}

var FastInit = {
	onload : function() {
		if (FastInit.done) { return; }
		FastInit.done = true;
		for(var x = 0, al = FastInit.f.length; x < al; x++) {
			FastInit.f[x]();
		}
	},
	addOnLoad : function() {
		var a = arguments;
		for(var x = 0, al = a.length; x < al; x++) {
			if(typeof a[x] === 'function') {
				if (FastInit.done ) {
					a[x]();
				} else {
					FastInit.f.push(a[x]);
				}
			}
		}
	},
	listen : function() {
		if (/WebKit|khtml/i.test(navigator.userAgent)) {
			FastInit.timer = setInterval(function() {
				if (/loaded|complete/.test(document.readyState)) {
					clearInterval(FastInit.timer);
					delete FastInit.timer;
					FastInit.onload();
				}}, 10);
		} else if (document.addEventListener) {
			document.addEventListener('DOMContentLoaded', FastInit.onload, false);
		} else if(!FastInit.iew32) {
			if(window.addEventListener) {
				window.addEventListener('load', FastInit.onload, false);
			} else if (window.attachEvent) {
				return window.attachEvent('onload', FastInit.onload);
			}
		}
	},
	f:[],done:false,timer:null,iew32:false
};
