///**********************************************************************
// filename: config/header.js
// created: 2007-02-23
// lastmod: 2007-04-13
// author:  AWA
// email:  aames@centralsemi.com
// dependencies:  none
// summary:  Javascript included in all pages 
///**********************************************************************
// JavaScript Document

// Build DIV Select on Change
<!--
function divChange(selObj){ //v3.0
	eval("parent.location=parent.location.pathname+'?div="+selObj.options[selObj.selectedIndex].value+"&type=catg'");
}

// Build CLASS Select on Change
function clsChange(selObj){ //v3.0
	eval("parent.location=parent.location.pathname+'?div="+document.getElementById("div").value+"&class="+selObj.options[selObj.selectedIndex].value+"&type=catg'");
}

// Build SUBCLASS Select on Change
function subChange(selObj){ //v3.0
	eval("parent.location=parent.location.pathname+'?div="+document.getElementById("div").value+"&class="+document.getElementById("class").value+"&subclass="+selObj.options[selObj.selectedIndex].value+"&type=catg'");
}

// Build Select on Change for Marketing Literature
function mdivChange(selObj){ //v3.0
	eval("parent.location=parent.location.pathname+'?mdiv="+selObj.options[selObj.selectedIndex].value+"&type=mcatg'");
}

// Build CLASS Select on Change for Marketing Literature
function mclsChange(selObj){ //v3.0
	eval("parent.location=parent.location.pathname+'?mdiv="+document.getElementById("mdiv").value+"&mclass="+selObj.options[selObj.selectedIndex].value+"&type=mcatg'");
}

// Build SUBCLASS Select on Change for Marketing Literature
function msubChange(selObj){ //v3.0
	eval("parent.location=parent.location.pathname+'?div="+document.getElementById("mdiv").value+"&mclass="+document.getElementById("mclass").value+"&subclass="+selObj.options[selObj.selectedIndex].value+"&type=mcatg'");
}

// Build STATE Select on Change to Country (CTRY)
function stateChange(selObj){ //v3.0
	eval("parent.location=parent.location.pathname+'?op="+document.getElementById("op").value+"&action="+document.getElementById("action").value+"&ctry="+document.getElementById("ctry").value+"'");
}

// Provide Redirection to the search page

function redirTimer() {
	redirTime = "4000";
	redirURL = "/search/";
	self.setTimeout("self.location.href = redirURL;",redirTime);
}

// Provide confirmation of Empty Cart action
// Nannette Thacker http://www.shiningstar.net
function confirmSubmitCart()
{
var agree=confirm("This will empty all items in your cart. Are you sure you wish to empty your cart?");
if (agree)
	return true ;
else
	return false ;
}

// Macromedia Jumpmenu Option - Select box that submits a form...
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Periodic Table Display (used on /misc/periodic.php)
// -- This script and many more are available free online at -->
// -- The JavaScript Source!! http://javascript.internet.com -->
function display_element(Name, Number, Weight, Melt, Freeze) {
	document.tableperstats.name.value=Name;
	document.tableperstats.number.value=Number;
	document.tableperstats.weight.value=Weight;
	document.tableperstats.melt.value=Melt;
	document.tableperstats.freeze.value=Freeze;
}

// Provides pop-up window with focus
function popwin(popurl, popname, popheight, popwidth, popstatbar, popscroll, popresize, poptoolbar, popmenubar, poplocation, poptitlebar, poptop, popleft) {
	var newwindow;
	var style;
	style = "height="+popheight+",width="+popwidth+",status="+popstatbar+",scrollbars="+popscroll+",toolbars="+poptoolbar+",menubar="+popmenubar+",location="+poplocation+",titlebar="+poptitlebar+",top="+poptop+",left="+popleft+"";
	newwindow=window.open(popurl, 'popname', style);
	newwindow.focus();
}
// popresize,  (func)
// resizeable="+popresize+",   (style)


// Provides pop-up window with focus
function popwin2(popurl, popname, popheight, popwidth, popfocus) {
	var newwindow;
	var style;
	style = "height="+popheight+",width="+popwidth+"";
// popstatbar, popscroll, popresize, poptoolbar, popmenubar, poplocation, poptitlebar, poptop, popleft, popfocus	//,status="+popstatbar+",scrollbars="+popscroll+",toolbars="+poptoolbar+",menubar="+popmenubar+",location="+poplocation+",titlebar="+poptitlebar+",top="+poptop+",left="+popleft+"";
	newwindow=window.open(popurl, 'popname', style);
	
	if (popfocus) {
		newwindow.focus();
	}
}

// Provides pop-up window with focus and a single parameter including all variables desired.
function popwin3(popurl, popname, popparms, popfocus) {
	var newwindow;
	var style;
	style = popparms;
	newwindow=window.open(popurl, popname, style);
	if (popfocus) {
		newwindow.focus();
	}
}

// -->


