//*****************************
// main javascript functions
//*****************************

if (!document.getElementById)
{
	alert("Sorry you need to upgrade your browser to use this website");
}

var subFlag=0;
var persistenceVars = window.name.split("|");

var sessionID = persistenceVars[0];
var sessionBC = persistenceVars[1];

if (sessionID == '')
{
	var UID = getCookie ('UID');

	if (UID == '')
	{
	  var timeVar = new Date();
	  timeVar = timeVar.getTime();

		var sessionID = (Math.floor((Math.random()*10000000)+1));	// generate unique ID
		var sessionID = sessionID + timeVar;

		var sessionBC = '';

	  var now = new Date();
	  fixDate(now);
	  now.setTime(now.getTime() + 30 * 24 * 60 * 60 * 1000);
		setCookie('UID', sessionID, now, '', '', '');
	}
	else
	{
		sessionID = UID;
	}


}

var sessionCart = '<form name=cart method=post action="checkout_cart.cgi"><input type=hidden name=ID value="' + sessionID + '"></form>';
var sessionHTML = '<input type=hidden name=ID value="' + sessionID + '">';



function breadcrumb(rootDir, homeKW, KWL, PKWU, PKWD)
{
	var position = -1;	// set this flag to show that the ctageory is not in the breadcrumb yet
	var tempStr='';

	if(!sessionBC)
	{
		sessionBC = '<a href="' + rootDir + '">HOME</a> ~ <a class="crumb" href="main/' + PKWU + '.html"> ' + PKWD + '</a> ~ ';
	}

	if (PKWU == homeKW)	// if you are ont he home page then reset the trail and just show home
	{
	  document.getElementById('TREEcontainer').style.display='none';
		sessionBC = '<a href="' + rootDir + '" title="Go to the ' + PKWD + ' Home Page">HOME</a> ~ ';
	  document.getElementById('TREEcrumbs').innerHTML=sessionBC;
	}
	else if (KWL <= 2 && PKWU != 'cart' && PKWU != 'Search Results')		// if you are not on home page or the cart page and it is a top menu option then reset the trail
	{
		sessionBC = '<a href="' + rootDir + '">HOME</a> ~ <a class="crumb" href="main/' + PKWU + '.html"> ' + PKWD + '</a> ~ ';
	  document.getElementById('TREEcrumbs').innerHTML=sessionBC;
	}
	else if (PKWU != 'cart' && PKWU != 'Search Results')
	{
		tempStr = sessionBC;
		position = tempStr.indexOf('<a class="crumb" href="main/' + PKWU + '.html">');

		if (position == -1)		// if the string is not already in the TREEcrumbs just add it to the end
		{
	 		sessionBC+= '<a class="crumb" href="main/' + PKWU + '.html">' + PKWD + '</a> ~ ';
		  document.getElementById('TREEcrumbs').innerHTML=sessionBC;
		}
		else	// if the string is in the TREEcrumbs already then remove it and everything after it
		{
			sessionBC=tempStr.substring(0,position);
	 		sessionBC+= '<a class="crumb" href="main/' + PKWU + '.html">' + PKWD + '</a> ~ ';
		  document.getElementById('TREEcrumbs').innerHTML=sessionBC;
		}
	}
	else	// this just saves the current crumbs whilst you are in the cart and checkout pages
	{
	  document.getElementById('TREEcrumbs').innerHTML=sessionBC;
	}


	window.name = sessionID + "|" + sessionBC;

}






function checkout()
{
	document.cart.action="checkout_data.cgi";
	document.cart.submit();
}


function previousPage(script)
{
	document.checkout.action=script;
	document.checkout.submit();
}

function backToCart()
{
	document.checkout.action='checkout_cart.cgi';
	document.checkout.submit();
}


function gotoTop()
{
	window.scrollBy(0,-15000); // horizontal and vertical scroll increments
}


