<!--

//var mlLast = "";

function searchProduct(){
	var da_form=document.getElementById("productsearch");
	var s_term = document.getElementById("search").value;
	var s_child = document.getElementById("isChild").value;
	if(s_child!=''){
		s_term = s_term +"&c="+s_child;
	}
	da_form.action="/search.asp?search="+s_term;
	da_form.submit();
}




function submitSearchProductByEnter(strElement,e){
	var keynum
	if(window.event){// IE
		keynum = e.keyCode;
	}
	else if(e.which){// Netscape/Firefox/Opera
		keynum = e.which;
	}
	if (keynum == '13') {
		if(strElement.value){
		searchProduct()
		}
	}
}


function submitPopSearchWord(strTerm){
	
		document.getElementById("search").value = strTerm;
		searchProduct();
	
}


//###########################################################################################################
// POPUP WINDOW FUNCTION

function popit(popdata,daHeight){
	var popObject = document.getElementById('pop_ob');
	var popbox = document.getElementById('popbox');
	var popblock = document.getElementById('popblock');
	var scrOfX = 0, scrOfY = 0;
	if(!daHeight){daHeight=225}
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}else if( typeof( screen.availheight ) == 'number' ) {
		myWidth = screen.availwidth;
		myHeight = screen.availheight-130;
	}else{
		myWidth = screen.width;
		myHeight = screen.height-130;
	}
	popObject.src = "/_js/index.html"
	if(!popdata.href){
		popObject.src = popdata;	
	}else{	
		popObject.src = popdata.href;	
	}
	popblock.style.width = myWidth-25+"px";
	popblock.style.height = myHeight+scrOfY+daHeight+"px";
	popblock.style.display = 'block';
	popbox.style.left = myWidth/2-330+"px";
	
	if(myHeight<(daHeight+50)){
		if(daHeight>226){
			daHeight=myHeight-50;
			popbox.style.top = scrOfY-38+"px"
		}else{
			popbox.style.top = scrOfY-20+"px"
		}
	}else{
		popbox.style.top = (scrOfY-70)+(myHeight/2)-(daHeight/2)+"px"	
	}
	

	popbox.style.height = daHeight+25+"px";
	popbox.style.display = 'block';
	var clearloadbox=setTimeout("document.getElementById('loadbox').style.display = 'none'",700);
	var setobheight=setTimeout("document.getElementById('pop_ob').style.height = '"+daHeight+"px'",1000);
}

