		var	newWin;
		var maxScrollH;
		var maxScrollW;
		
		var isTextbook = 9;
		
		function checkScope(frm)
			{
			if (frm.searchScope.value != '' && frm.searchScope.value != 'stateawards')
				{
				if (frm.moreOptions_BTN != null) {frm.moreOptions_BTN.style.visibility='visible';};
				}
			else
				{
				if (frm.moreOptions_BTN != null) 
					{frm.moreOptions_BTN.style.visibility='hidden';
					document.getElementById("coreOptions").innerHTML='<br> ';
					}
				}
				
			if (frm.searchScope.value == 'textbooks' || frm.searchScope.value == 'refbooks')
				{
				if (frm.moreOptions_BTN != null) {document.getElementById("coreOptions").innerHTML='<br>Select <em>MORE OPTIONS</em> to specify Copyright, Subject or Grade values in your search.';};
				}
				
			if (frm.searchScope.value == 'paperbacks' || frm.searchScope.value == 'litguides' || frm.searchScope.value == 'testprep')
				{
				if (frm.moreOptions_BTN != null) {document.getElementById("coreOptions").innerHTML='<br>Select <em>MORE OPTIONS</em> to specify Author in your search.';};
				}
			
			if (frm.searchScope.value == '')
				{
				if (frm.coreOptions != null) {document.getElementById("coreOptions").innerHTML='<br> ';};
				}
				
			//if (frm.searchScope.value == '' || frm.searchScope.value == 'textbooks' || frm.searchScope.value == 'refbooks')
				//{
				//if (frm.sortOrder.length == 4)
					//{
					//frm.sortOrder.options[4]=new Option ("Grade", "Grade");
					//frm.sortOrder.options[5]=new Option ("Subject", "Subject");
					//frm.sortOrder.options[6]=new Option ("Copyright", "Copyright");
					//}
				//}
			//else
				//{
				//frm.sortOrder.length=4;
				//}
			}
			
		function bookDetail(ID,c,bgID,blnBG,pg,sterm,bmark,ListID) 
			{
			if(blnBG) 
				{
				ID = bgID;
				}
			document.SrchResults.goPage.value='/follett_fes_general/bookdetails.cfm?bID=' + ID + '&bc=' + c + '&P=' + pg + '&isbn=' + sterm+ '&L=' + ListID;
			document.SrchResults.doUpd.value='';
			document.SrchResults.submit();
			}	

		function bookDetailVbs(ID,c,bgID,blnBG,pg,bmark,catID) 
			{
			if(blnBG) 
				{
				ID = bgID;
				}
			document.SrchResults.goPage.value='/follett_fes_general/bookdetailsVbs.cfm?bID=' + ID + '&bc=' + c + '&P=' + pg + '&catID=' + catID + '&s=sr #' + bmark;
			document.SrchResults.submit();
			}
			
		function bookDetailDHT(ID,c,bgID,blnBG,pg,bmark,catID) 
			{
			if(blnBG) 
				{
				ID = bgID;
				}
			document.SrchResults.goPage.value='/follett_fes_general/bookdetailsDHT.cfm?bID=' + ID + '&bc=' + c + '&P=' + pg + '&catID=' + catID + '&s=sr #' + bmark;
			document.SrchResults.submit();
			}
			
		function bookDetailSS(ID,c,bgID,blnBG,pg,bmark,catID) 
			{
			if(blnBG) 
				{
				ID = bgID;
				}
			document.SrchResults.goPage.value='/follett_fes_general/bookdetailsSS.cfm?bID=' + ID + '&bc=' + c + '&P=' + pg + '&s=sr #' + bmark;
			document.SrchResults.submit();
			}	

		function resetBookID (frm, bookID, condition, promoID)
			{
			frm.getBook.value=bookID;
			frm.getBookCond.value=condition;
			frm.pr.value=promoID;
			frm.submit();
			}		
			
		function setNextList (frm, promoCode)
			{
			frm.nextAction.value="featurelist";
			frm.selPromo.value=promoCode;
			frm.submit();
			}	
			
		function setStateAwardList (frm, awardList)
			{
			frm.nextAction.value="stateaward";
			frm.selAward.value=awardList;
			frm.submit();		
			}	
			
		function showHelp (func, keyword) 
			{
			window.open('/showWebHelp.cfm?f='+func+'&k='+keyword,'HelpCallout','top=0,left=0,Width=425,Height=300,status=no,scrollbars=yes,resizeable=yes');
			}
		
		function resetCookies()
		{
			var expiration_date = new Date("January 1, 2010");
			expiration_date = expiration_date.toGMTString();
			document.cookie="scrW=0; expires=" + expiration_date + "; path=/;" ;
			document.cookie="scrH=0; expires=" + expiration_date + "; path=/;" ;
			document.cookie="scrScrlW=0; expires=" + expiration_date + "; path=/;" ;
			document.cookie="scrScrlH=0; expires=" + expiration_date + "; path=/;" ;
			document.cookie="docH=0; expires=" + expiration_date + "; path=/;" ;
			document.cookie="docW=0; expires=" + expiration_date + "; path=/;" ;
			maxScrollH=0;
			maxScrollW=0;
		}
		
		function scrSize() 
			{
			var myWidth = 0, myHeight = 0;
			var expiration_date = new Date("January 1, 2010");
			expiration_date = expiration_date.toGMTString();

  			if( typeof( window.innerWidth ) == 'number' ) 
				{
      			//Non-IE
				//alert("Non-IE");
      			myWidth = window.innerWidth;
      			myHeight = window.innerHeight;
				dHeight = document.height;
				dWidth = document.width;	
  				} 
 			else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
 				{
				//alert("IE 6+ in standards compliant mode");
      			//IE 6+ in 'standards compliant mode'
     			myWidth = document.documentElement.clientWidth;
     			myHeight = document.documentElement.clientHeight;
				dHeight = document.body.clientHeight;
				dWidth = document.body.clientWidth;
  				}
 			else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
				{
    			//IE 4 compatible
				//alert("IE 4 compatible");
    			myWidth = document.body.clientWidth;
    			myHeight = document.body.clientHeight;
				dHeight = document.body.scrollHeight;
				dWidth = document.body.scrollWidth;
  				}
			document.cookie="scrW=" + myWidth + "; expires=" + expiration_date + "; path=/;" ;
			document.cookie="scrH=" + myHeight + "; expires=" + expiration_date + "; path=/;" ;
			document.cookie="docH=" + dHeight + "; expires=" + expiration_date + "; path=/;" ;
			document.cookie="docW=" + dWidth + "; expires=" + expiration_date + "; path=/;" ;
			//alert("scr size: " + myHeight + '/' + myWidth);
			//alert("doc size: " + dHeight + '/' + dWidth);
			
			
			// alert("Doc Size (H/W): " + dHeight + "/" + dWidth);
			
			
			return;
			}
		
		function getScrollXY() 
			{
			//alert("Got to getScrollXY Routine");
  			var scrOfX = 0, scrOfY = 0;
			var expiration_date = new Date("January 1, 2010");
			expiration_date = expiration_date.toGMTString();

  			if( typeof( window.pageYOffset ) == 'number' )
 				{
    			//Netscape compliant
				//alert("Netscape Compliant");
    			scrOfY = window.pageYOffset;
    			scrOfX = window.pageXOffset;
  				}
 			else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
				{
    			//DOM compliant
				//alert("DOM Compliant");
    			scrOfY = document.body.scrollTop;
    			scrOfX = document.body.scrollLeft;
  				}
 			else if( document.documentElement &&
      				( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
				{
				//alert("IE6 Standards Compliant Mode");
    			//IE6 standards compliant mode
    			scrOfY = document.documentElement.scrollTop;
    			scrOfX = document.documentElement.scrollLeft;
  				}
			
			if (scrOfX > maxScrollW)
				{maxScrollW=scrOfX;
  				 document.cookie="scrScrlW=" + scrOfX + "; expires=" + expiration_date + "; path=/;" ;
				 scrOfX=0;
				}
			if (scrOfY > maxScrollH)
				{maxScrollH=scrOfY;
  				 document.cookie="scrScrlH=" + scrOfY + "; expires=" + expiration_date + "; path=/;" ;
				 scrOfY = 0;
				 }

     		//alert("scroll: " + scrOfY + '/' + scrOfX);
			//alert("max scroll: " + maxScrollH + '/' + maxScrollW);
  			return; 
			}
			
			function displayFAQS (topic) 
			{
			document.getElementById(topic).style.display='';
			}
			
//02.16.09
var curtain
function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setContent() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentElement = document.getElementById('webInqDiv');
					var contentHeight = contentElement.offsetHeight;
					if (windowHeight - contentHeight > 0) {
						contentElement.style.position = 'relative';
						contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
					}
					else {
						contentElement.style.position = 'static';
					}
				}
			}
		}
		
