sfHover = function() {
	var sfEls = document.getElementById("newheader_rollover");//
	if (sfEls!=null)
	{
		sfEls =	sfEls.getElementsByTagName("LI");
	}
	else if (sfEls==null)	
	{
		sfEls = document.getElementById("rollover");
		if (sfEls==null)
		{
			return;
		}
                else
		{
			sfEls =	sfEls.getElementsByTagName("LI");
		}
	}
	else 
	{
		return;
	}
	
	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);


function checkReturn(obj,e) {

 if (e.keyCode == 13 || e.which == 13) 
	{
		var form = window.document.forms[0];
		var clicknext = false;
		var nextobj;
		for ( var i=0;i < form.elements.length; i++ )
		{	
			if (form.elements[i]==obj) clicknext=true;
			
			if (clicknext) 
			{
				nextobj=form.elements[i];
				if (nextobj.type.toUpperCase()=="BUTTON" || nextobj.type.toUpperCase()=="SUBMIT") 
				{
					nextobj.click(); 
					break;
				}
			}
		} 
		return false;
	}
return true;
}

//For the First.htm top part

function updateTop(conf, params)
{

	paramArr = params.split('|');
	
	efirst = paramArr[0]
	wfirst = paramArr[1]
	gfirst = paramArr[2]
	allcateg = paramArr[3]

	var frst = document.getElementById("frst_tab")
	var scnd = document.getElementById("scnd_tab")
	/**/var thrd = document.getElementById("thrd_tab")
	var frstnav = document.getElementById("frst_nav")
	var scndnav = document.getElementById("scnd_nav")
	/**/var  thrdnav = document.getElementById("thrd_nav")
	var tempnav = document.getElementById("temp_nav")
	
	if (tempnav != null) { tempnav.style.display = 'none' }
	
/**/	if (conf == "thrd") {
		thrd.innerHTML = '<img class="blue" src="/amsterdam/pict/budgetpro_tab1.gif" width="157" height="20" alt="Digital Budget Pro Wall Calendar" />'
		scnd.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'scnd\',\''+params+'\')"><img class="or" src="/amsterdam/pict/magnet_tab.gif" width="157" height="20" alt="Digital Magent" /></a>'
		frst.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'frst\',\''+params+'\')"><img class="or" src="/amsterdam/pict/mug_tab.gif" width="157" height="20" alt="Devall Pen" /></a>'
		if (thrdnav != null && scndnav != null && frstnav != null) {
			frstnav.style.display = 'none'
			scndnav.style.display = 'none'
			thrdnav.style.display = 'block'
		}
		categ = gfirst
		
	} 
	
	
	if (conf == "scnd") {
		scnd.innerHTML = '<img class="blue" src="/amsterdam/pict/magnet_tab1.gif" width="157" height="20" alt="Showcase Key Tag" />'
		thrd.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'thrd\',\''+params+'\')"><img class="or" src="/amsterdam/pict/budgetpro_tab.gif" width="157" height="20" alt="Digital Budget Pro Wall Calendar" /></a>'
		frst.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'frst\',\''+params+'\')"><img class="or" src="/amsterdam/pict/mug_tab.gif" width="157" height="20" alt="Devall Pen" /></a>'
		if (scndnav != null && frstnav != null) {
			frstnav.style.display = 'none'
			scndnav.style.display = 'block'
			thrdnav.style.display = 'none'
		}
		categ = wfirst
		
	} 
	
	else if (conf == "frst") {
		frst.innerHTML = '<img class="blue" src="/amsterdam/pict/mug_tab1.gif" width="157" height="20" alt="Devall Pen" />'
		scnd.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'scnd\',\''+params+'\')"><img class="or" src="/amsterdam/pict/magnet_tab.gif" width="157" height="20" alt="Showcase Key Tag" /></a>'
		thrd.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'thrd\',\''+params+'\')"><img class="or" src="/amsterdam/pict/budgetpro_tab.gif" width="157" height="20" alt="Digital Budget Pro Wall Calendar" /></a>'
		if (frstnav != null && scndnav != null) {
			scndnav.style.display = 'none'
			frstnav.style.display = 'block'
			thrdnav.style.display = 'none'
		}
		categ = efirst
		
	}

	updateMid(categ,"",allcateg)

}