function addToCart(script,IMS_Part_Num,product_name, price, handle)
{
  var element1_id = 'QTY_' + IMS_Part_Num;
  var QTY = document.getElementById(element1_id).value;

	//  make sure nobody tries to do somethign silly like order half a product...hey you never know !

	if (QTY < 1)
	{
		alert('You must specify at least one product to add it to the cart');
		exit;
	}
	else if (QTY.indexOf('.')!=-1)
	{
		alert('You cannot buy fractions of a product');
		exit;
	}
	else
	{
		handle.style.backgroundPosition='left -81px';
//		handle.src='images/added.gif';
//		handle.disabled=true;
	}

	// extrac the session ID from client stoarge

	var session = window.name.split("|");
	var ID = session[0];

	// calculate the total

	var total1 = (QTY * price);
	var total2 = total1.toFixed(2);

	//  iterate recursively throgh totals in order to format output string for thousands, millions and hundreds respectively

	var pattern=/^(\d+)(\d\d\d)(\d\d\d)\.(\d\d)/;
	var tst = pattern.test(total2);
	if (tst==true)	// its in the millions
	{
		var total = total2.replace(pattern, "$1,$2,$3.$4");
	}
	else
	{
		var pattern=/^(\d+)(\d\d\d)\.(\d\d)/;
		var tst = pattern.test(total2);
		if (tst==true)	// its in the thousands
		{
			var total = total2.replace(pattern, "$1,$2.$3");
		}
		else		// its just hundreds
		{
			var total = total2;
		}
	}

	//  format the url for asyncronous AJAX submit

	url = script + '/' + ID + '/' + IMS_Part_Num + '/' + QTY + '/' + product_name + '/' + price + '/';
//  document.write(url); // just used for diagnostics

  if (window.XMLHttpRequest)	//     // branch for native XMLHttpRequest object
  {
      req = new XMLHttpRequest();
      req.onreadystatechange = processCartResponse;
      req.open("POST", url, true);
      req.send(null);

  }
  else if (window.ActiveXObject)	// branch for IE/Windows ActiveX version
  {
      req = new ActiveXObject("Microsoft.XMLHTTP");
      if (req)
      {
          req.onreadystatechange = processCartResponse;
          req.open("POST", url, true);
          req.send();
      }
  }

}


function processCartResponse()
{

  if (req.readyState == 4)
  {
      if (req.status != 200)	// only if error
      {
  			alert('Error: ' + req.status + ' could not add this product to the cart...please try again');
//  			alert(req.responseText);
      }
  }
}



function changeQTY()
{
	document.cart.changedQTY.value='Y';
	document.cart.submit();
}



function changeZIP()
{
	document.cart.changedZIP.value='Y';
	document.cart.submit();
}



function removeItem(thisItem)
{
	document.cart.changedQTY.value='Y';
  document.cart[thisItem].value='0';
	document.cart.submit();
}



function myVoid()
{
	return;
}


function clearIt(thing)
{
	if (thing.value=='enter search text')
	{
		thing.value=''
	}
}

function showIt(ID)
{
	state=document.getElementById(ID).style.visibility="visible";
}

function hideIt(ID)
{
	state=document.getElementById(ID).style.visibility="hidden";
}