function getCheckBoxes(field)
{
	var myStr = '';
		for (i = 0; i < field.length; i++){
			if (field[i].checked){
				myStr = myStr + field[i].value + ',';
				
			}
		}
		myStr = myStr.slice(0, -1)
		
		return myStr;
}

function getSelected(field)
{
	var myStr = '';
		for (i = 0; i < field.length; i++){
			if (field[i].selected){
				myStr = myStr + field[i].value + ',';
				
			}
		}
		myStr = myStr.slice(0, -1)
		
		return myStr;
}
		
function showWebInqForm(custid,bookid) 
	{
	
		// add check here if book is textbook using ajax
		
		//alert(custid);
		var searchByBookNum=0;
		var digitOnly = /\d/;
		 
	 /* Determine if this is booknumber or text search -- only booknumber searches must have quantity */
	
	 if (document.getElementById('searchType2').value == 'QS')
	 {
		 if  (!(digitOnly.test(document.getElementById('searchTerm2').value.charAt(0))))
		 	{searchByBookNum=0;}
		 else
		 	{searchByBookNum=1;}
	 }
	else if (document.getElementById('searchType2').value == 'AS')
	 {
		if  (document.getElementById('bookNums2').value != '')
		 	{searchByBookNum=1;}
		 else
		 	{searchByBookNum=0;}
	 }

	//if (typeof bookid!='undefined')
	
		if(searchByBookNum == 1 && typeof bookid!='undefined'){
			//alert(typeof bookid);
			chkTextbook(bookid);
		
		
		}
	//}
	
	 if (custid > '0'  || (document.getElementById('custType2').value > 0 && document.getElementById('postalCode2').value > '0'))
		{		
		
		document.getElementById('wiDemographics').style.display='none';
		}	 
	 if (searchByBookNum == 0 && (isTextbook == 0 || isTextbook == 9))
	 	{	 	
	 	
	 	document.getElementById('wiQtyFld').style.display='none';
	 	
	 	}
	 else if (searchByBookNum == 1 && (isTextbook == 0 || isTextbook == 9))
	 	{	 	
	 	//alert(isTextbook);
	 	document.getElementById('textbookchk').style.value=0;
	 	document.getElementById('wiQtyFld').style.display='none';
	  	}
	 else if(document.getElementById('wiQty2').value.length > 0 && document.getElementById('wiQty2').value > 0 )
	 	{	 	
		
	 	document.getElementById('wiQtyFld').style.display='none';
	 	} 
	 else
	 	{
	 	
	 	document.getElementById('wiQtyFld').style.display='';
	 	}
		 
	
	 if (document.getElementById('wiDemographics').style.display != 'none' || document.getElementById('wiQtyFld').style.display != 'none')
		{	
			
				
				curtain = document.body.appendChild( document.createElement('div') );
	    		curtain.id = "curtain";
		  		if (document.getElementById('wiQty2').value == '0' || document.getElementById('wiQty2').value.length == 0 && isTextbook == 1 )
		  			{
		  			
		  			document.getElementById('wiQtyFld').style.display='';
		  			
		  			}else{
		  				document.getElementById('wiQty2').value = 1;
		  		}
	  		
				document.getElementById('webInqDiv').style.display='';
				if(document.getElementById('wiDemographics').style.display== ''){
					document.getElementById('custType2').focus();
				}else if(document.getElementById('wiQtyFld').style.display == ''){
					document.getElementById('wiQty2').focus();
				}
				
				
					
					return false;
			
		}
	 else
		{
			
			setContent();
			return true;
		}	
		
	
}
	
