 // Dynamic Iframe loaderfunction loadIframe(theURL) {	document.getElementById("mainContent").src=theURL;} // resizes Iframe according to contentfunction resizeMe(obj){ docHeight = mainContent.document.body.scrollHeight//window.alert("Scroll Height detected at " + docHeight) obj.style.height = docHeight + 'px' parent.document.title = mainContent.document.title }   // resizes Iframe according to contentfunction resizeMeNoTitle(obj){ docHeight = mainContent.document.body.scrollHeight//window.alert("Scroll Height detected at " + docHeight) obj.style.height = docHeight + 'px'//parent.document.title = mainContent.document.title }   // resizes Iframe according to contentfunction resizeProdTabs(obj){ docHeight = prodContent.document.body.scrollHeight obj.style.height = docHeight + 'px' }    // resizes Iframe according to contentfunction resizeHome1(obj){ docHeight = home1.document.body.scrollHeight obj.style.height = docHeight + 'px' }    // resizes Iframe according to contentfunction resizeHome2(obj){ docHeight = home2.document.body.scrollHeight obj.style.height = docHeight + 'px' }    // resizes Iframe according to contentfunction resizeHome3(obj){ docHeight = home3.document.body.scrollHeight obj.style.height = docHeight + 'px' }    // resizes Iframe according to contentfunction resizeHome4(obj){ docHeight = home4.document.body.scrollHeight obj.style.height = docHeight + 'px' }    // resizes Iframe according to contentfunction resizeSearch(obj){ docHeight = searchForm.document.body.scrollHeight obj.style.height = docHeight + 'px' }  // gets the value of a string between = and &function getID(str){	theleft = str.indexOf("=") + 1;	theright = str.indexOf("&");	return(str.substring(theleft, theright));} // gets the value of a string after =function getName(str){	point = str.lastIndexOf("=");	return(str.substring(point+1,str.length));} // gets the value of a string after ATTKEY= and before &NAMEfunction getAttKeyParametric(str){	theleft = str.indexOf("ATTKEY=");	if (theleft == -1) {		return('');	}	else {		theleft = theleft + 7;		theright = str.indexOf("&NAME");		vattkey = str.substring(theleft, theright);		vattkey1 = "&ATTKEY=";		return(vattkey1 + vattkey);	}} // get the value of a string between ID= and either &NAME or &ATTKEYfunction getIDParametric(str){	theleft = str.indexOf("ID=") + 3;	theright1 = str.indexOf("&NAME");	theright2 = str.indexOf("&ATTKEY");	if (theright2 == -1) {		return(str.substring(theleft, theright1));	}	else {		return(str.substring(theleft, theright2));	}} // get the value of a string between ID= and &function getIDFull(str){	theleft = str.indexOf("ID=") + 3;	theright = str.indexOf("&");	return(str.substring(theleft, theright));} // get the value of a string between NAME= and the end of the stringfunction getNameFull(str){	point = str.lastIndexOf("NAME=");	return(str.substring(point+5,str.length));} // Removes the plus symbol and replaces it with a space from a stringfunction stripPlus(str){	filteredValues = "+";     // Characters stripped out	var i;	var returnString = "";	for (i = 0; i < str.length; i++) {  // Search through string and append to unfiltered values to returnString.		var c = str.charAt(i);		if (filteredValues.indexOf(c) == -1) 			{returnString += c;}		else			{returnString += " ";}		}	return(returnString);} // calls the distributor inventory search from the left side of the home page and other pagesfunction distinvSearch() {	var tf = document.form1;	var selPart = tf.part.value;	var URL = 'http://stkcheck.com/evs/Omron/omronheader.asp?mfg=Omron&part=' + selPart;	if (selPart == '' || isOnlySpaces(selPart)) {		window.alert('Please enter a value to search for.');	}	else {		var URLplus = addPlus(URL);		window.open(URLplus, '_blank');		//document.forms[0].submit();	}} // calls the RoHS search from the left side of the home page and other pagesfunction rohsSubmit(){	var tf = document.ROHS;	var selPart = tf.PART.value;		for (i=0;i<document.ROHS.search.length;i++) {	if (document.ROHS.search[i].checked) {		selSearch = document.ROHS.search[i].value;		}	}		if (selPart == '' || isOnlySpaces(selPart)) {		window.alert('Please enter a value to search for.');	}	else {		var dbPath = '/components/web/webfiles.nsf'		var URL = dbPath + '$FILES/rohs_results.html?ID=' + selSearch + '&NAME=' + selPart;		var URLplus = addPlus(URL);		window.open(URLplus, '_top');		//document.forms[0].submit();	}} // replaces a space symbol with a plus (+) symbolfunction addPlus(str){	filteredValues = " ";     // Characters stripped out	var i;	var returnString = "";	for (i = 0; i < str.length; i++) {  // Search through string and append to unfiltered values to returnString.		var c = str.charAt(i);		if (filteredValues.indexOf(c) == -1) 			{returnString += c;}		else			{returnString += "+";}		}	return(returnString);} // checks to see if a string value only consists of blank spacesfunction isOnlySpaces(str){	filteredValues = " ";     // Characters stripped out	var i;	var returnString = "";	for (i = 0; i < str.length; i++) {  // Search through string and append to unfiltered values to returnString.		var c = str.charAt(i);		if (filteredValues.indexOf(c) == -1) 			 return false;		}	  return true;} // submits the site search from the home page or other pages (at top)function searchSubmit(){	var tf = document.SiteSearch;	var selPart = tf.PART.value;		if (selPart == '' || isOnlySpaces(selPart)) {		window.alert('Please enter a value to search for.');	}	else {			var dbPath = '/components/web/webfiles.nsf'		var URL = dbPath + '$FILES/search_results.html?ID=1&NAME=' + selPart;		var URLplus = addPlus(URL);		location.href=URLplus;		//document.forms[0].submit();	}}// disables the enter key when users function disableEnterKey(e){     var key;     if(window.event)          key = window.event.keyCode;     //IE     else          key = e.which;     //firefox     if(key == 13)          return false;     else          return true;}function GetDay(nDay){	var Days = new Array("Sunday","Monday","Tuesday","Wednesday",	                     "Thursday","Friday","Saturday");	return Days[nDay]}function GetMonth(nMonth){	var Months = new Array("January","February","March","April","May","June",	                       "July","August","September","October","November","December");	return Months[nMonth] 	  	 }function DateString(){	var Today = new Date();	var suffix = "th";	switch (Today.getDate())	{		case 1:		case 21:		case 31: 			suffix = "st"; break;		case 2:		case 22:			suffix = "nd"; break;		case 3:		case 23:			suffix = "rd"; break;	};	var strDate = GetDay(Today.getDay()) + " " + Today.getDate();	strDate += suffix + " " + GetMonth(Today.getMonth()) + ", " + Today.getFullYear();	return strDate}// ------------ GENERAL------------ //function getElement(mStrID){	var lObjElement = null;	if (document.all) {		lObjElement = document.all(mStrID);	} else {		lObjElement = document.getElementById(mStrID);	}	return lObjElement;}function loadTabs(){		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';}function loadHome(){		var f = document.getElement('mainContent');		f.contentWindow.location.reload(true);}// ------------ DROPDOWN ------------ //function ClickProductGroupTab(mStrBlockId){	var lObjBlock, lObjTab, i, lStrId, lIntMinusHeight	objTabs = document.getElementById("tabs").getElementsByTagName("TD");	for (i=1;i<=objTabs.length;i++) {	//window.alert(i)		lObjBlock	= getElement('block' + i);		lObjTab	= objTabs[i-1];			if (lObjBlock.className.search("visible") != -1) {			lObjBlock.className 	= lObjBlock.className.replace("visible", "hidden");			removeClassName(lObjTab, 'clicked');			lStrId = i;		}	} 	if (mStrBlockId != lStrId && getElement("block" + mStrBlockId)) {			lObjBlock					= getElement("block" + mStrBlockId);		lObjBlock.className			= lObjBlock.className.replace("hidden", "visible");		addClassName(objTabs[mStrBlockId-1], 'clicked');		}	if (mStrBlockId=='1')	{		document.all['space1'].style.display='inline';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='2')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='inline';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='3')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='inline';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='4')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='inline';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='5')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='inline';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='6')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='inline';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='7')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='inline';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='8')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='inline';		document.all['space9'].style.display='none';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='9')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='inline';		document.all['space10'].style.display='none';	}	if (mStrBlockId=='10')	{		document.all['space1'].style.display='none';		document.all['space2'].style.display='none';		document.all['space3'].style.display='none';		document.all['space4'].style.display='none';		document.all['space5'].style.display='none';		document.all['space6'].style.display='none';		document.all['space7'].style.display='none';		document.all['space8'].style.display='none';		document.all['space9'].style.display='none';		document.all['space10'].style.display='inline';	}	lObjBlock = null;	lObjTab = null;}//classschangesfunction addClassName(el, sClassName) {	var s = el.className;	var p = s.split(" ");	var l = p.length;	for (var i = 0; i < l; i++) {		if (p[i] == sClassName) return;	}	p[p.length] = sClassName;	el.className = p.join(" ");			}function removeClassName(el, sClassName) {	var s = el.className;	var p = s.split(" ");	var np = [];	var l = p.length;	var j = 0;	for (var i = 0; i < l; i++) {		if (p[i] != sClassName) np[j++] = p[i];	}	el.className = np.join(" ");}//tab mouseoversvar ns6=document.getElementById&&!document.allfunction contains_ns6(master, slave) {	while (slave.parentNode) return ((slave = slave.parentNode) == master);}function tabOver(el) {	source=document.all? event.srcElement : el.target;	if (source.tagName=='TABLE'||source.tagName=='TR') return;	while(source.tagName!='TD'&&source.tagName!='HTML') source=ns6? source.parentNode : source.parentElement;	if (source.id!='ignore') addClassName(source, 'tabover');}function tabOut(el) {	if (document.all&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=='ignore')||source.tagName=='TABLE') return;	if (ns6&&(contains_ns6(source, el.relatedTarget)||source.id=='ignore')) return;	if (document.all&&event.toElement!=source||ns6&&el.relatedTarget!=source) removeClassName(source, 'tabover');}function MWAlert() {	window.alert('You are highlighting the MidWest!!');}function findObj(n, d) { //v4.0  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=findObj(n,d.layers[i].document);  if(!x && document.getElementById) x=document.getElementById(n); return x;}function showHideLayers() { //v3.0  var i,p,v,obj,args=showHideLayers.arguments;  for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }    obj.visibility=v; }}function setTextOfLayer(objName,x,newText) { //v3.0  if ((obj=findObj(objName))!=null) with (obj)    if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}    else innerHTML = unescape(newText);}