function updateTopTimer(confDup, paramDup)
{
	conf = "frst";
	params = "f1|s1|t1|f1,f4,f3,f2,s4,s1,s3,s2";

	if(confDup != null && paramDup != null)
{
	conf = confDup;
	params = paramDup;
}

	paramArr = params.split('|');
	
	efirst = paramArr[0]
	wfirst = paramArr[1]
	gfirst = paramArr[2]
	allcateg = paramArr[3]

	var frst = document.getElementById("frst_tab")
	var scnd = document.getElementById("scnd_tab")
	/**/var thrd = document.getElementById("thrd_tab")
	var frstnav = document.getElementById("frst_nav")
	var scndnav = document.getElementById("scnd_nav")
	/**/var  thrdnav = document.getElementById("thrd_nav")
	var tempnav = document.getElementById("temp_nav")
	
	if (tempnav != null) { tempnav.style.display = 'none' }
	
/**/	if (conf == "thrd") {
		thrd.innerHTML = '<img class="blue" src="/amsterdam/pict/budgetpro_tab1.gif" width="157" height="20" alt="Digital Budget Pro Wall Calendar" />'
		scnd.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'scnd\',\''+params+'\')"><img class="or" src="/amsterdam/pict/magnet_tab.gif" width="157" height="20" alt="Showcase Key Tag" /></a>'
		frst.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'frst\',\''+params+'\')"><img class="or" src="/amsterdam/pict/mug_tab.gif" width="157" height="20" alt="Digital Ceramic Mug" /></a>'
		if (thrdnav != null && scndnav != null && frstnav != null) {
			frstnav.style.display = 'none'
			scndnav.style.display = 'none'
			thrdnav.style.display = 'block'
		}
		categ = gfirst
		setTimeout ( "updateTopTimer('frst','f1|s1|t1|f1,f4,f3,f2,s4,s1,s3,s2')", 5000 );
	} 
	
	
	if (conf == "scnd") {
		scnd.innerHTML = '<img class="blue" src="/amsterdam/pict/magnet_tab1.gif" width="157" height="20" alt="Showcase Key Tag" />'
		thrd.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'thrd\',\''+params+'\')"><img class="or" src="/amsterdam/pict/budgetpro_tab.gif" width="157" height="20" alt="Digital Budget Pro Wall Calendar" /></a>'
		frst.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'frst\',\''+params+'\')"><img class="or" src="/amsterdam/pict/mug_tab.gif" width="157" height="20" alt="Digital Ceramic Mug" /></a>'
		if (scndnav != null && frstnav != null) {
			frstnav.style.display = 'none'
			scndnav.style.display = 'block'
			thrdnav.style.display = 'none'
		}
		categ = wfirst
		setTimeout ( "updateTopTimer('thrd','f1|s1|t1|f1,f4,f3,f2,s4,s1,s3,s2')", 5000 );
		
	} 
	
	else if (conf == "frst") {
		frst.innerHTML = '<img class="blue" src="/amsterdam/pict/mug_tab1.gif" width="157" height="20" alt="Devall Pen" />'
		scnd.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'scnd\',\''+params+'\')"><img class="or" src="/amsterdam/pict/magnet_tab.gif" width="157" height="20" alt="Showcase Key Tag" /></a>'
		thrd.innerHTML = '<a href="javascript:void(0);" onclick="updateTop(\'thrd\',\''+params+'\')"><img class="or" src="/amsterdam/pict/budgetpro_tab.gif" width="157" height="20" alt="Digital Budget Pro Wall Calendar" /></a>'
		if (frstnav != null && scndnav != null) {
			scndnav.style.display = 'none'
			frstnav.style.display = 'block'
			thrdnav.style.display = 'none'
		}
		categ = efirst
		setTimeout ( "updateTopTimer('scnd','f1|s1|t1|f1,f4,f3,f2,s4,s1,s3,s2')", 5000 );
		
	}

	updateMid(categ,"",allcateg)

}

function updateMid(categ, text, allcateg)
{
	
	var activeLinks = getElementsByClassName("active",'li')
	if (activeLinks != null) {
		for (i = 0; i < activeLinks.length; i++) {
			activeLinks[i].innerHTML = '<a href="javascript:void(0);" onClick="updateMid(\''+activeLinks[i].id.substring(2)+'\',\''+activeLinks[i].innerHTML+'\',\''+allcateg+'\');">'+activeLinks[i].innerHTML+'</a>';
			activeLinks[i].className = "inactive";
		}
	}
	
	var activeItem = getElementsByClassName("activeit",'li')
	if (activeItem != null) {
		for (i = 0; i < activeItem.length; i++) {
			activeItem[i].className = "inactive";
		}
	}
	
	ele = document.getElementById('l_'+categ);
	cell = document.getElementById('c_'+categ);
	
	if (ele != null) {
		ele.className = "active";
		cell.className = "activeit";
		ele.style.paddingLeft = '5px'
		ele.style.paddingRight = '5px'
		if (text == "") {
			y = ele.innerHTML.indexOf('>')
			if (y > -1) {
				temp = ele.innerHTML.substr(y+1);
				z = temp.indexOf('<');
				temp = temp.substr(0,z);
				ele.innerHTML = temp;
			}
		} else {
			ele.innerHTML = text;
		}
	}

}







function getElementsByClassName(cl,type) {
	var retnode = new Array();
	var myclass = new RegExp('\\b'+cl+'\\b');
	var elem = document.getElementsByTagName(type);
	for (var i = 0; i < elem.length; i++) {
		var classes = elem[i].className;
		if (myclass.test(classes)) retnode.push(elem[i]);
	}
	return retnode;
}
function acswap(acid)
{
	var acimg = document.getElementById(acid).src;
   	newnameimg = acimg.replace(".jpg","_a.jpg")
	newnameimg = newnameimg.replace(".gif","_a.gif")
	document.getElementById(acid).src = newnameimg;
}
function acback(acidv)
{
	var acimgv = newnameimg;
   	newnameimgv = acimgv.replace("_a.jpg",".jpg")
	newnameimgv = newnameimgv.replace("_a.gif",".gif")
	document.getElementById(acidv).src = newnameimgv;
}