		
		var tempContent = "";
		
		var loadedContent = 1;
		
		var currTimeout = "";
		
		var currLib	= "";
		
		var playerHeight = 0;
		
		var commentsOn = 0;
		
		var popupOpen = 0;
		
		var currLeftNav = 1;
		
		var rotatePos = 0;
		var rotateDivNum = 0;
		var rotateTimeout = 0;
		
		var currNav = '';
		
		var opacityTimeoutVar = new Array();
		
		opacityTimeoutVar[0] = '';
		opacityTimeoutVar[1] = '';
		opacityTimeoutVar[2] = '';
		opacityTimeoutVar[3] = '';
		opacityTimeoutVar[4] = '';
		
		var currDiv = "";
		var currAnchor = "";
		var currFunction = "";
		var secondaryFunction = "";
		var ajaxTimeout = 0;
		
		var divCount = 2;
		var currDiv = 0;
		var openDiv = 0;
		
		var currLeftMenu = -1;
		
		var scrollTimeout = 0;
		
		var origLeft = new Array();
		var origTop = new Array();
		var currLeft = new Array();
		var currTop = new Array();
		var limitLeft = new Array();
		var limitTop = new Array();
		var offsetLeft = new Array();
		var offsetTop = new Array();
		
		origLeft[0] = 362;
		origLeft[1] = 587;
		origTop[0] = 100;
		origTop[1] = 190;
		
		currLeft[0] = 362;
		currLeft[1] = 587;
		currTop[0] = 100;
		currTop[1] = 190;
		limitLeft[0] = 317;
		limitLeft[1] = 707;
		limitTop[0] = 10;
		limitTop[1] = 10;
		offsetLeft[0] = 5;
		offsetLeft[1] = 10;
		offsetTop[0] = 10;
		offsetTop[1] = 15;
		
		var winW = 0;
		var winH = 0;
		
		// Detect if the browser is IE or not.
		// If it is not IE, we assume that the browser is NS.
		var IE = document.all?true:false
		
		// If NS -- that is, !IE -- then set up for mouse capture
		if (!IE) document.captureEvents(Event.MOUSEMOVE)
		
		// Main function to retrieve mouse x-y pos.s
		
		var tempX = 0;
		var tempY = 0;
		
		// Set-up to use getMouseXY function onMouseMove
		document.onmousemove = getMouseXY;
		
		// Temporary variables to hold mouse x-y pos.s
		var tempMouseX = 0
		var tempMouseY = 0
		
		// Main function to retrieve mouse x-y pos.s
		
		//setWindowProps();
		
		function getMouseXY(e) {
		  if (IE) { // grab the x-y pos.s if browser is IE
			tempMouseX = event.clientX + document.body.scrollLeft
			tempMouseY = event.clientY + document.body.scrollTop
		  } else {  // grab the x-y pos.s if browser is NS
			tempMouseX = e.pageX
			tempMouseY = e.pageY
		  }  
		  // catch possible negative values in NS4
		  if (tempMouseX < 0){tempMouseX = 0}
		  if (tempMouseY < 0){tempMouseY = 0}  
		  // show the position values in the form named Show
		  // in the text fields named MouseX and MouseY
		  
		  if (currFunction != '') {
			
			eval(currFunction);
			
		  }
		  
		  return true
		}
		
		function check_email(email) {
			
			ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
			
			for(i=0; i < email.length ;i++){
				if(ok.indexOf(email.charAt(i))<0){ 
					return (false);
				}	
			}
			
			re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
			re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
			if (!email.match(re) && email.match(re_two)) {
				return (-1);		
			} 
			
		
		}
		
		function getScrollOffset() {
		
			setWindowProps();
		
			tempX = 0;
			tempY = 0;
			
			if (IE) { // grab the x-y pos.s if browser is IE
				tempX = document.body.scrollLeft;
				tempY = document.body.scrollTop;
			} else {
				tempX = window.pageXOffset;
				tempY = window.pageYOffset;
			}
			
			// catch possible negative values in NS4
			if (tempX < 0){tempX = 0}
			if (tempY < 0){tempY = 0}
			
			//alert(tempX + " " + tempY); 
		
		}

		function setWindowProps() {
			
			if (parseInt(navigator.appVersion)>3) {
				if (navigator.appName=="Netscape") {
					winW = window.innerWidth;
					winH = window.innerHeight;
				}
				if (navigator.appName.indexOf("Microsoft")!=-1) {
					winW = (document.body.offsetWidth-21);
					winH = (document.body.offsetHeight-4);
				}
			}
			
		}
		
		function setOpacity(divName,value) {
			document.getElementById(divName).style.opacity = value/10;
			document.getElementById(divName).style.filter = 'alpha(opacity=' + value*10 + ')';
		}
		
		function displayOpacity(divName,value,counter) {
			
			if (value == 10) {
				setOpacity(divName,value);
				clearTimeout(opacityTimeoutVar[counter]);
			} else {
				setOpacity(divName,value);
				opacityTimeoutVar[counter] = window.setTimeout("displayOpacity('"+divName+"',"+(value+1)+","+counter+")",50);
			}
			
		}
		
		function init() {
			
		
			if (document.getElementById('currLib')) {
				currLib	= document.getElementById('currLib').value;
			}
			
			//setWindowProps();
			if (document.getElementById('rotate')) {
				rotateTimeout = window.setTimeout('rotateDiv()',3000);	
			}
			
		}
		
		function setVisit() {
		
			currIp = document.getElementById('CurrIp').value;
			currMember = document.getElementById('CurrMem').value;
			currSession = document.getElementById('CurrSession').value;
		
			currHref = document.location.href;
			
			questionLocation = currHref.indexOf('?');
			
			variables = '';
			currPage = currHref;
			
			if (questionLocation != -1) {
				variables = currHref.split('?');
				currPage = variables[0];
				variables = variables[1].split('&');
			}
			
			//alert("functions.php?PageView=1&currPage="+currPage+"&variables="+variables+"&currMember="+currMember+"&currIp="+currIp+"&currSession="+currSession);
			
			currDiv = 'test';
			sendAjax("functions.php?PageView=1&currPage="+currPage+"&variables="+variables+"&currMember="+currMember+"&currIp="+currIp+"&currSession="+currSession,processAjax);
			
		}
				
		function IsNumeric(sText) {
		
			var ValidChars = "0123456789.,";
			var IsNumber=true;
			var Char;
		 
			for (i = 0; i < sText.length && IsNumber == true; i++) { 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) {
					IsNumber = false;
				}
			}
			
			return IsNumber;
		   
		}

		function nothing() {}
	
		function ajaxFunction(divName,evalFunc,evalString) {
			
			//alert("ajaxFunction=1&evalFunc="+evalFunc+"&evalString="+evalString);
			
			currDiv = divName;
			//alert("functions.php?setActiveStatus=1&TableName="+TableName+"&FieldName="+FieldName+"&ItemId="+ItemId+"&Status="+Status);
			sendAjax("functions.php?ajaxFunction=1&evalFunc="+evalFunc+"&evalString="+evalString,processAjax);
		
		}
		
		function sendAjax(urlContent,returnFunc) {
		
			if (currLib != '') {
				urlContent	+= "&LibName="+currLib;
			}
			
			createRequest();			
			
			request.open("GET", root_link + "/includes/scripts/" + urlContent, true);
			request.onreadystatechange = eval(returnFunc);
			request.send(null);
			/*
			window.clearTimeout(ajaxTimeout);
			ajaxTimeout = window.setTimeout("request.send(null)",500);
			*/
			
		}
		
		function processAjax() {
		
			if(request.readyState == 4) {
				
				if(request.status == 200) {
				
					//alert(trim(request.responseText));
				
					if((document.getElementById(currDiv)) && (trim(request.responseText) != '')) {
						//alert(document.getElementById('hoverMain').innerHTML);
						document.getElementById(currDiv).innerHTML = trim(request.responseText);
						document.getElementById(currDiv).style.visibility = "visible";
						//setOpacity(currDiv,9.7);
						/*
						clearTimeout(opacityTimeoutVar);
						displayOpacity(currDiv,1);
						*/
						//document.getElementById(currDiv).style.visibility = "visible";
						
						if (secondaryFunction != '') {
							eval(secondaryFunction);
							secondaryFunction = '';
						}
						
						if (currAnchor != '') {
							document.location.href = currAnchor;
							currAnchor = '';
						}
						
						tempContent = '';
						loadedContent = 1;
						
						/*
						if (waitFunction != '') {
							eval(waitFunction);	
						}
						*/
						
					}
					
				}
				
			}
		
		}
		
		function pageScroll() {
			getScrollOffset();
			if ((tempY+winH) < 570) {
				window.scrollBy(0,10); // horizontal and vertical scroll increments
				scrolldelay = setTimeout("pageScroll()",20); // scrolls every 100 milliseconds
			}
		}
		
		function trim(stringToTrim) {
			return stringToTrim.replace(/^\s+|\s+$/g,"");
		}
		
		function check_errors(formName,Lang) {
			
			var submitOk = 1;
			var errorContent = 'Please fill out all fields marked by an (*)';
			
			if (formName == 'QuoteForm') {
			
				var FullName = document.QuoteForm.FullName.value;
				var Company = document.QuoteForm.Company.value;
				var Telephone = document.QuoteForm.Telephone.value;
				var Email = document.QuoteForm.Email.value;
				var Comments = document.QuoteForm.Comments.value;
				
				if (FullName == '') {
					submitOk = 0;
				}
				
				if (Telephone == '') {
					submitOk = 0;
				}
				
				if ((Email == '')) {
					submitOk = 0;
				} else if (!check_email(Email)) {
					submitOk = 0;
				}
				
			}
			
			if (formName == 'ContactForm') {
			
				var FullName = document.ContactForm.FullName.value;
				var Company = document.ContactForm.Company.value;
				var Telephone = document.ContactForm.Telephone.value;
				var Email = document.ContactForm.Email.value;
				var Comments = document.ContactForm.Comments.value;
				
				if (FullName == '') {
					submitOk = 0;
				}
				
				if (Telephone == '') {
					submitOk = 0;
				}
				
				if ((Email == '')) {
					submitOk = 0;
				} else if (!check_email(Email)) {
					submitOk = 0;
				}
				
				if (Comments == '') {
					submitOk = 0;
				}
				
			}
			
			if (formName == 'SubscribeForm') {
				
				errorContent = '<div style="padding:10px 0px 0px 0px; font-weight:bold; font-style:italic; color:#D3450B">Please enter a valid email address</div>';
			
				var Email = document.SubscribeForm.Email.value;
				
				if ((Email == '')) {
					submitOk = 0;
				} else if (!check_email(Email)) {
					submitOk = 0;
				}
				
			}
			
			if (submitOk == 1) {
				eval('document.'+formName).submit();	
			} else {
				
				document.getElementById('errorMessage').innerHTML = errorContent;
				
			}
		
		}
		
		
	function defaultField(fieldValue,fieldObject,fieldState) {
		
		//var fieldObject = eval('document.'+fieldForm+'.'+fieldName);
		//fieldForm,fieldName
		
		if ((fieldState == 0) && (fieldObject.value == fieldValue)) {
			fieldObject.value = '';	
		} else if ((fieldState == 1) && (fieldObject.value == '')) {
			fieldObject.value = fieldValue;	
		}
	
	}
	
	function fieldType(fieldType,fieldObject) {
		
	}
	
	function shiftLeftMenu(divNum) {
		
		var divName = 'menuLeft'+divNum;
		
		if (currLeftMenu != divNum) {
			
			if (currLeftMenu != -1) {
				document.getElementById('menuLeft'+currLeftMenu+'On').style.zIndex = 0;
				document.getElementById('menuLeft'+currLeftMenu+'Off').style.zIndex = 1;
				document.getElementById('menuLeft'+currLeftMenu+'Off').style.left = "30px";
				document.getElementById('menuLeft'+currLeftMenu+'On').style.left = "0px";
				document.getElementById('menuLeft'+currLeftMenu+'On').style.visibility = "hidden";
				document.getElementById('menuLeft'+currLeftMenu+'Off').style.visibility = "visible";
				moveLeft('menuLeft'+currLeftMenu+'Off',30,0,-5);
				if (document.getElementById('rightContent'+divNum)) {
					document.getElementById('rightContent'+currLeftMenu).style.visibility = "hidden";
					moveLeft('rightContent'+currLeftMenu,0,-620,-103);
				}
			}
			
			currLeftMenu = divNum;
			document.getElementById(divName+'Off').style.visibility = "hidden";
			document.getElementById(divName+'On').style.visibility = "visible";
			document.getElementById(divName+'Off').style.zIndex = 0;
			document.getElementById(divName+'On').style.zIndex = 1;
			moveLeft(divName+'On',0,30,5);
			
			if (document.getElementById('rightContent'+divNum)) {
				document.getElementById('rightContent'+divNum).style.visibility = "visible";
				moveLeft('rightContent'+divNum,-620,0,103);
			}
			
		}
		
	}
	
	function moveLeft(divName,startPos,endPos,offset) {
		
		if (((offset < 0) && (startPos < endPos)) || ((offset > 0) && (startPos > endPos))) {
			document.getElementById(divName).style.left = endPos+"px";
		} else {
			document.getElementById(divName).style.left = startPos+"px";
			window.setTimeout('moveLeft("'+divName+'",'+(startPos+offset)+','+endPos+','+offset+')',50);
		}
	
	}
	
	function setPopup(Width,Height) {
	
		getScrollOffset();
		
		leftOffset	= Math.floor((winW-Width)/2)+tempX;
		topOffset	= Math.floor((winH-Height)/2)+tempY;
		
		if (IE) {
			Width += 18;
		}
		
		document.getElementById('popupShadow').style.left = leftOffset + "px";
		document.getElementById('popupShadow').style.top = topOffset + "px";
		document.getElementById('popupShadow').style.width = Width + "px";
		document.getElementById('popupShadow').style.height = Height + "px";
		
		document.getElementById('popupContent').style.left = (leftOffset+10) + "px";
		document.getElementById('popupContent').style.top = (topOffset+10) + "px";
		document.getElementById('popupContent').style.width = (Width-20) + "px";
		document.getElementById('popupContent').style.height = (Height-20) + "px";
		
		document.getElementById('popupShadow').style.visibility = "visible";
		document.getElementById('popupContent').style.visibility = "visible";
		
		popupOpen = 1;
	
	}
	
	function closePopup() {
		
		document.getElementById('popupShadow').style.left = "0px";
		document.getElementById('popupShadow').style.top = "0px";
		document.getElementById('popupShadow').style.width = "0px";
		document.getElementById('popupShadow').style.height = "0px";
		
		document.getElementById('popupContent').style.left = "0px";
		document.getElementById('popupContent').style.top = "0px";
		document.getElementById('popupContent').style.width = "0px";
		document.getElementById('popupContent').style.height = "0px";
		
		document.getElementById('popupShadow').style.visibility = "hidden";
		document.getElementById('popupContent').style.visibility = "hidden";
		
		document.getElementById('popupContentInside').innerHTML = '';
		
		document.body.style.overflow = "auto";
		
		popupOpen = 0;
		
	}
	
	function displayNewsItem(ItemId) {
		
		//document.body.style.overflow = "hidden";
	
		getScrollOffset();
		
		Width = 600;
		Height = 400;
			
		setPopup(Width,Height);
	
	}
	
	function featureLoader(divName,folder,imageName,counter) {
		
		//alert(divName+counter+" url('"+root_link+"/images/features/"+folder+"/"+imageName+(counter+1)+".jpg')");
		setOpacity(divName+counter,0);
		document.getElementById(divName+counter).innerHTML = '<img src="'+root_link+'/images/features/'+folder+'/'+imageName+(counter+1)+'.jpg"><br>';
		displayOpacity(divName+counter,0,counter);
		
		//document.getElementById(divName+counter).style.backgroudImage = "url('"+root_link+"/images/features/"+folder+"/"+imageName+(counter+1)+".jpg')";
		//alert(document.getElementById(divName+counter).style.backgroudImage);
		if (counter < 4) {
			window.setTimeout("featureLoader('"+divName+"','"+folder+"','"+imageName+"',"+(counter+1)+")",200)	;
		}
		
	}
	
	function moveMenu(loaded) {
		
		if (document.getElementById('topNav')) {
			
			getScrollOffset();
			
			document.getElementById('topNav').style.top = (tempY)+'px';
				
		}
	
	}
	
	function leftNavItem(ItemId,counter,setLink) {
		
		getScrollOffset();
			
		if (setLink == 1) {
			//document.location = '#'+WebsiteId;
		
			var tempElem = document.getElementById('bodyContent').scrollTop;
			var limit = document.getElementById(ItemId).offsetTop;
			
			limit -= 160;	
			
			var tempLimit = document.getElementById('bodyContent').scrollHeight;
			
			//alert(limit + ' '+ (tempLimit-winH));
			
			if (IE) {
				limit += 170;	
			}
			
			if (limit > (tempLimit-winH)) {
				limit = (tempLimit-winH);	
			}
			
			if (tempElem < limit) {
			scrollSmooth(limit,1,15);
			} else {
			scrollSmooth(limit,0,15);
			}
			//window.scrollTo(0,document.getElementById(WebsiteId).offsetTop)
			//window.scrollTo(0);
			//.offset().top
		}
	
		document.getElementById("leftNavLink"+currLeftNav).className = "leftNav";
		currLeftNav = counter;
		document.getElementById("leftNavLink"+currLeftNav).className = "leftNavOn";
	
	}
	
	function scrollSmooth(limit,direction,increment) {
		
		//getScrollOffset();
		
		clearTimeout(scrollTimeout);
		
		increment++;
		
		var tempElem = document.getElementById('bodyContent').scrollTop;
		
		if ((direction == 1) && ((tempElem+increment) < limit)) {
			document.getElementById('bodyContent').scrollTop = (tempElem+increment);
			scrollTimeout = window.setTimeout("scrollSmooth("+limit+","+direction+","+increment+")",5);
		} else if ((direction == 0) && ((tempElem-increment) > limit)) {
			document.getElementById('bodyContent').scrollTop = (tempElem-increment);
			scrollTimeout = window.setTimeout("scrollSmooth("+limit+","+direction+","+increment+")",5);
		} else {
			document.getElementById('bodyContent').scrollTop = (limit);
		}
		
	}
	
	function dispNav(divName) {
		
		if (document.getElementById(divName)) {
			
			clearTimeout(currTimeout);
			
			if (currNav != '') {
				hideNav(currNav);
			}
			
			currNav = divName;
			document.getElementById(divName).style.visibility = "visible";
		
		}
		
	}
	
	function hideNavTimer(divName) {
		
		if (document.getElementById(divName)) {
			currTimeout = window.setTimeout('hideNav(\''+divName+'\')',200);
		}
		
	}
	
	function hideNav(divName) {
		document.getElementById(divName).style.visibility = "hidden";
	}
	
	function rotateDiv() {
	
		var rotateCount = document.getElementById('rotateCount').value;
		moveUp('rotate',rotatePos,rotatePos-85,-5);
		ajaxFunction('rotate'+rotateDivNum,'rightProductSet',rotateCount+','+rotateDivNum);
		rotateDivNum++;
		
	}
	
	function moveUp(divName,startPos,endPos,offset) {
		
		if (((offset < 0) && (startPos < endPos)) || ((offset > 0) && (startPos > endPos))) {
			document.getElementById(divName).style.top = (endPos)+"px";
			rotatePos = endPos;
			rotateTimeout = window.setTimeout('rotateDiv()',3000);
		} else {
			document.getElementById(divName).style.top = (startPos)+"px";
			rotateTimeout = window.setTimeout('moveUp("'+divName+'",'+(startPos+offset)+','+endPos+','+offset+')',50);
		}
	
	}
	
	function setCustomItem(CustomName) {
	
		document.QuoteFormSec.CustomItem.value = CustomName;
		window.setTimeout('document.QuoteFormSec.submit()',500);
		
	}
	
	function quoteModel(ItemName) {
		
		var ItemNum = 0;
		
		var start = document.getElementById('headerCount').value;
		
		for (i = 0; (document.QuoteForm.ModelNumber[i]); i++) {
			//alert(document.QuoteForm.ModelNumber[i].value+' '+ItemName);
			if (document.QuoteForm.ModelNumber[i].value == ItemName) {
				ItemNum = (i+(start-1));
			}
		}
		
		//alert(ItemNum);
		
		var CategoryId = document.ProdModelForm.CategoryId.value*1;
		
		if (CategoryId == 3) {
			
			document.getElementById('HPItem').style.background = "none";
			document.getElementById('HPItem').style.border = "none";
			document.getElementById('AmpsItem').style.background = "none";
			document.getElementById('AmpsItem').style.border = "none";
			
			if (ItemNum < start) {
				
				for (i = 0; (document.QuoteForm.suffix15[i]); i++) {
					document.QuoteForm.suffix15[i].selected=false;
				}
				
				for (i = 0; (document.suffix14.Input[i]); i++) {
					document.QuoteForm.suffix14[i].selected=false;
				}
				
			} else {
			
				document.getElementById('HPItem').style.visibility="hidden";
				document.getElementById('AmpsItem').style.visibility="hidden";
				
				var kVA = eval('document.ProdModelForm.listing'+ItemNum+'_1').value;
				var Input = eval('document.ProdModelForm.listing'+ItemNum+'_2').value;
				
				//alert(kVA);
				
				for (i = 0; (document.QuoteForm.suffix15[i]); i++) {
					if (document.QuoteForm.suffix15[i].value == kVA) {
						document.QuoteForm.suffix15[i].selected=true;
					} else {
						document.QuoteForm.suffix15[i].selected=false;
					}
				}
				
				for (i = 0; (document.QuoteForm.suffix14[i]); i++) {
					if (document.QuoteForm.suffix14[i].value == Input) {
						document.QuoteForm.suffix14[i].selected=true;
					} else {
						document.QuoteForm.suffix14[i].selected=false;
					}
				}
				
				window.setTimeout("document.getElementById('HPItem').style.visibility=\"visible\"",400);
				window.setTimeout("document.getElementById('AmpsItem').style.visibility=\"visible\"",400);
				
				document.getElementById('HPItem').style.backgroundColor = "#E8C135";
				document.getElementById('HPItem').style.border = "solid 1px #CCC";
				document.getElementById('AmpsItem').style.backgroundColor = "#E8C135";
				document.getElementById('AmpsItem').style.border = "solid 1px #CCC";
			
			}
			
		} else {
		
			document.getElementById('kVAItem').style.background = "none";
			document.getElementById('kVAItem').style.border = "none";
			document.getElementById('InputItem').style.background = "none";
			document.getElementById('InputItem').style.border = "none";
			document.getElementById('OutputItem').style.background = "none";
			document.getElementById('OutputItem').style.border = "none";
			
			if (ItemNum < start) {
				
				for (i = 0; (document.QuoteForm.kVA[i]); i++) {
					document.QuoteForm.kVA[i].selected=false;
				}
				
				for (i = 0; (document.QuoteForm.Input[i]); i++) {
					document.QuoteForm.Input[i].selected=false;
				}
				
				for (i = 0; (document.QuoteForm.Output[i]); i++) {
					document.QuoteForm.Output[i].selected=false;
				}
				
			} else {
			
				document.getElementById('kVAItem').style.visibility="hidden";
				document.getElementById('InputItem').style.visibility="hidden";
				document.getElementById('OutputItem').style.visibility="hidden";
				
				var kVA = eval('document.ProdModelForm.listing'+ItemNum+'_1').value;
				var Input = eval('document.ProdModelForm.listing'+ItemNum+'_2').value;
				var Output = eval('document.ProdModelForm.listing'+ItemNum+'_3').value;
				
				//alert(kVA);
				
				for (i = 0; (document.QuoteForm.kVA[i]); i++) {
					if (document.QuoteForm.kVA[i].value == kVA) {
						document.QuoteForm.kVA[i].selected=true;
					} else {
						document.QuoteForm.kVA[i].selected=false;
					}
				}
				
				for (i = 0; (document.QuoteForm.Input[i]); i++) {
					if (document.QuoteForm.Input[i].value == Input) {
						document.QuoteForm.Input[i].selected=true;
					} else {
						document.QuoteForm.Input[i].selected=false;
					}
				}
				
				for (i = 0; (document.QuoteForm.Output[i]); i++) {
					if (document.QuoteForm.Output[i].value == Output) {
						document.QuoteForm.Output[i].selected=true;
					} else {
						document.QuoteForm.Output[i].selected=false;
					}
				}
				
				window.setTimeout("document.getElementById('kVAItem').style.visibility=\"visible\"",400);
				window.setTimeout("document.getElementById('InputItem').style.visibility=\"visible\"",400);
				window.setTimeout("document.getElementById('OutputItem').style.visibility=\"visible\"",400);
				
				document.getElementById('kVAItem').style.backgroundColor = "#E8C135";
				document.getElementById('kVAItem').style.border = "solid 1px #CCC";
				document.getElementById('InputItem').style.backgroundColor = "#E8C135";
				document.getElementById('InputItem').style.border = "solid 1px #CCC";
				document.getElementById('OutputItem').style.backgroundColor = "#E8C135";
				document.getElementById('OutputItem').style.border = "solid 1px #CCC";
			
			}
			
		}
			
	}
	
	function quoteModelSet(ItemNum) {
		
		var CategoryId = document.ProdModelForm.CategoryId.value*1;
		
		var ModelNumber = eval('document.ProdModelForm.listing'+ItemNum+'_0').value;
		var kVA = eval('document.ProdModelForm.listing'+ItemNum+'_1').value;
		var Input = eval('document.ProdModelForm.listing'+ItemNum+'_2').value;
		var Output = eval('document.ProdModelForm.listing'+ItemNum+'_3').value;
		
		document.getElementById('modelItem').style.visibility="hidden";
		
		if (CategoryId == 3) {
			
			for (i = 0; (document.QuoteForm.suffix15[i]); i++) {
				if (document.QuoteForm.suffix15[i].value == kVA) {
					document.QuoteForm.suffix15[i].selected=true;
				} else {
					document.QuoteForm.suffix15[i].selected=false;
				}
			}
			
			for (i = 0; (document.QuoteForm.suffix14[i]); i++) {
				if (document.QuoteForm.suffix14[i].value == Input) {
					document.QuoteForm.suffix14[i].selected=true;
				} else {
					document.QuoteForm.suffix14[i].selected=false;
				}
			}
		
			document.getElementById('HPItem').style.visibility="hidden";
			document.getElementById('AmpsItem').style.visibility="hidden";
			
		} else {
			
			document.getElementById('kVAItem').style.visibility="hidden";
			document.getElementById('InputItem').style.visibility="hidden";
			document.getElementById('OutputItem').style.visibility="hidden";
			
			for (i = 0; (document.QuoteForm.kVA[i]); i++) {
				if (document.QuoteForm.kVA[i].value == kVA) {
					document.QuoteForm.kVA[i].selected=true;
				} else {
					document.QuoteForm.kVA[i].selected=false;
				}
			}
			
			for (i = 0; (document.QuoteForm.Input[i]); i++) {
				if (document.QuoteForm.Input[i].value == Input) {
					document.QuoteForm.Input[i].selected=true;
				} else {
					document.QuoteForm.Input[i].selected=false;
				}
			}
			
			for (i = 0; (document.QuoteForm.Output[i]); i++) {
				if (document.QuoteForm.Output[i].value == Output) {
					document.QuoteForm.Output[i].selected=true;
				} else {
					document.QuoteForm.Output[i].selected=false;
				}
			}
		}
		
		document.getElementById('modelItem').style.background = "none";
		document.getElementById('modelItem').style.border = "none";
		
		popupClose();
		
		for (i = 0; (document.QuoteForm.ModelNumber[i]); i++) {
			if (document.QuoteForm.ModelNumber[i].value == ModelNumber) {
				document.QuoteForm.ModelNumber[i].selected=true;
				document.getElementById('modelItem').style.backgroundColor = "#E8C135";
				document.getElementById('modelItem').style.border = "solid 1px #CCC";
			} else {
				document.QuoteForm.ModelNumber[i].selected=false;
			}
		}
		
		window.setTimeout("document.getElementById('modelItem').style.visibility=\"visible\"",400);
		if (CategoryId == 3) {
			window.setTimeout("document.getElementById('AmpsItem').style.visibility=\"visible\"",400);
			window.setTimeout("document.getElementById('HPItem').style.visibility=\"visible\"",400);
		} else {
			window.setTimeout("document.getElementById('kVAItem').style.visibility=\"visible\"",400);
			window.setTimeout("document.getElementById('InputItem').style.visibility=\"visible\"",400);
			window.setTimeout("document.getElementById('OutputItem').style.visibility=\"visible\"",400);
		}
		
	}
	
	function quoteModelFind() {
		
		var kVA = document.QuoteForm.kVA.value.replace('.','_');
		var Input = document.QuoteForm.Input.value;
		var Output = document.QuoteForm.Output.value.replace('/','_');
		
		if ((kVA != 0) && (Input != 0) && (Output != 0)) {
		
			document.getElementById('modelItem').style.visibility="hidden";
		
			var fieldName = 'document.ProdModelForm.listing_combo_'+kVA+'_'+Input+'_'+Output;
			fieldName = (fieldName.replace(' ',''));
			fieldName = eval(fieldName);
			
			document.getElementById('modelItem').style.background = "none";
			document.getElementById('modelItem').style.border = "none";
				
			for (var i = 0; (document.QuoteForm.ModelNumber[i]); i++) {
				document.QuoteForm.ModelNumber[i].selected=false;
			}
			
			//alert(fieldName.item(0));
			if (fieldName.length) {
				//alert(fieldName.item(0));
				fieldName = fieldName.item(0);
			}
			
			//alert(fieldName);
			
			if (fieldName) {
				
				var fieldValue = fieldName.value;
				
				for (i = 0; (document.QuoteForm.ModelNumber[i]); i++) {
				
					if (document.QuoteForm.ModelNumber[i].value == fieldValue) {
						document.getElementById('modelItem').style.backgroundColor = "#E8C135";
						document.getElementById('modelItem').style.border = "solid 1px #CCC";
						document.QuoteForm.ModelNumber[i].selected=true;
					} else {
						document.QuoteForm.ModelNumber[i].selected=false;
					}
				}
				
			}
			
		}
		
		window.setTimeout("document.getElementById('modelItem').style.visibility=\"visible\"",400);
		
	}
	
	function setModel(num) {
		
		var Input = eval('document.addCart'+num).InputPrefix.value;
		var Output = eval('document.addCart'+num).OutputPrefix.value;
		var kVA = eval('document.addCart'+num).kVA.value;
		var Prefix = eval('document.addCart'+num).Prefix.value;
		//var Prefix = (eval('document.addCart'+num).Prefix.value != 0) ? eval('document.addCart'+num).Prefix.value : 'MT';
		
		var ModelName = Prefix+' '+kVA+Input+Output;
		
		if (eval('document.addCart'+num).Suffix) {
			var Suffix = (eval('document.addCart'+num).Suffix.value != 0) ? eval('document.addCart'+num).Suffix.value : '';
			ModelName += Suffix;
		}
		
		document.getElementById('CustomModel'+num).innerHTML = ModelName;
		eval('document.addCart'+num).ModelNumber.value = ModelName;
		eval('document.addCart'+num).CustomItem.value = ModelName;
		
	}
	
	function setSearchFields(CategoryId) {
		
		ajaxFunction('searchFields','searchFields',CategoryId);
		
	}
