function launch(url,w,h){
	t = (screen.height) ? (screen.height-h)/2 : 100;
  	l = (screen.width) ? (screen.width-w)/2 : 100;
	popup = window.open(url,"popup","width="+w+",height="+h+",top="+t+",left="+l+",resizable=yes,scrollbars=no,menubar=no,toolbar=no,status=no,location=no");
	if (window.focus) {
		popup.focus();
	}
}
function swapBg(action){
	if (action == 'over'){
		document.getElementById("navitemProducts").style.backgroundImage="url('/images/tnavtop-products-on.gif')";
	} else{
		document.getElementById("navitemProducts").style.backgroundImage='';
	}
}
sfHover = function() {
	var sfEls = document.getElementById("tnavtop").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// home fading news
function fadeHomeNews() {
	Spry.Effect.DoFade(divs_to_fade[home_news_i], {duration: 950, from: 98, to: 0, toggle:false});
	home_news_i++;
	if (home_news_i == 5) home_news_i = 0;
	Spry.Effect.DoFade(divs_to_fade[home_news_i], {duration: 950, from: 0, to: 98, toggle:false});	
}

// home mouseover
function changeClass(id,id2,id3,outclass,state) {
	var tempElement = document.getElementById(id);
	if (state=='over'){
		document.getElementById(id).style.backgroundImage="url('/images/tnavbottom-background-on.gif')";
		document.getElementById(id2).style.color="#edbf06";
		//document.getElementById(id3).style.borderBottom="#ffcc00 solid 1px";
		}
	else {
		document.getElementById(id).style.background="none";
		document.getElementById(id2).style.color="#666666";
		//document.getElementById(id3).style.color="#333333";
		}
}

// hide show learnmore
function showhideLearnmore(id, linkId, action){
		document.getElementById(id).style.display = 'block';
		Spry.Effect.DoBlind(id, {duration: 800, from: '0%', to: '100%', toggle: true});
		if (document.getElementById(linkId).innerHTML.indexOf('Hide') == -1 ){
			document.getElementById(linkId).innerHTML = 'Hide...';
		} else{
			document.getElementById(linkId).innerHTML = 'More...';
		}		
}
function showhideLearnmore2(id, linkId, action){
		document.getElementById(id).style.display = 'block';
		Spry.Effect.DoBlind(id, {duration: 800, from: '0%', to: '100%', toggle: true});
		document.getElementById(linkId).innerHTML = 'More...';
}
function showhideLearnmore3(id, linkId, action){
		document.getElementById(id).style.display = 'block';
		Spry.Effect.DoBlind(id, {duration: 800, from: '0%', to: '100%', toggle: true});
		if (document.getElementById(linkId).innerHTML.indexOf('ide') == -1 ){
			document.getElementById(linkId).innerHTML = 'Hide...';
		} else{
			document.getElementById(linkId).innerHTML = ' more';
		}
}
function showhideLearnmore4(id, linkId, action){
		document.getElementById(id).style.display = 'block';
		Spry.Effect.DoBlind(id, {duration: 800, from: '0%', to: '100%', toggle: true});
		document.getElementById(linkId).innerHTML = ' more';
}