function validateForm()
{

	var fv01=document.checkout.billing_contact_name.value;
	var fv02=document.checkout.billing_address1.value;
	var fv03=document.checkout.billing_city.value;
	var fv04=document.checkout.billing_state.value;
	var fv05=document.checkout.billing_country.value;
	var fv06=document.checkout.billing_zip.value;
	var fv07=document.checkout.billing_email.value;
	var fv08=document.checkout.billing_phone.value;

	var fv09=document.checkout.shipping_contact_name.value;
	var fv10=document.checkout.shipping_address1.value;
	var fv11=document.checkout.shipping_city.value;
	var fv12=document.checkout.shipping_state.value;
	var fv13=document.checkout.shipping_country.value;
	var fv15=document.checkout.shipping_email.value;
	var fv16=document.checkout.shipping_phone.value;

	var strErrorMsg='';
	var strErrorMsg1='';
	var strErrorMsg2='';
	var strErrorMsg3='';

	if (document.checkout.payment_type.value=='credit')
	{
		strErrorMsg3 = checkCC('');
	}


//***************************
//	shipping validation
//***************************


	if (fv16=='')
	{
		strErrorMsg1=' - Phone\n' + strErrorMsg1;
	  document.getElementById('SP').style.border='solid 2px red';
	  document.checkout.shipping_phone.focus();
	}
	else
	{
		var filter=/\d*/;
		document.checkout.shipping_phone.value =  stripa(document.checkout.shipping_phone.value);
	  if ((!filter.test(document.checkout.shipping_phone.value)))
	  {
			strErrorMsg1=' - Phone [ Only numbers are allowed. ] \n' + strErrorMsg1;
		  change = document.getElementById('SP').style.border='solid 2px red';
		  document.checkout.shipping_phone.focus();
		}
  	else
		{
		  change = document.getElementById('SP').style.border='solid 1px';
		}
	}


	if (fv15==0)
	{
		strErrorMsg1=' - Email\n' + strErrorMsg1;
	  change = document.getElementById('SE').style.border='solid 2px red';
	  document.checkout.shipping_email.focus();
	}
	else
	{
		var filter=/^.+@.+\..{2,3}$/
		document.checkout.shipping_email.value =  stripa(document.checkout.shipping_email.value);
	  if ((!filter.test(document.checkout.shipping_email.value)))
	  {
		  change = document.getElementById('SE').style.border='solid 2px red';
		  document.checkout.shipping_email.focus();
	    alert(" - Email [ invalid: must be in format x@x.xxx or x@x.x.x ]");
	    return (false);
	  }
  	else
		{
		  change = document.getElementById('SE').style.border='solid 1px';
		}

	}

	if (fv13=='')
	{
		strErrorMsg1=' - Country\n' + strErrorMsg1;
	  change = document.getElementById('SC').style.border='solid 2px red';
	  document.checkout.shipping_country.focus();
	}
	else
	{
	  change = document.getElementById('SC').style.border='solid 1px';
	}

	if (fv12=='')
	{
		strErrorMsg1=' - State\n' + strErrorMsg1;
	  change = document.getElementById('SS').style.border='solid 2px red';
	  document.checkout.shipping_state.focus();
	}
	else
	{
	  change = document.getElementById('SS').style.border='solid 1px';
	}

	if (fv11=='')
	{
		strErrorMsg1=' - City\n' + strErrorMsg1;
	  change = document.getElementById('SCS').style.border='solid 2px red';
	  document.checkout.shipping_city.focus();
	}
	else
	{
	  change = document.getElementById('SCS').style.border='solid 1px';
	}

	if (fv10=='')
	{
		strErrorMsg1=' - Shipping Address\n' + strErrorMsg1;
	  change = document.getElementById('SAL1').style.border='solid 2px red';
	  document.checkout.shipping_address1.focus();
	}
	else
	{
	  change = document.getElementById('SAL1').style.border='solid 1px';
	}

	if (fv09=='')
	{
		strErrorMsg1=' - Contact Name\n' + strErrorMsg1;
	  change = document.getElementById('SCN').style.border='solid 2px red';
	  document.checkout.shipping_contact_name.focus();
	}
	else
	{
	  change = document.getElementById('SCN').style.border='solid 1px';
	}


//***********************************
//	billing validation
//***********************************


	if (fv08=='')
	{
		strErrorMsg2=' - Phone\n' + strErrorMsg2;
	  document.getElementById('BP').style.border='solid 2px red';
	  document.checkout.BP.focus();
	}
	else
	{
		var filter=/\d*/;
		document.checkout.billing_phone.value =  stripa(document.checkout.billing_phone.value);
	  if ((!filter.test(document.checkout.billing_phone.value)))
	  {
			strErrorMsg2=' - Phone [ Only numbers are allowed. ] \n' + strErrorMsg2;
		  change = document.getElementById('BP').style.border='solid 2px red';
		  document.checkout.BP.focus();
		}
  	else
		{
		  change = document.getElementById('BP').style.border='solid 1px';
		}
	}


	if (fv07==0)
	{
		strErrorMsg2=' - Email\n' + strErrorMsg2;
	  change = document.getElementById('BE').style.border='solid 2px red';
	  document.checkout.BE.focus();
	}
	else
	{
		var filter=/^.+@.+\..{2,3}$/
		document.checkout.billing_email.value =  stripa(document.checkout.billing_email.value);
	  if ((!filter.test(document.checkout.billing_email.value)))
	  {
		  change = document.getElementById('BE').style.border='solid 2px red';
		  document.checkout.BE.focus();
	    alert(" - Email [ invalid: must be in format x@x.xxx or x@x.x.x ]");
	    return (false);
	  }
  	else
		{
		  change = document.getElementById('BE').style.border='solid 1px';
		}

	}

	if (fv06=='')
	{
		strErrorMsg2=' - ZIP/Postcode\n' + strErrorMsg2;
	  change = document.getElementById('BZ').style.border='solid 2px red';
	  document.checkout.BZ.focus();
	}
	else
	{
	  change = document.getElementById('BZ').style.border='solid 1px';
	}

	if (fv04=='')
	{
		strErrorMsg2=' - State\n' + strErrorMsg2;
	  change = document.getElementById('BS').style.border='solid 2px red';
	  document.checkout.BS.focus();
	}
	else
	{
	  change = document.getElementById('BS').style.border='solid 1px';
	}

	if (fv03=='')
	{
		strErrorMsg2=' - City\n' + strErrorMsg2;
	  change = document.getElementById('BCS').style.border='solid 2px red';
	  document.checkout.BCS.focus();
	}
	else
	{
	  change = document.getElementById('BCS').style.border='solid 1px';
	}

	if (fv02=='')
	{
		strErrorMsg2=' - Billing Address\n' + strErrorMsg2;
	  change = document.getElementById('BAL1').style.border='solid 2px red';
	  document.checkout.BAL1.focus();
	}
	else
	{
	  change = document.getElementById('BAL1').style.border='solid 1px';
	}

	if (fv01=='')
	{
		strErrorMsg2=' - Contact Name\n' + strErrorMsg2;
	  change = document.getElementById('BCN').style.border='solid 2px red';
	  document.checkout.billing_contact_name.focus();
	}
	else
	{
	  change = document.getElementById('BCN').style.border='solid 1px';
	}


//********************************
//	submit the form
//********************************


	if (strErrorMsg1!='' || strErrorMsg2!='' || strErrorMsg3!='')
	{
		if (strErrorMsg1!='')
		{
			strErrorMsg1 ='\n\nYOU MUST ENTER SHIPPING DETAILS FOR:\n\n' + strErrorMsg1;
		}

		if (strErrorMsg2!='')
		{
			strErrorMsg2 ='YOU MUST ENTER BILLING DETAILS FOR:\n\n' + strErrorMsg2;
		}

		if (strErrorMsg3!='')
		{
			strErrorMsg3 ='\n\nYOU MUST ENTER CREDIT CARD DETAILS FOR:\n\n' + strErrorMsg3;
		}

		strErrorMsg =  strErrorMsg2 + strErrorMsg1 + strErrorMsg3 + '\n\n *** Missing data or errors appear in red ***\n\n';
		alert (strErrorMsg);
	}
	else
	{
		document.forms.checkout.submit()
	}


}