function validateWIForm(custid)
	{
	var validDataFlag=true;
	var digitOnly = /\d/;
	
	if (custid == '0')
		{
		if (document.getElementById('custType2').value == 0) // school/customer type is required
			{
			validDataFlag=false;
			document.getElementById('custType2').style.backgroundColor = '#FFCED5';
			}
	
		if ((document.getElementById('postalCode2').value.Trim().length < 5 || document.getElementById('postalCode2').value.Trim() == 0 || document.getElementById('postalCode2').value.Trim() == '') && document.getElementById('custType2').value.Trim() != 3) // postal code is required
			{
			validDataFlag=false;
			document.getElementById('postalCode2').style.backgroundColor = '#FFCED5';
			}
		}
		
	// alert(validDataFlag);
	// alert(document.getElementById('wiQty2').value.Trim());
	// alert(document.getElementById('wiQty2').value.Trim().length);
	// alert(document.getElementById('postalCode2').value);
	if ((document.getElementById('wiQty2').value.Trim().length == 0 || document.getElementById('wiQty2').value.Trim() == 0) ) //need to enter non-zero quantity
		{
		validDataFlag=false;
		document.getElementById('wiQty2').style.backgroundColor = '#FFCED5';
		document.getElementById('wiQty2').focus();
		}
	
	// alert(validDataFlag);
	
	if (validDataFlag == true)
		{
		document.getElementById('wiFormErrorMsg').innerHTML='';
		if (custid > 0) { hideWebInqForm(); };
		//alert(document.getElementById('theNextPage2').value);
		document.webInqPopUp.action=document.getElementById('theNextPage2').value;
		//alert(document.webInqPopUp.action);
		}
	else
		{
		document.getElementById('wiFormErrorMsg').innerHTML='Required field missing.';
		document.getElementById('wiFormErrorMsg').style.color='#993333';
		document.getElementById('wiFormErrorMsg').style.fontWeight='bold';
		document.getElementById('wiFormErrorMsg').style.fontSize='12px';
		}
	
	return validDataFlag;
	}
	