function popitmsg(popmsg,clr){
	var popObject = document.getElementById('pop_ob');
	var popbox = document.getElementById('popbox');
	var popblock = document.getElementById('popblock');
	var scrOfX = 0, scrOfY = 0;
	var myWidth = 0, myHeight = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	if( typeof( window.innerWidth ) == 'number' ) {
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	popObject.src = "/_include/inc_popmsg.asp?popmsg="+popmsg+"&clr="+clr;
	popblock.style.width = myWidth+scrOfX+"px";
	popblock.style.height = myHeight+scrOfY+250+"px";
	popblock.style.display = 'block';
	popbox.style.left = myWidth/2-330+"px";
	popbox.style.top = scrOfY+50+"px";
	popbox.style.display = 'block';
	document.getElementById('loadbox').style.display = 'none';
	document.getElementById('pop_ob').style.height = '225px';
}

function hidepop(dest){
	if (dest) {
		window.location=dest;
	}
	show('loadbox');
	
	document.getElementById('loadbox').style.display = 'block';
	document.getElementById('pop_ob').style.height = '0px';
	document.getElementById('pop_ob').src = "/_js/index.html"

	hide('popbox');
	hide('popblock');
}

//############################################
// SET opacity STYLE OF POPUP BACKGROUND FOR NETSCAPE/FIREFOX
var browser_type;
browser_type = navigator.appName;
if (browser_type == "Netscape") {
document.write('<style type="text/css">#popblock { -moz-opacity: .3; opacity:0.3; } #formblock { -moz-opacity: .6; opacity:0.6; }</style>');
}


//###########################################################################################################
// NAV FUNCTION
var lastover = null;
var lastob = null;
var lastop = null;
function mladdevents(){
	var effects_a = new Array();
	var divs = document.getElementsByTagName('div');
	for(var j=0;j<divs.length;j++){
		if(divs[j].className.indexOf('mlmenu') != -1){
			var lis = divs[j].getElementsByTagName('li');
			for(var i =0;i<lis.length;i++){
				lis[i].onmouseover = mlover;
				lis[i].onmouseout = mloutSetTimeout;
				if(lis[i].getElementsByTagName('ul').length > 0){
					lis[i].className += 'haschild';
				}
				else{
					if(divs[j].className.indexOf('arrow') != -1){
						//This accounts for a wierd IE-specific bug in horizontal menus. CSS will set visibility: hidden;. This keeps the menu level(in IE)
						lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="noshow">&darr;</span>';
					}
				}
				var uls = lis[i].getElementsByTagName('ul');
				for(var k=0;k<uls.length;k++){
					var found = 'no';
					for(var z=0;z<effects_a.length;z++){
						if(effects_a[z] == uls[k]){
							found = 'yes';
						}
					}
					if(found == 'no'){
						effects_a[effects_a.length] = uls[k];
						uls[k].style.zIndex = '100';
						mlEffectLoad(uls[k]);
					}
				}
			}
		}
	}
}
function mloutSetTimeout(e){
	if(!e){
		var the_e = window.event;
	}
	else{
		var the_e = e;
	}
	var reltg = (the_e.relatedTarget) ? the_e.relatedTarget : the_e.toElement;
	if(reltg){
		var under = ancestor(reltg,this);
		if(under === false && reltg != this){
			window.mlLast = this;
			var parent = this.parentNode;
			while(parent.parentNode && parent.className.indexOf('mlmenu') == -1){
				parent = parent.parentNode;
			}
				//window.mlTimeout = setTimeout(function(){mlout()},1000);
				mlout();
			
		}
	}
}
function mlout(){
	var uls = window.mlLast.getElementsByTagName('ul');
	var sib;
	for(var i=0;i<uls.length;i++){
		mlEffectOut(uls[i]);
		window.mlLast.className = 'haschild hide';
	}
	window.lastover = null;
}
function mlover(e){
	if(!e){
		var the_e = window.event;
	}
	else{
		var the_e = e;
	}
	the_e.cancelBubble = true;
	if(the_e.stopPropagation){
		the_e.stopPropagation();
	}
	if (window.mlTimeout){
		clearTimeout(window.mlTimeout);
	}
	if(window.mlLast && window.mlLast != this && ancestor(this,window.mlLast) == false){
		mlout();
	}
	else{
		window.mlLast = null;
	}
	var reltg = (the_e.relatedTarget) ? the_e.relatedTarget : the_e.fromElement;
	var ob = this.getElementsByTagName('ul');
	var under = ancestor(reltg,this);
	if(ob[0] && under == false){
		
			if(window.lastover != ob[0]){
				this.className = 'haschild';
				mlEffectOver(ob[0],this);
				window.lastover = ob[0];
			}
		
	}
}
function mlSetOpacity(ob,level){
	if(ob){
		//level is between 0 and 10
		//need to convert to decimal for standard
		var standard = level/10;
		//need to convert to 0-100 scale for IE filter
		var ie = level*10;
		ob.style.opacity = standard;
		ob.style.filter = "alpha(opacity="+ie+")"
	}
}
function mlIncreaseOpacity(ob){
		var current = ob.style.opacity;
		if(lastob == ob && lastop == current){
			//mlout has not interfered
			current = current *10;
			var upone = current +4;
			mlSetOpacity(ob,upone);
			lastob = ob;
			lastop = upone/10;
		}
}
function mlIncreaseHeight(ob){
	var current = parseInt(ob.style.height);
	var newh = current + 1;
	ob.style.height = newh+'px';
}
function mlIncreaseWidth(ob){
	var current = parseInt(ob.style.width);
	var newh = current + 1;
	ob.style.width = newh+'px';
}
function mlEffectOver(ob,parent){
	switch(ob.className){
		case 'fade':
			ob.style.display = 'block';
			if(ob.style.opacity == 0){
				lastob = ob
				lastop = 0;
				for(var i = 1;i<=10;i++){
					setTimeout(function(){mlIncreaseOpacity(ob)},i*50);
				}
				setTimeout(function(){ob.style.filter = ''},500);
			}
			break;
		case 'blindv':
			ob.style.display = 'block';
			if(ob.offsetHeight){
				var height = ob.offsetHeight
				ob.style.height = '0px';
				ob.style.overflow = 'hidden';
				for(var i=0;i<height;i++){
					setTimeout(function(){mlIncreaseHeight(ob)},i*3);
				}
				setTimeout(function(){ob.style.overflow='visible';},height*3)
			}
			break;
		case 'blindh':
			ob.style.display = 'block';
			if(ob.offsetWidth){
				var width = ob.offsetWidth;
				ob.style.width = '0px';
				ob.style.overflow = 'hidden';
				for(var i=0;i<width;i++){
					setTimeout(function(){mlIncreaseWidth(ob)},i*3);
				}
				setTimeout(function(){ob.style.overflow='visible';},width*3)
			}
			break;
		default:
			ob.style.display = 'block';
			break;
	}
}
function mlEffectOut(ob){
	switch(ob.className){
		case 'fade':
			mlSetOpacity(ob,0);
			ob.style.display = 'none';
			break;
		case 'blink':
			ob.style.border = '';
			ob.style.display = 'none';
			break;
		default:
			ob.style.display = 'none';
			break;
	}
}
function mlEffectLoad(ob){
	var parent = ob.parentNode;
	while(parent.parentNode && parent.className.indexOf('mlmenu') == -1){
		parent = parent.parentNode;
	}
	if(parent.className.indexOf('fade') != -1){
			ob.style.display = 'none';
			ob.className = 'fade';
			mlSetOpacity(ob,0);
	}
	else if(parent.className.indexOf('blink') != -1){
		ob.className = 'blink';
		ob.style.display = 'none';
	}
	else if(parent.className.indexOf('blindv') != -1){
		ob.className = 'blindv';
		ob.style.display = 'none';
	}
	else if(parent.className.indexOf('blindh') != -1){
		ob.className = 'blindh';
		ob.style.display = 'none';
	}
	else{
		ob.className = 'none';
		ob.style.display = 'none';
	}
}
function ancestor(child, parent){
	if(child==null)return false;//Saves checking elsewhere
	//This is a fix for a Firefox bug *gasp*
	//Aparantly causes a bug in Opera!
	//I see no choice but a browser detect. *sigh* I didn't want to have to do this.
	if(navigator.userAgent.indexOf('Gecko') != -1 && navigator.userAgent.indexOf('Opera') == -1){
		//This should only be run by Gecko based browsers. this code should be fine in everything but Opera so forge away browsers.
		var allc = parent.getElementsByTagName('*');
		for(var i= 0;i<allc.length;i++){
			if(allc[i] == child){
				return true;
			}
		}
	}
	else{
		for(; child.parentNode; child = child.parentNode){
			if(child.parentNode === parent) return true;
		}
	}
	return false;
}


//###########################################################################################################
// NEWS TICKER

var delayb4=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var mSpeed=1 //Specify marquee scroll step in px. (larger is faster, 1 is smooth) 
var scrollInt=60 //Specify marquee scroll interval in milliseconds(smaller is faster 10-60 good range) over 60 not smooth 
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
var resetOffset=520 //The ammount to offset the ticker when it returns to the start - so the first story scrolls into view rather than just appearing
var xSpeed=mSpeed
var noSpeed=(pauseit==0)? xSpeed: 0
var inner_size=''
var inner_ticker=''

function loadTicker(){
	inner_ticker=document.getElementById('ticker1')
	if(inner_ticker.offsetWidth){
		inner_size=inner_ticker.offsetWidth
		inner_ticker.style.left="0px"
	}
	setTimeout('lefttime=setInterval("scrollTicker()",scrollInt)', delayb4)
}

function scrollTicker(){
	if (parseInt(inner_ticker.style.left)>(inner_size*(-1)+130))
		inner_ticker.style.left=parseInt(inner_ticker.style.left)-xSpeed+"px"
	else
		inner_ticker.style.left=resetOffset+"px"
}

//###########################################################################################################
// IMAGE SCROLLER

function ImageScroller(){
	var daImageScroll = document.getElementById('daImageScroll');
	
	if (daImageScroll){
		var daInner = document.getElementById('daInner');
		var x1_scroll = document.getElementById('x1_scroll');
		var x2_scroll = document.getElementById('x2_scroll');
		
		var n=Math.floor(daImageScroll.offsetWidth/x1_scroll.offsetWidth);
		
		var imageSpeed=30;
		
		for (var i=0;i<=n;i++){
			x2_scroll.innerHTML+=x1_scroll.innerHTML;
		}
		
		function moveImageScroll(){
			if(daInner.scrollLeft>=x1_scroll.offsetWidth){
				  daInner.scrollLeft-=x1_scroll.offsetWidth;
			}else{
				  daInner.scrollLeft++;
			}
		}
		var mmove=setInterval(moveImageScroll,imageSpeed);
	}
}

function loadSlider(){
	if(document.getElementById("slider")){
	// to enable uncomment below
		slider.init('slider',1)
		
	}
}


var slider=function(){
	var array=[]; var speed=3; var timer=3;
	return{
		init:function(t,c){
			var s,ds,l,i,y;
			s=document.getElementById(t); ds=s.getElementsByTagName('div'); l=ds.length; i=y=0;
			for(i=0;i<l;i++){
				var d,did; d=ds[i]; did=d.id;
				if(did.indexOf("head_")!=-1){
					y++; d.onclick=new Function("slider.process(this)");
				}else if(did.indexOf("body_")!=-1){
					array.push(did.replace('body_','')); d.maxh=d.offsetHeight;
					if(c!=y){
						d.style.height='0px'; d.style.display='none';
					}else{
						d.style.display='block';
						document.getElementById('desc_'+c).style.display='none';
						
					}
				} 
			}
		},
		process:function(d){
			var cl,i; cl=array.length; i=0;
			for(i;i<cl;i++){
				var s,h,c,cd;
				s=array[i]; h=document.getElementById('head_'+s);
				c='body_'+s; cd=document.getElementById(c); clearInterval(cd.timer);
				
				
				if(h==d&&cd.style.display=='none'){
					document.getElementById('desc_'+s).style.display='none';
					cd.style.display='block'; this.islide(c,1);
				}else if(cd.style.display=='block'){
					this.islide(c,-1);
					document.getElementById('desc_'+s).style.display='block';
					}
			}
		},
		islide:function(i,d){var c,m; c=document.getElementById(i); m=c.maxh; c.direction=d; c.timer=setInterval("slider.slide('"+i +"')",timer)},
		slide:function(i){
			var c,m,h,dist; c=document.getElementById(i); m=c.maxh; h=c.offsetHeight;
			dist=(c.direction==1)?Math.round((m-h)/speed):Math.round(h/speed);
			if(dist<=1){dist=1}
			c.style.height=h+(dist*c.direction)+'px'; c.style.opacity=h/c.maxh; c.style.filter='alpha(opacity='+(h*100/c.maxh)+')';
			if(h<2&&c.direction!=1){
				c.style.display='none'; clearInterval(c.timer);
			}else if(h>(m-2)&&c.direction==1){clearInterval(c.timer)}
		}
};}();

//###########################################################################################################
// SET LOADERS -  anything that needs to be loaded by the page gets loaded here


if (window.addEventListener){
	window.addEventListener("load", mladdevents, false);
	window.addEventListener("load", ImageScroller, false);
	window.addEventListener("load", loadSlider, false);
}

else if (window.attachEvent){
	window.attachEvent("onload", mladdevents);
	window.attachEvent("onload", ImageScroller);
	window.attachEvent("onload", loadSlider);
}

else if (document.getElementById){
	window.onload=mladdevents;
	window.onload=ImageScroller;
	window.onload=loadSlider;
}

var Drag = {
	obj : null,
	init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper){
		o.onmousedown	= Drag.start;
		o.hmode			= bSwapHorzRef ? false : true ;
		o.vmode			= bSwapVertRef ? false : true ;
		o.root = oRoot && oRoot != null ? oRoot : o ;
		if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px";
		if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "0px";
		if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
		if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
		o.minX	= typeof minX != 'undefined' ? minX : null;
		o.minY	= typeof minY != 'undefined' ? minY : null;
		o.maxX	= typeof maxX != 'undefined' ? maxX : null;
		o.maxY	= typeof maxY != 'undefined' ? maxY : null;
		o.xMapper = fXMapper ? fXMapper : null;
		o.yMapper = fYMapper ? fYMapper : null;
		o.root.onDragStart	= new Function();
		o.root.onDragEnd	= new Function();
		o.root.onDrag		= new Function();
	},

	start : function(e){
		var o = Drag.obj = this;
		e = Drag.fixE(e);
		var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		o.root.onDragStart(x, y);
		o.lastMouseX	= e.clientX;
		o.lastMouseY	= e.clientY;
		if (o.hmode) {
			if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX;
			if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX;
		} else {
			if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
			if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
		}
		if (o.vmode) {
			if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY;
			if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY;
		} else {
			if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
			if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
		}
		document.onmousemove	= Drag.drag;
		document.onmouseup		= Drag.end;
		return false;
	},

	drag : function(e){
		e = Drag.fixE(e);
		var o = Drag.obj;
		var ey	= e.clientY;
		var ex	= e.clientX;
		var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		var nx, ny;
		if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
		if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
		if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
		if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);
		nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
		ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
		if (o.xMapper)		nx = o.xMapper(y)
		else if (o.yMapper)	ny = o.yMapper(x)
		Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
		Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
		Drag.obj.lastMouseX	= ex;
		Drag.obj.lastMouseY	= ey;
		Drag.obj.root.onDrag(nx, ny);
		return false;
	},
	end : function(){
		document.onmousemove = null;
		document.onmouseup   = null;
		Drag.obj.root.onDragEnd(	parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), 
									parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
		Drag.obj = null;
	},

	fixE : function(e){
		if (typeof e == 'undefined') e = window.event;
		if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
		if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
		return e;
	}
}


-->