function stripa(aString)
{
  var newString = "";
  for (i=0; i<aString.length; i++)
  {
    if (aString.charAt(i) != ' ')
    {
      newString=newString+aString.charAt(i);
    }
  }
  return(newString);
}



function checkCC(strErrorMsg3)
{
	var fv101=document.checkout.cc_name.value;
	var fv102=document.checkout.cc_number.value;
	var fv103=document.checkout.cnp_security.value;

	if (fv103=='')
	{
		strErrorMsg3=' - Security Code\n' + strErrorMsg3;
	  change = document.getElementById('CNP_SECURITY').style.border='solid 2px red';
	  document.checkout.cnp_security.focus();
	}

	if (fv102=='')
	{
		strErrorMsg3=' - Card Number\n' + strErrorMsg3;
	  change = document.getElementById('CCNUMBER').style.border='solid 2px red';
	  document.checkout.cc_number.focus();
	}
	else
	{
		for (i=0; i<fv102.length; i++)
		{
		  if (!parseInt(fv102.charAt(i), 10))
		  {
		  	if (fv102.charAt(i) != '0')
		  	{
					strErrorMsg3=' - Card Number [ ' + fv102.charAt(i) + ' is  not a number. ] \n' + strErrorMsg3;
				  change = document.getElementById('CCNUMBER').style.border='solid 2px red';
				  document.checkout.cc_number.focus();
				  break;
		  	}
		  }
		}
	}


	if (fv101=='')
	{
		strErrorMsg3=' - Name on Card\n' + strErrorMsg3;
	  change = document.getElementById('CCNAME').style.border='solid 2px red';
	  document.checkout.cc_name.focus();
	}

	return strErrorMsg3;

}