function hideWebInqForm()
	{
	document.getElementById('webInqDiv').style.display='none';
	curtain.parentNode.removeChild( curtain );
	
	return true;
	}
	
String.prototype.Trim = function()
	 {
	 return this.replace(/(^\s*)|(\s*$)/g, "");
	 }
  
// trim blank space at the beginning
String.prototype.LTrim = function()
	{
	return this.replace(/(^\s*)/g, "");
	}
 
// trim blank space at the end
String.prototype.RTrim = function()
	{
	return this.replace(/(\s*$)/g, "");
	}
// 02.16.09 End

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

			
			//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

function SortBy_Search(sortOrder){
if(sortOrder == "Price1"){
	document.SrchResults.sortStyle.value="desc";
	
}else if(sortOrder == "Price2"){
	document.SrchResults.sortStyle.value="asc";
	
}else if(sortOrder == "Copyright1"){
	document.SrchResults.sortStyle.value="desc";
	
}else if(sortOrder == "Copyright2"){
	document.SrchResults.sortStyle.value="asc";
	
}
	document.SrchResults.submit();
}
			
function makeBold(elementName, boolBold) {
	/********************************************************************************
	Function: makeBold()
	Written : 7.15.2008
	Purpose : Sets an element's font-weight style property to bold or "regular" 
			  based on the second [boolean] parameter. True = bold, False = regular.
	********************************************************************************/
	document.getElementById(elementName).style.fontWeight = (boolBold ? "bold" : "");
}	

function makeRed(elementName, boolRed) {
	/********************************************************************************
	Function: makeBold()
	Written : 7.15.2008
	Purpose : Sets an element's font-weight style property to bold or "regular" 
			  based on the second [boolean] parameter. True = bold, False = regular.
	********************************************************************************/
	document.getElementById(elementName).style.color = (boolRed ? "993333" : "000000");
}		
			

