//script ver new site 1.0function locatelink(tolink){	location = tolink}function SearchOnWords() {//	var doc=document.forms['headerwordsearch'];	var doc=document.forms['headersearch'];	var tmpSearch = doc.wordtosearch.value;	if(tmpSearch == "" )  {		//location='/kemet/web/homepage/kechome.nsf/vabypagename/searchins';		//alert('Please enter a word or term to search');		doc.wordtosearch.focus();	} else {		tmpSearch = trim(tmpSearch)		//alert('searching on words ' + tmpSearch );		sitesearch(tmpSearch)	}}function trim(inputstringTrim) {   fixedTrim = "";   lastCh = " ";   for (x=0; x < inputstringTrim.length; x++) {      ch = inputstringTrim.charAt(x);      if ((ch != " ") || (lastCh != " ")) {         fixedTrim += ch;       }      lastCh = ch;   }   if (fixedTrim.charAt(fixedTrim.length - 1) == " ") {      fixedTrim = fixedTrim.substring(0, fixedTrim.length - 1);   }   return fixedTrim;}function sitesearch(searchfield) {	location=sWebDbName+ 'vaWebSearchView?SearchView&Query=' + escape(searchfield) +                     '&SearchOrder=1&SearchMax=20&SearchWV=FALSE&SearchThesaurus=TRUE';}function checksearch(searchfield) {   tmpSearch = trim(searchfield.value)   if(checkinvalid(searchfield)) {        sitesearch(searchfield.value);   } else {        location=sWebDbName+ 'weben/searchinvalid';   }    return false;}function fcs(obj,val,nVal){if(obj.value==val){obj.value=nVal;}}function locatelink(tolink){	location = tolink}function checkinvalid(searchfield) {   tmpSearch = searchfield.value;   var regExpOK = /\Wfield\W|\Wtopic\W|\Wtermweight\W|\Wexactcase\W|\Wcontains\W|\Wsentence\W|\Wparagraph\W/i;   var regExp1 = /\bfield\b|\btopic\b|\btermweight\b|\bexactcase\b|\bcontains\b|\bsentence\b|\bparagraph\b/i;   var regExp2 =  /[{}#%&=\<\>\[\]]/; // invalid values   var regExpNeedQt = /[()]/;  // need quotes   var regExpTestQt = /^"\b/;  // test for quote at the beginning   if(typeof regExp1.source != 'undefined' ) { // check to make sure regexp work     if (regExpOK.test(tmpSearch)) {        // skip words if quotes around them     } else if (regExp1.test(tmpSearch) || regExp2.test(tmpSearch)) {        return false;     }     if (regExpTestQt.test(tmpSearch)) {        // continue, quote found at the beginning     } else if (regExpNeedQt.test(tmpSearch)) {       searchfield.value = '"' + tmpSearch + '"';     }   }   return true; // return true if not already exited at this point   }function checkKEsearch() {	defaultloc = '/kemet/web/homepage/kfbk3.nsf/vaFeedbackFAQ?OpenView&Start=1&Count=10&t=KEHomeTechSearch';	family = document.forms['kewordform'].prodfam	kewords = document.forms['kewordform'].kewords	for (i=0; i < family.length; ++i) {		if (family.options[i].selected) {			ProdSelText = family.options[i].text;			break;		}	}	kesearch = trim(kewords.value)	if(kesearch == "Keyword(s)")  {		location=defaultloc;		return false;	}	if (ProdSelText == 'All Products' & kesearch == "") {		location=defaultloc;		return false;	}	if (kesearch != "" & !checkinvalid(kewords)) {		location='/kemet/web/homepage/kechome.nsf/vabypagename/searchinvalid';		return false;	}	qString1 = "";	qString2 = "";	if (ProdSelText != 'All Products') {		qString1 = '(FIELD+feedbackProduct+contains+' + ProdSelText + ')';	}	if (kesearch != "") {		qString2 = kesearch;	}	if (qString1 != "" & qString2 != "") {		qString = qString1 + "+AND+" + qString2	} else if (qString2 == "") {		qString = qString1	} else {		qString = qString2;	}	var re = / /g	qString = qString.replace(re,"+");	location='/kemet/web/homepage/kfbk3.nsf/vaFeedbackFAQ?Searchview&Query=' + qString +  '&Start=1&Count=10&SearchOrder=1&SearchThesaurus=TRUE&t=KEHomeTechSearch';	return false;}function openHelpWindow(url, theWidth, theHeight, putMenu) {	myHelp = window.open(url,"helpWin",'toolbar=0,location=0,directories=0,status=0,menubar=' + putMenu + ',scrollbars=1,resizable=0,width=' + theWidth + ',height=' + theHeight + ',screenX=0,screenY=0')}function getItem(id) { // IE5+, Mozilla, NS5 if (document.getElementById)   return document.getElementById(id);// IE4if (document.all)   return document.all.item(id);// NS4   return eval("document."+ id + ".document." + id);}function replaceSubstring(sourceList,fromList,toList) {    for (var i=0; i<sourceList.length; i++) {         if (sourceList.substring(i,i+fromList.length) == fromList) {         sourceList = sourceList.substring(0,i)+toList+sourceList.substring(i+fromList.length,sourceList.length)        }     }     return sourceList}