// JavaScript Document
//Contains functions for de.com homepage and login pages
		swapLogin = function(tab) {
		var chkTab = document.getElementById(tab + 'Tab').className;
		if (chkTab != tab + 'Selected'){
			 document.getElementById(tab + 'Login').style.display = "";
			
			 if (tab == 'el'){
				document.getElementById('plLogin').style.display = "none";
				document.getElementById('elTab').className = "elSelected";
				document.getElementById('plTab').className = "plTab";
				document.educatorLoginForm.username.focus();
			 } else {
				document.getElementById('elLogin').style.display = "none";
				document.getElementById('plTab').className = "plSelected";
				document.getElementById('elTab').className = "elTab";
				document.passcodeForm.txtPasscode1.focus();
			 }
		 }
		 		
		}
		
		
		
		setNextFocus = function(currTxtObj, nextTxtObj)     {  
			if (currTxtObj.value.length == currTxtObj.maxLength)     {  
			  nextTxtObj.focus();	
			}  
		}  		
		
		
		
		

	addInputSubmitEvent = function(form, input) {
	    input.onkeydown = function(e) {
	        e = e || window.event;
	        if (e.keyCode == 13) {
	            form.submit();
	            return false;
	        }
	    };
	}
	

		
	
/*	window.onload = function() {
	    var forms = document.getElementsByTagName('form');
	
	    for (var i=0;i < forms.length;i++) {
	        var inputs = forms[i].getElementsByTagName('input');
	
	        for (var j=0;j < inputs.length;j++)
	            addInputSubmitEvent(forms[i], inputs[j]);
	    }
	};*/
	
	
	
	
	
overAction = function() {
	var overEl = document.getElementById("hot_products");
	var sfEls = overEl.getElementsByTagName("a");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			overEl.className="over_"+this.id;
			document.getElementById("info_"+this.id).className="hotties_hover";
		}
		sfEls[i].onmouseout=function() {
			overEl.className="over";
			document.getElementById("info_"+this.id).className="hotties";
		}		
	}
	
	
	
	var TunderEl = document.getElementById("info_products");
	var Els = TunderEl.getElementsByTagName("div");
	for (var i=0; i<Els.length; i++) {
		//alert(Els[i].id);
		
		var TEl = Els[i].id;
		var ToverEl = (TEl.replace("info_", ""));
		//alert(ToverEl);
		
		Els[i].onmouseover=function() {
			this.className="hotties_hover";
			
			var TEl = this.id;
			var ToverEl = (TEl.replace("info_", ""));
			
			overEl.className="over_"+ToverEl;
		}
		Els[i].onmouseout=function() {
			this.className="hotties";
			var TEl = this.id;
			var ToverEl = (TEl.replace("info_", ""));
			
			overEl.className="over";
		}		
	}

}	


de_popUp = function(file){
	window.open(file,'newWin','width=799,height=425,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No');
}



