String.prototype.trim = function(){
	return this.replace( /(^\s*)|(\s*$)/g, '' );
}

// fade-in or fade-out common scripts
hexinput=255;			// Initial color value.
hexinput2=0;			// Initial color value.
var inc=-1;				// Increment variable
var iflag=0;
var jumpflag=0;

function fadingtext(){	         	
	if(hexinput>0 && iflag==0) {
		hexinput-=3;	// increase color value
		document.getElementById('fader').style.color="rgb("+hexinput+","+hexinput+","+hexinput+")"; // Set color value.
		setTimeout("fadingtext()",50);
		if(hexinput<1){ iflag=1; }
	}else if(iflag==1){
		hexinput+=3;
		document.getElementById('fader').style.color="rgb("+hexinput+","+hexinput+","+hexinput+")"; // Set color value.	}
		setTimeout("fadingtext()",50);
		if(hexinput>255){ iflag=2; }
	}else if(iflag==2){
		iflag=0;
		changetext();
	}
}

function fadingtextstop(){	  
	if(hexinput>0) {
		hexinput-=3;	// increase color value
		document.getElementById('fader').style.color="rgb("+hexinput+","+hexinput+","+hexinput+")";
		setTimeout("fadingtextstop()",50);
	}
}
// end of fade-in or fade-out common scripts

// image mouseover swap
function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// end of mouseover image swap

// print window
function printwindow(URL, WIDTH, HEIGHT) {
	windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT + ",resizable=yes" + ",scrollbars=yes";
	preview = window.open(URL, "preview", windowprops);
}

// print window
function printwindow(URL, WIDTH, HEIGHT) {
	windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT + ",resizable=yes" + ",scrollbars=yes";
	preview = window.open(URL, "preview", windowprops);
}

// from metaArticles
function GetCatType(value){
	 document.location=value;
}

function goTo(Url){
	document.location=Url;
}

// News scrolling
// Scrollers width here (in pixels)
var scrollerwidth="100%";
// Scrollers height here
var scrollerheight="100px";
// Scrollers speed here (larger is faster 1-10)
var scrollerspeed=1;
var pauseit=100;

// Change nothing below!
scrollerspeed=(document.all)? scrollerspeed : Math.max(1, scrollerspeed-1); //slow speed down by 1 for NS
var copyspeed=scrollerspeed;
var iedom=document.all||document.getElementById;
var actualheight='';
var cross_scroller, ns_scroller;
var pausespeed=(pauseit===0)? copyspeed: 0;

function populate(){
	if (iedom){
		cross_scroller=document.getElementById? document.getElementById("iescroller") : document.all.iescroller;
		cross_scroller.style.top=parseInt(scrollerheight,10)+8+"px";
		cross_scroller.innerHTML=scrollercontent;
		actualheight=cross_scroller.offsetHeight;
	}
	else if (document.layers){
		ns_scroller=document.ns_scroller.document.ns_scroller2;
		ns_scroller.top=parseInt(scrollerheight,10)+8;
		ns_scroller.document.write(scrollercontent);
		ns_scroller.document.close();
		actualheight=ns_scroller.document.height;
	}
	lefttime=setInterval("scrollscroller()",150);
}
//	window.onload=populate;		// transferred to onLoad in the body tag

function scrollscroller(){
	if (iedom){
		if (parseInt(cross_scroller.style.top,10)>(actualheight*(-1)+8)){
			cross_scroller.style.top=parseInt(cross_scroller.style.top,10)-copyspeed+"px";
		}else{
			cross_scroller.style.top=parseInt(scrollerheight,10)+8+"px";
		}
	}
	else if (document.layers){
		if (ns_scroller.top>(actualheight*(-1)+8)){
			ns_scroller.top-=copyspeed;
		}else{
			ns_scroller.top=parseInt(scrollerheight,10)+8;
		}
	}
}
// Recent History Info Pop-up
function hide_recent_prodinfo(){
	document.getElementById("recent_prodinfo").style.padding='0px';
	document.getElementById("recent_prodinfo").style.borderWidth='0px';
	document.getElementById("recent_prodinfo").style.width='0px';
	document.getElementById("recent_prodinfo").innerHTML='';
}
function show_recent_prodinfo(event,txt){
	document.getElementById("recent_prodinfo").align='center';
	document.getElementById("recent_prodinfo").style.borderWidth='1px';
	document.getElementById("recent_prodinfo").style.borderStyle='solid';
	document.getElementById("recent_prodinfo").style.borderColor='#004080';
	document.getElementById("recent_prodinfo").style.padding='5px';
	document.getElementById("recent_prodinfo").style.left='806px';
	document.getElementById("recent_prodinfo").style.top='185px';
	document.getElementById("recent_prodinfo").style.width='182px';
	document.getElementById("recent_prodinfo").innerHTML=txt;
}
// End of Recent History Info Pop-up

// Similar Product Info Pop-up
function hide_similar_prodinfo(){
	document.getElementById("similar_prodinfo").style.padding='0px';
	document.getElementById("similar_prodinfo").style.borderWidth='0px';
	document.getElementById("similar_prodinfo").style.width='0px';
	document.getElementById("similar_prodinfo").innerHTML='';
}
function show_similar_prodinfo(event,txt){
	document.getElementById("similar_prodinfo").align='center';
	document.getElementById("similar_prodinfo").style.borderWidth='1px';
	document.getElementById("similar_prodinfo").style.borderStyle='solid';
	document.getElementById("similar_prodinfo").style.borderColor='#004080';
	document.getElementById("similar_prodinfo").style.padding='5px';
	document.getElementById("similar_prodinfo").style.left='806px';
	document.getElementById("similar_prodinfo").style.top='280px';
	document.getElementById("similar_prodinfo").style.width='182px';
	document.getElementById("similar_prodinfo").innerHTML=txt;
}
//Similar Product Info Pop-up