//# Make sure form is only sunmitted once and submit it

function placeOrder()
{
//  deleteCookie('UID', '', '');

	subFlag++;

  if(subFlag > 1)
  {
		Error = alert("This form has already been submitted. Please wait...");
		return false;
  }
  else
  {
		document.forms.checkout.submit()
  }
}

function populateShipping()
{
	checkbox = document.forms["checkout"]["same"].checked;

	thisForm = document.forms.checkout;

	if (checkbox)
	{
		thisForm.shipping_company_name.value					= thisForm.billing_company_name.value;
		thisForm.shipping_address1.value							= thisForm.billing_address1.value;
		thisForm.shipping_address2.value							= thisForm.billing_address2.value;
		thisForm.shipping_state.value									= thisForm.billing_state.value;
		thisForm.shipping_city.value									= thisForm.billing_city.value;
		thisForm.shipping_country.value								= thisForm.billing_country.value;
		thisForm.shipping_zip.value										= thisForm.billing_zip.value;
		thisForm.shipping_contact_name.value					= thisForm.billing_contact_name.value;
		thisForm.shipping_email.value									= thisForm.billing_email.value;
		thisForm.shipping_phone.value									= thisForm.billing_phone.value;
		thisForm.shipping_alternate_phone.value				= thisForm.billing_alternate_phone.value;
	}
	else
	{
		thisForm.shipping_company_name.value					= '';
		thisForm.shipping_address1.value							= '';
		thisForm.shipping_address2.value							= '';
		thisForm.shipping_state.value									= '';
		thisForm.shipping_city.value									= '';
		thisForm.shipping_contact_name.value					= '';
		thisForm.shipping_email.value									= '';
		thisForm.shipping_phone.value									= '';
		thisForm.shipping_alternate_phone.value				= '';
	}

}


function payment(choice)
{

	thisForm = document.forms.checkout;

	thisForm.payment_type.value 			= choice;
	billing_country										=  thisForm.billing_country.value;
	shipping_country									= thisForm.shipping_country.value;
	if (choice == 'credit')
	{
		state=document.getElementById('creditcard').style.visibility="visible";
		state=document.getElementById('adjustIt').style.marginTop="50px";
	}
	else
	{
		state=document.getElementById('creditcard').style.visibility="hidden";
		state=document.getElementById('adjustIt').style.marginTop="-200px";
	}
}


function openpopup(scriptName, number, w, h)
{
	x=(screen.availWidth-w)/2;
	y=(screen.availHeight-h)/2;
//	window.name='fixmeup';
	win2 = window.open(scriptName,number,'height='+h+',width='+w+',screenX='+x+',left='+x+',screenY='+y+',top='+y+',location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no');
	win2.focus();
}

function openpopup2(scriptName, number, w, h)
{
	x=(screen.availWidth-w)/2;
	y=(screen.availHeight-h)/2;
//	window.name='fixmeup';
	win2 = window.open(scriptName, number,'height='+h+',width='+w+',screenX='+x+',left='+x+',screenY='+y+',top='+y+',location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no');
	win2.parent.opener = this;
	win2.focus();
}

function showPropod(w,h)
{

	x=(screen.availWidth-w)/2;
	y=(screen.availHeight-h)/2;
	propod = window.open(' http://69.50.242.24/propod/Another-CSS-Fix/index.php','IMSproPod','height='+h+',width='+w+',screenX='+x+',left='+x+',screenY='+y+',top='+y+',location=no,menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no,dependent=yes');
}