function chkFileType(fname)  {
	endchar=fname.length;
	startchar=endchar-4;
	ftype=fname.substring(startchar,endchar);
	ftype=ftype.toUpperCase();

	if (ftype != '.DOC' &&  ftype != '.PDF' && ftype != '.XLS' && ftype != '.TXT')
		{
		alert("Invalid file entered.  File must be .DOC, .XLS, .PDF, .TXT");
		return false;
		}
	else
		return true;
}			



	function createObject() {
		var request_type;
		var browser = navigator.appName;
			if(browser == "Microsoft Internet Explorer"){
				request_type = new ActiveXObject("Microsoft.XMLHTTP");
			}else{
				request_type = new XMLHttpRequest();
			}
		return request_type;
	}
	
	var http = createObject();
	
	
	var nocache = 0;
	
	function insert(searchType) {
		var search_type= searchType;
		nocache = Math.random();
		http.open('get', '/includeFiles/WIA_Insert.cfm?searchtype='+search_type+'&nocache = '+nocache);
		http.send(null);
	}
	

	
	function update() {
		//var site_url= encodeURI(document.getElementById(nameField).value);
		nocache = Math.random();
		http.open('get', '/includeFiles/WIA_Update.cfm?nocache = '+nocache);
		http.send(null);
	}
	
	function clearSTL(){
		//curtain2 = document.body.appendChild( document.createElement('div') );
	    //curtain2.id = "curtain2";
		document.getElementById("loginErr").innerHTML = "";
		document.getElementById("ListErr").innerHTML = "";
		document.getElementById("createList").checked = false;
		document.getElementById("saveList").checked = false;
		document.getElementById("stlEmail").value = "";
		document.getElementById("stlPassword").value = "";
	}
	
	function clearCartPopUp(){
		document.getElementById("loginErr").innerHTML = "";
		document.getElementById("ListErr").innerHTML = "";
		//document.getElementById("createList").checked = false;
		//document.getElementById("saveList").checked = false;
		//document.getElementById("stlEmail").value = "";
		//document.getElementById("stlPassword").value = "";
	}
	
	function clearLogin(){
		//curtain2 = document.body.appendChild( document.createElement('div') );
	    //curtain2.id = "curtain2";
		document.getElementById("loginErr").innerHTML = "";
		//document.getElementById("ListErr").innerHTML = "";
		//document.getElementById("createList").checked = false;
		//document.getElementById("saveList").checked = false;
		document.getElementById("stlEmail").value = "";
		document.getElementById("stlPassword").value = "";
	}
	
	function clearSTL2(repeatCounter){
		var formCounter = repeatCounter;
		
		//	curtain2 = document.body.appendChild( document.createElement('div') );
	    //	curtain2.id = "curtain2";
			document.getElementById("loginErr_"+formCounter).innerHTML = "";
			document.getElementById("ListErr_"+formCounter).innerHTML = "";
			document.getElementById("createList_"+formCounter).checked = false;
			document.getElementById("saveList_"+formCounter).checked = false;
			document.getElementById("stlEmail_"+formCounter).value = "";
			document.getElementById("stlPassword_"+formCounter).value = "";
		
	}
	




	function chkTextbook(bookNum) { 
		
			//alert('got here');
			//return false;
			var bookNumber = bookNum;
			
			// This file is in the follett_fes_general folder
			var url = "/includeFiles/wi_chkTextbook_AJAX.cfm?rnd=" + Math.random()+ "&bookID=" + bookNumber+ "&irma=isawesome"
			
				oChkTextRequest = getRequestObjectTxtBk();
				
				if(oChkTextRequest != null) {
					
					//oChkTextRequest.onreadystatechange = chkTextbookCallback;
					oChkTextRequest.open("GET",url,false);
					oChkTextRequest.send(null);
					
					var xmlDoc = oChkTextRequest.responseXML.documentElement;
					var bookfound = xmlDoc.getElementsByTagName("bookfound");
					if(bookfound[0].childNodes[0] != null){
						
						if(bookfound[0].childNodes[0].nodeValue == 'Success'){
							//alert('True');
							isTextbook = 1;
							
						}else{
							
							isTextbook = 0;
						}
					}
					
					
				}
			
			
		
			
		
	}
	
	
	/* Returns a request object. */	
	function getRequestObjectTxtBk() {
	var xmlHttp;
	try {    // Firefox, Opera 8.0+, Safari    
		xmlHttp = new XMLHttpRequest();    
	} catch (e) {    // Internet Explorer    
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!");
				//return false;
				xmlHttp = null;
			}
		}
	}
	return xmlHttp;
}


