var cm_staticpage = false;
cm_pgcat = null;
cm_pgname = null;
cm_noresults = -1;
cm_searchstr = "";
var cm_dimlist = null;
var cm_dimvallist = null;
var cm_tagtype = null;
var cm_pgno = 0;
var cm_store = null;
var cm_filtercount = 0;
var cm_prodid = null;
var cm_karat = null;
var cm_metal = null;
var cm_stone = null;
var cm_prodtype = null;
var cm_prodname = null;
var cm_ctw = null;
var cm_custid = 0;
var cm_custemail = null;
var cm_custcity = null;
var cm_custstate = null;
var cm_custzip = null;
var cm_regtag = false;
var cm_up = null;
var cm_shop = null;
var cm_catlgmode = "";
// order pipeline mismatches, repaired below
var cm_CustID = cm_custid;
var cm_Email = cm_custemail;
var cm_City = cm_custcity;
var cm_State = cm_custstate;
var cm_Zip = cm_custzip;


// lots of browser detection here...
function goKeyLink(evt) { 

	var use_evt = evt;
	if(typeof use_evt === 'undefined')
		use_evt = window.event;

	var keycode = use_evt.which; 
	if(typeof keycode === 'undefined')
		keycode = use_evt.keyCode;

	var etype = use_evt.type; 
	if( keycode == 13 && etype == "keypress") { 

           var use_target = use_evt.target;
           if('undefined' == typeof use_target)
               use_target = use_evt.srcElement;

	   return goButLink(use_target.name);
	} 
	else { 
		return true; 
	} 
}



// JRB- generalized the search handling functions to
// work with multiple targets. Unless you're using this
// for the default search box in the header, provide
// a name to index the text box.

function goButLink(anOptionalTextboxName) {  

  var use_textbox_name = anOptionalTextboxName;

  if("undefined" == typeof use_textbox_name) {
    use_textbox_name = "SearchBox_dc_searchtext";
  }

  var searchText = document.forms['template'][use_textbox_name].value;
  if((searchText == '') || (searchText == "keyword or item #")) {
    searchText = prompt("What would you like to search for?", '');
  }
  if(searchText) {
    createCookie("searchString", escape(searchText), 1);
    createCookie("searchReferer", s.pageName, 1);
    var urlstr =  "/index.aspx?tid=8&Ntt=" + escape(searchText) + "&N=0"; 
    window.location = urlstr;
  }
  return false;  
}


function ratingsDisplayed(totalReviewCount,avgRating,totalRatingOnlyCount,buyAgainPercentage) {
	//customStuff(productID,productName,productCategory,totalReviewCount,avgRating,totalRatingOnlyCount,buyAgainPercentage);
}
function pageChanged(pageName,pageStatus) {
   //if(window.parent.pageChanged) {
   //window.parent.pageChanged(pageName,pageStatus); }
}