function hidePropod()
{
	win2.close();
}



var HOST = 'imsproav.com';

// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie(name, value, expires, path, domain, secure)
{
    var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
    document.cookie = curCookie;
}

function getCookie (name)
{
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain)
{
    document.cookie = "UID=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}

function printIt()
{
	  document.getElementById('invoiceFooter').style.display='none';
	  print();
}

function reprintIt()
{
	  document.getElementById('invoiceFooter').style.display='block';
}


function searchSite(action)
{
	searchString = document.search.searchString.value;

	if (searchString != '' && searchString != 'enter search text')
	{
		url =  'main/search_' + searchString;
	}
	else
	{
		alert('You have not entered anything to search for');
    return (false);
	}

	if (action == 'enter')
	{
		document.search.action=url;
	}
	else
	{
		document.search.action=url;
		document.search.submit();
	}

}



function searchAdv()
{

	// get all the values from the form and construct the URL for them, so the seacrh values can be extracted in routines.cgi

	searchString = document.advancedSearch.searchAdvTxt.value;

	if (searchString == 'enter search text')
	{
		searchString = '';
		document.advancedSearch.searchAdvTxt.value='';
	}

	var rawprice = document.advancedSearch.rawprice.checked;


	if (rawprice)
	{
		rawprice = 'L';
	}
	else
	{
		rawprice = 'H';
	}

	var rtop = document.getElementById("rawtop");
	var rawtop = rtop.options[rtop.selectedIndex].value;

	var rcat = document.getElementById("rawcat");
	var rawcat = rcat.options[rcat.selectedIndex].value;

	var rman = document.getElementById("rawman");
	var rawman = rman.options[rman.selectedIndex].value;

	url =  'main/search_' + rawtop + '_' + rawman + '_' + rawcat + '_' + rawprice + '_' + searchString + '/';

	if ((searchString == '' || searchString == 'enter search text') && rawcat == 'Any' && rawman == 'Any' )
	{
		alert('Your search criteria is too broad...please select a product, brand or enter some text you wish to search for');
    return (false);
	}
	else
	{
		if (document.attach)
		{
			document.advancedSearch.submit();
		}
		else
		{
			document.advancedSearch.action=url;
		}
	}

}




function refreshMenu(menu, category)
{

	//  format the url for asyncronous AJAX submit

	url = 'refresh_manufacturers.cgi/' + menu + '/' + category + '/';

  if (window.XMLHttpRequest)	//     // branch for native XMLHttpRequest object
  {
    req = new XMLHttpRequest();

		if (menu == 'one')
		{
	    req.onreadystatechange = processManufacturerResponseOne;
		}
		else
		{
	    req.onreadystatechange = processManufacturerResponseTwo;
		}
    req.open("GET", url, true);
    req.send(null);

  }
  else if (window.ActiveXObject)	// branch for IE/Windows ActiveX version
  {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    if (req)
    {
			if (menu == 'one')
			{
		    req.onreadystatechange = processManufacturerResponseOne;
			}
			else
			{
		    req.onreadystatechange = processManufacturerResponseTwo;
			}
      req.open("GET", url, true);
      req.send(null);
    }
  }
}


function processManufacturerResponseOne()
{
  if (req.readyState == 4)
  {
    if (req.status != 200)	// only if error
    {
			alert('Error: ' + req.status + ' could not add this product to the cart...please try again');
			alert(req.responseText);
    }
    else
  	{
	    categoryOptions = req.responseText;
//	    alert(categoryOptions);
		  document.getElementById('categories').innerHTML=categoryOptions;
  	}
  }
}


function processManufacturerResponseTwo()
{
  if (req.readyState == 4)
  {
    if (req.status != 200)	// only if error
    {
			alert('Error: ' + req.status + ' could not add this product to the cart...please try again');
			alert(req.responseText);
    }
    else
  	{
	    manufacturerOptions = req.responseText;
//	    alert(manufacturerOptions);
		  document.getElementById('manufacturers').innerHTML=manufacturerOptions;
  	}
  }
}