function showHideSearch(searchType){
//alert(searchType);
	if(searchType == "default"){
		document.getElementById("Author2").style.display="none";
		document.getElementById("RefText").style.display="none";
		document.getElementById("TitleWave1").style.display="none";
		document.getElementById("TitleWave2").style.display="none";
		document.getElementById("Classroom2").style.display="none";
		document.getElementById("searchTitle").innerHTML="Advanced Search";
	}
	if(searchType == "classroom"){
		document.getElementById("Author2").style.display="";
		document.getElementById("RefText").style.display="none";
		document.getElementById("TitleWave1").style.display="";
		document.getElementById("TitleWave2").style.display="";
		document.getElementById("Classroom2").style.display="";
		document.getElementById("searchTitle").innerHTML="Classroom Materials";
	}
	if(searchType == 'audiovisual'){
		document.getElementById("Author2").style.display="";
		document.getElementById("RefText").style.display="none";
		document.getElementById("TitleWave1").style.display="";
		document.getElementById("TitleWave2").style.display="";
		document.getElementById("Classroom2").style.display="";
		document.getElementById("searchTitle").innerHTML="Audiovisual";
	}
	if(searchType == "litguides" || searchType == "testprep"){
		document.getElementById("Author2").style.display="";
		document.getElementById("RefText").style.display="none";
		document.getElementById("TitleWave1").style.display="none";
		document.getElementById("TitleWave2").style.display="none";
		document.getElementById("Classroom2").style.display="none";
		if(searchType == "litguides"){
			document.getElementById("searchTitle").innerHTML="Literature Guides";
		}
		if(searchType == "testprep"){
			document.getElementById("searchTitle").innerHTML="Test Prep";
		}
	}
	if(searchType == "refbooks" || searchType == "textbooks"){
		document.getElementById("Author2").style.display="none";
		document.getElementById("RefText").style.display="";
		document.getElementById("TitleWave1").style.display="none";
		document.getElementById("TitleWave2").style.display="none";
		document.getElementById("Classroom2").style.display="none";
		if(searchType == "refbooks"){
			document.getElementById("searchTitle").innerHTML="Reference";
		}
		if(searchType == "textbooks"){
			document.getElementById("searchTitle").innerHTML="Textbooks";
		}
	}

}

function searchHeaderCheck(checkExtra){
	var checkFalse = 0;
	var searchByBookNum=0;
	var digitOnly = /\d/;
	
	//alert(checkFalse);
	if ((checkExtra == 1) && ((document.getElementById("searchTerm1").value == "Search Words" || document.getElementById("searchTerm1").value == "")
	|| (document.getElementById("wiQty1").value == "Qty" || document.getElementById("wiQty1").value == "") || (document.getElementById("custType3").value == 0)
	|| (document.getElementById("postalCode3").value == "Zip Code" || document.getElementById("postalCode3").value == ""))){
			
			var bookid = document.getElementById("searchTerm1").value;
			if  (!(digitOnly.test(document.getElementById('searchTerm1').value.charAt(0))))
			 	{searchByBookNum=0;}
			 else
			 	{searchByBookNum=1;}
			 	
			 	//alert(searchByBookNum)
			 	
			 	if(searchByBookNum == 1 && typeof bookid!='undefined'){
					//alert(typeof bookid);
					chkTextbook(bookid);	
				}
			
			
			if(document.getElementById("searchTerm1").value == "Search Words" || document.getElementById("searchTerm1").value == ""){
				document.getElementById("searchTerm1").style.backgroundColor = "#FFCED5";
				document.getElementById("errSearchTerm").innerHTML="Required";
				checkFalse = checkFalse + 1;
				//alert(checkFalse)
			}else{
				document.getElementById("searchTerm1").style.backgroundColor = "#FFFFFF";
				document.getElementById("errSearchTerm").innerHTML="";
			}
			
			if (document.getElementById("wiQty1").value == "Qty" || document.getElementById("wiQty1").value == "" ){
				if(isTextbook == 1){
				document.getElementById("wiQty1").style.backgroundColor = "#FFCED5";
				document.getElementById("errQty").innerHTML="Required";
				checkFalse = checkFalse + 1;
				}
				//alert(checkFalse)
			}else{
				if (isNaN(parseFloat(document.getElementById("wiQty1").value))) {
          				document.getElementById("wiQty1").style.backgroundColor = "#FFCED5";
						document.getElementById("errQty").innerHTML="Numbers Only";
						checkFalse = checkFalse + 1;
     			}else{
				
				
				document.getElementById("wiQty1").style.backgroundColor = "#FFFFFF";
				document.getElementById("errQty").innerHTML="";
				}
			}
			
			if(document.getElementById("custType3").value == 0){
				document.getElementById("custType3").style.backgroundColor = "#FFCED5";	
				document.getElementById("errWho").innerHTML="Required";
				checkFalse = checkFalse + 1;	
				//alert(checkFalse)		
			}else{
				document.getElementById("custType3").style.backgroundColor = "#FFFFFF";
				document.getElementById("errWho").innerHTML="";
			}
			
			if(document.getElementById("postalCode3").value == "Zip Code" || document.getElementById("postalCode3").value == ""){
				document.getElementById("postalCode3").style.backgroundColor = "#FFCED5";
				document.getElementById("errZip").innerHTML="Required";
				checkFalse = checkFalse + 1;
				//alert(checkFalse)
			}else{
				if (isNaN(parseFloat(document.getElementById("postalCode3").value))) {
          				document.getElementById("postalCode3").style.backgroundColor = "#FFCED5";
						document.getElementById("errZip").innerHTML="Numbers Only";
						checkFalse = checkFalse + 1;
     			}else{
				document.getElementById("postalCode3").style.backgroundColor = "#FFFFFF";
				document.getElementById("errZip").innerHTML="";
				}
			}
	}
	
	if ((checkExtra == 0) && ((document.getElementById("searchTerm1").value == "Search Words" || document.getElementById("searchTerm1").value == "") || 
	(document.getElementById("wiQty1").value == "Qty" || document.getElementById("wiQty1").value == "")))
	{
			
			var bookid = document.getElementById("searchTerm1").value;
			if  (!(digitOnly.test(document.getElementById('searchTerm1').value.charAt(0))))
			 	{searchByBookNum=0;}
			 else
			 	{searchByBookNum=1;}
			 	
			 	//alert(searchByBookNum)
			 	
			 	if(searchByBookNum == 1 && typeof bookid!='undefined'){
					//alert(typeof bookid);
					chkTextbook(bookid);	
				}
			
			if(document.getElementById("searchTerm1").value == "Search Words" || document.getElementById("searchTerm1").value == ""){
				document.getElementById("searchTerm1").style.backgroundColor = "#FFCED5";
				document.getElementById("errSearchTerm").innerHTML="Required";
				checkFalse = checkFalse + 1;
				//alert(checkFalse)
			}
			
			if (document.getElementById("wiQty1").value == "Qty" || document.getElementById("wiQty1").value == "" ){
				if(isTextbook == 1){
					//alert("hi");
					document.getElementById("wiQty1").style.backgroundColor = "#FFCED5";
					document.getElementById("errQty").innerHTML="Required";
					checkFalse = checkFalse + 1;
				}
				//alert(checkFalse)
			}	
	}
	
	if (checkFalse > 0){
				return false;
	}
}

	/*
	if ((checkExtra == 0) && (document.getElementById("searchTerm1").value == "Search Words" || document.getElementById("searchTerm1").value == "")
	&& (document.getElementById("wiQty1").value == "Qty" || document.getElementById("wiQty1").value == "")){
			document.getElementById("searchTerm1").style.backgroundColor = "#FFCED5";
			document.getElementById("errSearchTerm").innerHTML="Required";
			document.getElementById("wiQty1").style.backgroundColor = "#FFCED5";
			document.getElementById("errQty").innerHTML="Required";
			document.getElementById("custType2").style.backgroundColor = "#FFCED5";
			document.getElementById("postalCode2").style.backgroundColor = "#FFCED5";
			return false;
	}
	
	if (document.getElementById("searchTerm1").value == "Search Words" || document.getElementById("searchTerm1").value == ""){
			document.getElementById("searchTerm1").style.backgroundColor = "#FFCED5";
			document.getElementById("errSearchTerm").innerHTML="Required";
			document.getElementById("wiQty1").style.backgroundColor = "#FFCED5";
			document.getElementById("errQty").innerHTML="Required";
			return false;
	}
	
	if (document.getElementById("wiQty1").value == "Qty" || document.getElementById("wiQty1").value == ""){
			document.getElementById("wiQty1").style.backgroundColor = "#FFCED5";
			document.getElementById("errQty").innerHTML="Required";
			return false;
	}
	
	
	if(checkExtra == 1){
		
		
		
		if (document.getElementById("custType2").value == 0){
			return false;
		}
		
		if (document.getElementById("postalCode2").value == "Zip Code" || document.getElementById("postalCode2").value == ""){
			return false;
		}
		
		if ((document.getElementById('postalCode2').value.Trim().length < 5 || document.getElementById('postalCode2').value.Trim() == 0 || document.getElementById('postalCode2').value.Trim() == '') && document.getElementById('custType2').value.Trim() != 3) // postal code is required
			{
			return false;
			}
	
		
	}
	*/

function onClickClear(formName){

	//alert(formName.value);
	formName.value = '';
}

function resultsSaveAllToList(){
	
	var createList = document.getElementById("createList").checked;		
	var saveList = document.getElementById("saveList").checked;
	var recentList = document.getElementById("recentList").checked;

	if(recentList){
		document.getElementById('saveAllToListType').value='recent';
		document.getElementById('saveAllToListID').value=document.getElementById('stlRecentListID').value;
		document.getElementById('stlNewListName').value= '';
		document.getElementById('stlLists').value = '';
	}
	
	if(createList){
		document.getElementById('saveAllToListType').value='new';
		document.getElementById('saveAllToListID').value=document.getElementById('stlNewListName').value;
		document.getElementById('stlLists').value = '';
		//document.getElementById('stlRecentListID').value= '';
		
	}
	
	if(saveList){
		document.getElementById('saveAllToListType').value='saved';
		document.getElementById('saveAllToListID').value=document.getElementById('stlLists').value;
		document.getElementById('stlNewListName').value = '';
		//document.getElementById('stlRecentListID').value= '';
		
	}
	
	if(!createList && !saveList && !recentList){
			//alert("yes");
			
			document.getElementById("ListErr").innerHTML = "Choose an option.";
			return
	}
	
	if(createList){
			
			var listNewName = document.getElementById("stlNewListName").value;
			
			
			if(listNewName == ''){
				document.getElementById("ListErr").innerHTML = "Please enter in a list name.";
				return
			}
			
			
		}else if(saveList){
			
			var listID = document.getElementById("stlLists").value;
			
			if(listID == ''){
				document.getElementById("ListErr").innerHTML = "Please choose a list.";
				return
			}
			
			
		}else if(recentList){
			
			var listID = document.getElementById("stlRecentListID").value;
			
			if(listID == ''){
				document.getElementById("ListErr").innerHTML = "No recent list.";
				return
			}
		}
	
	document.getElementById('stlContainer').style.display='none';
	document.SrchResults.SUBMITCART2.value = 'ADD ALL TO LIST';
	document.SrchResults.submit();

}


function noenter(e) {
	var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;

}
 

//document.onkeypress = stopRKey; 
	