//MUTLIPAGE V1.2.21
//MULTI PAGE JAVASCRIPT FUNCTIONS & SETTINGS

//alert("You copied this while it was being edited. Please re-copy mp_main.js");

//**********************************************************************************************
//MULTI PAGE JAVASCRIPT FUNCTIONS: DO NOT EDIT
//**********************************************************************************************
var gbQuick = false;
var gCurrPage = 0;
var gMaxPageSeen=0;
var gBoolLoaded;
var gMaxPage;
var gbMax=0;
var iCount = 0;
var iOrderLimit = 3;
//ARRAYS
var arrProds=[]; //prodtitle,saveStory, subhead,description,flyType
var arrOffers=[];
var arrImages=[]; //new for IPS

var gbStart=true;
var gbLastPage=false;
var gbSummaryPage=false;
var gbSubmitOverride=false; //OVERRIDE: ALLOW SUBMIT TO SHOW ON ALL PAGES

/*IE handles adding class via JS differently...*/
var strClass="class";
var strBurstType = "png";
var bIsIESix = false;
var bRevealingTabs = false;

if(document.all){ 
	strClass="className"; //IE
	//BURST
	if (!window.XMLHttpRequest){
		bIsIESix = true;
		strBurstType="gif"; //IE6
	}
}

var bLoadCall = false;
function mpLoad(){
//error handling
	//only need to call this once
	if(bLoadCall) return;	
	bLoadCall = true;

	var strError = "";
	var strError_Img="";
	var strError_offer="";
	
	if(!arrProds.length) strError += "\n\nPage has no offers, this will cause errors.";
	if(arrProds.length != arrOffers.length)	 strError +="\n\n" + (arrProds.length-arrOffers.length) + " product(s) are missing offers, this will cause errors.";	


	var iSetting=0;
	for (var i = 0; i < gProdPerPageDisp.length; i++) iSetting+=gProdPerPageDisp[i];
	if(arrProds.length != iSetting)	 strError +="\n\nSum of Products Per Page Settings (" + iSetting + ") and Total Products (" + arrProds.length + ") do not match, this will cause errors.";

//begin page loading
	for (var i = 0; i < arrProds.length; i++) {
		if(!arrImages[i].length) strError_Img +="\n#" + (i+1) + ": " + arrProds[i].prodtitle;	
		
		if(arrOffers[i].length){
			//create hidden form fields
			for (var xx = 0; xx < arrOffers[i].length; xx++) {
				//fObjCreator("input",$("mpHidden"),"type=hidden~name=OrderItem_"+arrOffers[i][xx][0]+"~id=OrderItem_"+arrOffers[i][xx][0]);
				fObjCreator("input",$("mpHidden"),"type=hidden~name=OrderItem_"+arrOffers[i][xx].offerCode+"~id=OrderItem_"+arrOffers[i][xx].offerCode);
			}
		}else{
			strError_offer +="\n#" + (i+1) + ": " + arrProds[i].prodtitle;	
		}
	}	

	if(strError_Img !="") strError += "\n\nThe following products are missing images:\n" + strError_Img;
	if(strError_offer !="") strError += "\n\nThe following products have no offers:\n"+ strError_offer;


	if(strError!="") alert("PCH ALERT\nThis page has the following issues:" + strError);


	//set up page count variables	
	gMaxPage = gProdPerPageDisp.length;
	
	var mpRV = false;
	if(typeof getURLValue=="function") mpRV = getURLValue("mpRv");
	if(typeof getURLValue=="function") mpRV = string_GetURLValue("mpRv");
	
	if(mpRV){
		//REVEAL all tabs (for "back to products" packages)
		bRevealingTabs = true;
		for(var xX=0;xX<=gMaxPage;xX++) fPage(1,false);
		initOrder();
		bRevealingTabs = false;
	}else{
		//reset everything, start at first page
		fPage(1,false);
	}

	fCartCount();
	gbStart=false;//page load/start flag
}

function fQuickPage(inPageNum, inProd){
	gbQuick=true;
	if(inPageNum==gCurrPage) return;

	if(!gBoolLoaded){
		alert("Loading Page, please try again in a moment.");
		return;
	}
	gCurrPage=inPageNum;
	fPage(0,true, inProd);
}

function fPage(inDir,bCollapse,inProd){
	_globalSubmit=false;
	gCurrPage+=inDir;

	if(gCurrPage > gMaxPageSeen) gMaxPageSeen = gCurrPage;
	if (bCollapse)	activate_shelf(0)//collapse
	
//SET LAST PAGE & SUMMARY VARS...	
	gbLastPage=false;//default
	gbSummaryPage=false;//default
	if(gbSummary && (gCurrPage > gMaxPage)){
	//LAST PAGE, SUMMARY		
		gbLastPage=true;
		gbSummaryPage=true;
	}else if(!gbSummary && (gCurrPage == gMaxPage)){
	//LAST PAGE, NO SUMMARY
		gbLastPage=true;		
	}
	
//IF headerToggle AND NOT summary page
	if(gbHeaderToggle && !gbSummaryPage) $("mpSubHeader").style.backgroundImage = "url("+strAkamai + gArrHeaders[gCurrPage-1]+")";
	
	/*HIDE so they must wait for load. Use visible so it still takes up space*/
	$("mpNavBack").style.visibility="hidden";
	$("mpNavNext").style.visibility="hidden";
	$("mpNavPgCnt").innerHTML= "Page "+ gCurrPage;
	fProductLoad(inProd);
	fShowHideShell();
}

function fProductLoad(inProd){
	var pWrap,pSub,pImgWrap, pImgSubWrap, pUL, pOrderWrap, pAddWrap, pTempElem;
	var offer, zindex, strMutliClass;

	$("mpLoadingMessage").innerHTML="Loading Page "+gCurrPage +"...";

	deleteAll($("mpSubwrap"));

	var pgLI, objTmp;
	
	var strTopBot ="mpPageNavTop";
	var strTabDisp;

	for(var twice=1;twice<3;twice++){
		if(twice==2)strTopBot ="mpPageNavBtm"
		
		if(gbSummaryPage){ //SUMMARY PAGE
			if(gbMax<2){
				gbMax++;
				pgLI = fObjCreator("li",$(strTopBot));
				objTmp = fObjCreator("a",pgLI,"href=javascript:fQuickPage("+gMaxPageSeen+")","Summary");
				if(document.all) objTmp.onclick= function(){_globalSubmit = true;}
			}
		}
	
		if($(strTopBot).childNodes.length < gMaxPageSeen){
			pgLI = fObjCreator("li",$(strTopBot));
			
			if(gbCustomTabs){
				//custom tabs
				strTabDisp = gArrCustomTabs[gMaxPageSeen-1];
			}else{
				strTabDisp = "Page " + gMaxPageSeen;
			}
			
			objTmp=fObjCreator("a",pgLI,"href=javascript:fQuickPage("+gMaxPageSeen+")",strTabDisp );
			if(document.all) objTmp.onclick= function(){_globalSubmit = true;}
		}
		
		for(var iPg=0;iPg<$(strTopBot).childNodes.length;iPg++){
			if((iPg+1)==gCurrPage){
				$(strTopBot).childNodes[iPg].childNodes[0].className = "currPage";
			}else{
				$(strTopBot).childNodes[iPg].childNodes[0].className = "";
			}
		}

		if(gMaxPageSeen>1) $(strTopBot).style.backgroundPosition = "top right";
	}
	
	if(gbSummaryPage){ //SUMMARY PAGE
		$("mpLoadingMessage").style.display="none";
		$("mpPageNavTop").style.display="none";
		$("mpCartCount").style.backgroundPosition="left bottom";
	}else{
		$("mpPageNavTop").style.display="block";
		$("mpCartCount").style.backgroundPosition="left top";
	}

	if(!bRevealingTabs){ //bRevealingTabs is for 2 page packages. "step1 buy, step 2 enter", 99% this will happen
		var iStart=0, iEnd;
		if(gCurrPage!=1){
			for(ip=0;ip<gCurrPage-1;ip++) iStart+=gProdPerPageDisp[ip];
		}
		
		iEnd = iStart+gProdPerPageDisp[gCurrPage-1]
	
		var strTemp, strFirstImg;
		var arrBurst, strLogoSrc;
		var bIssue, bSubheadSkip;
		for(var i=iStart; i<iEnd; i++){
			strTemp = ""; //default,reset
			strLogoSrc = ""; //default,reset
			bSubheadSkip = false;//default,reset
			if(arrProds[i].feature) strTemp = "mpFeature";
			pWrap = fObjCreator("div",$("mpSubwrap"),"id=mpProd_"+i+"~"+strClass+"=mpProdWrap " + strTemp);
	
			pSub = fObjCreator("div",pWrap,strClass+"=mpProdSubWrap");
					
			if(arrProds[i].feature){
				if(arrProds[i].featureHeader) fObjCreator("h3",pSub,strClass+"=mpFeatureHeader",arrProds[i].featureHeader);
			}
			
		//MAIN Image and LOGO FINDER....
			strFirstImg = ""; //reset
			bIssuebIssue = false;
			if(arrImages[i].length){
				for(var iImg=0; iImg<arrImages[i].length; iImg++){
					if(strFirstImg==""){
						if(arrProds[i].feature){
							if(arrImages[i][iImg].indexOf("330x330") !=-1)	strFirstImg=arrImages[i][iImg];
						}else{
							if(arrImages[i][iImg].indexOf("220x220") !=-1)	strFirstImg=arrImages[i][iImg];
						}
					}
					
					//LOGO PNG AND GIF
					if(arrImages[i][iImg].indexOf("logo") !=-1){
						if(arrImages[i][iImg].indexOf(".png")!=-1 && !bIsIESix){
							strLogoSrc = arrImages[i][iImg];
						}else if(arrImages[i][iImg].indexOf(".gif")!=-1 && bIsIESix){
							strLogoSrc = arrImages[i][iImg];
						}
					}
				}
			}else{
				bIssue=true
				//MISSING IMAGE PLACEHOLDER
				if(arrProds[i].feature){
					strFirstImg="http://design.ny.pch.com/targeted_marketing/development/MultPage/imagemissing_330x330.jpg";
				}else{
					strFirstImg="http://design.ny.pch.com/targeted_marketing/development/MultPage/imagemissing_220x220.jpg";
				}
			}
			
		//IMG & IMG CONTAINER CREATE
			strTemp="mpImgWrap"
			if(bIssue) strTemp+=" mpIssue"
			pImgWrap = fObjCreator("div",pSub,strClass+"="+strTemp);
			//logo
			if(strLogoSrc!="") fObjCreator("img",pImgWrap,"id=mpLogo_"+ i + "~src=" + strLogoSrc);
			pImgSubWrap  = fObjCreator("p",pImgWrap); //subwrap will allow for non conforming sizes .: no img strectching		
			fObjCreator("img",pImgSubWrap,"id=mpImg_"+ i + "~src=" + strFirstImg);
			fOtherImageNav(pImgWrap,i);
	
		//Product detail creation	
			strTemp =strClass+"=mpDetailWrap";
			pDetailWrap = fObjCreator("div",pSub,strTemp);
		
		//BURST AREA
			if(arrProds[i].burst){
				arrBurst = arrProds[i].burst.toString().split(",");
				for(var iBurst=0;iBurst<arrBurst.length;iBurst++) fObjCreator("img",pDetailWrap,strClass+"=mpBurst~src=" + strAkamai + arrBurst[iBurst] + "." + strBurstType);	
			}
			
			//TITLE
			fObjCreator("h2",pDetailWrap,"",arrProds[i].prodtitle);		
			
			strTemp = arrProds[i].saveStory
			if(arrProds[i].saveStory==""){
				strTemp=arrProds[i].subhead;
				bSubheadSkip=true;
			}
			//SAVINGS STORY
			fObjCreator("h1",pDetailWrap,"",strTemp);
	
			//SAVE COMPARISON
			if(arrProds[i].saveCompare && !bSubheadSkip) fObjCreator("h3",pDetailWrap,"",arrProds[i].saveCompare);
			
			//SUB HEAD
			if(arrProds[i].subhead && !bSubheadSkip) fObjCreator("h4",pDetailWrap,"",arrProds[i].subhead);
			//BODY COPY
			fObjCreator("div",pDetailWrap,strClass+"=mpBodyCopy",arrProds[i].description);
			//FLYTYPE
			if(arrProds[i].flyType) fObjCreator("div",pDetailWrap,strClass+"=mpFlytype",arrProds[i].flyType);
	
		//CLEAR FIX
			fObjCreator("p",pSub,strClass+"=mpClearFix");
	
		//ORDER AREA (Prices and "Add to cart") creation
	
	
			if(arrOffers[i].length){
				for(var xx=0;xx<arrOffers[i].length;xx++){
					//if not already - set the product cart status
					offer = arrOffers[i][xx];
		
					strMutliClass = "mpOrderWrap";
					if(xx==(arrOffers[i].length-1)) strMutliClass+=" mpOrderAdditional";
					pOrderWrap = fObjCreator("div",pWrap,strClass+"="+strMutliClass);
		
					pAddWrap = fObjCreator("p",pOrderWrap,strClass+"=cartButton");
					objTmp = fObjCreator("a",pAddWrap,"id=addCart_"+i+"_"+xx+"~href=javascript:fCart("+i+","+xx+",false)");	
					if(document.all) objTmp.onclick= function(){_globalSubmit = true;}
		
					fObjCreator("h4",pOrderWrap,"",offer.cartText);//Cart Text
					
					strTemp=""
					if(offer.pchPrice.indexOf("$") == -1) strTemp="$";
					fObjCreator("p",pOrderWrap,"","PCH Price: <span>" + strTemp + offer.pchPrice+"</span>");//PCHPRICE
		
					strTemp=""
					if(offer.qtrPrice.indexOf("$") == -1) strTemp="$";
					fObjCreator("p",pOrderWrap,"","4 Payments Each Only: <strong>" + strTemp + offer.qtrPrice +"*</strong>");//4PARTPAY
		
					if(offer.inCart) $("addCart_"+i+"_"+xx).className = "added"; //set to "added"
				}
			}else{
				pOrderWrap = fObjCreator("div",pWrap,strClass+"=mpOrderWrap mpOrderAdditional mpIssue");
	
				fObjCreator("h4",pOrderWrap,"","THIS PRODUCT HAS NO OFFERS!");//Cart Text
			}
			
			
		//CLEAR FIX
			fObjCreator("p",pWrap,strClass+"=mpClearFix");
		}
	
		//IE FIX, NON-SUMMARY PAGE
		if(!gbSummaryPage && document.all) $("mpProd_"+(i-1)).style.marginBottom="0";
	}
	
	//finally create something at the bottom. this is for shelf and to test for load completion.
	fObjCreator("p",$("mpSubwrap"),"id=mpSubwrapBottom","bottom");

	//DEMO: it waits!
	//setTimeout('fObjCreator("p",$("mpSubwrap"),"id=mpSubwrapBottom","bottom")',5555)

	setTimeout("fReveal("+inProd+")",1111); //initial wait.
}

function fReveal(inProd){
	if($("mpSubwrapBottom")){
		activate_shelf(1);
		if(inProd>=0) fScrollTo(inProd);
		if(gCurrPage>1)	$("mpNavBack").style.visibility="visible";
		if(gCurrPage<=gMaxPage) $("mpNavNext").style.visibility="visible";
	}else{
		setTimeout("fReveal("+inProd+")",1111);
	}
}

function fScrollTo(inProd){
	if(shelf_status==1){
		var scrolly = findPos($("mpProd_"+inProd)) - 10;
		window.scrollTo(0,scrolly);
		fBlinkBox(inProd);
	}else{
		setTimeout("fScrollTo("+inProd+")",222);
	}
}

function fCartLink(){
	scrollTo(0,findPos($("mpCart"))-10)
}

function fCartReplace(inReplaceText){
	//CONVERT ALL Predefined Character Entities to UNICODE 
	for(var iC=0;iC<arrCharEnt.length;iC++) inReplaceText = inReplaceText.replace(arrCharEnt[iC][0],arrCharEnt[iC][1]);

	//replace all UNICODE **character references**
	inReplaceText = inReplaceText.charRefToUnicode();	
	return inReplaceText;

	return inReplaceText;
}

String.prototype.charRefToUnicode = function()
{
	return this.replace(/&#(([0-9]{1,7})|(x[0-9a-f]{1,6}));?/gi,
		function(match, p1, p2, p3, offset, s){
			return String.fromCharCode(p2 || ("0" + p3));
		}
	);
}

function fCart(inProd,inOffer,bAlert){
	fClearBlink();
	var offer = arrOffers[inProd][inOffer];

	if(offer.inCart){ //if IN cart
		if(bAlert){
			var strAlert = fCartReplace(offer.cartText);
			if(!confirm('Are you sure you want to remove the following item from your shopping cart:\n\n' + strAlert + '\n\nClick OK to continue with remove.\nClick CANCEL to keep item in shopping cart.'))
			return;
		}
	}

	offer.inCart = !offer.inCart;
	if(offer.inCart){
	//ADD TO CART
		if(iCount == iOrderLimit){
			var nums = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"];
			alert ("Sorry, you may order up to " + nums[iOrderLimit] + " items only.\nPlease review your selections.");
			offer.inCart = !offer.inCart;//IMPORTANT!! UNDO!!
			return;
		}
		iCount++; //increment total order

		//test for existance of "add to cart" button for SNP (Stop n sell) on summary page
		if($("addCart_"+inProd+"_"+inOffer)) $("addCart_"+inProd+"_"+inOffer).className = "added"; //swap "add to cart" background
		$("OrderItem_"+offer.offerCode).value=offer.offerCode;
		//SHOW IN CART...
		var crtItm = fObjCreator("div",$("mpCartSubWrap"),"id=mpCart_"+inProd+"_"+inOffer+"~"+strClass+"=mpCartItem");//Cart Item Wrap

		var crtRmv = fObjCreator("p",crtItm,strClass+"=mpCartRemove");
		objTmp = fObjCreator("a",crtRmv,"href=javascript:fCart("+inProd+","+inOffer+",true)","remove");
		if(document.all) objTmp.onclick= function(){_globalSubmit = true;}
		
		var crtTtl = fObjCreator("h4",crtItm);//Cart Title
		objTmp = fObjCreator("a",crtTtl,"href=javascript:fCartGo("+inProd +")",offer.cartText);//Cart Title
		if(document.all) objTmp.onclick= function(){_globalSubmit = true;}

		strTemp=""
		if(offer.pchPrice.indexOf("$") == -1) strTemp="$";
		fObjCreator("p",crtItm,strClass+"=mpCartPCHPrice","PCH Price: <span>" + strTemp + offer.pchPrice +"</span>");//PCHPRICE

		strTemp=""
		if(offer.qtrPrice.indexOf("$") == -1) strTemp="$";
		fObjCreator("p",crtItm,strClass+"=mpCartFourPay","4 Payments Each Only: <span>" + strTemp + offer.qtrPrice +"*</span>");//4PARTPAY
		
	}else{ //REMOVE FROM CART
		iCount--;
		$("OrderItem_"+offer.offerCode).value=""; //set to nothing
		if($("addCart_"+inProd+"_"+inOffer)) $("addCart_"+inProd+"_"+inOffer).className = "";//set to "add to cart" to dafault

		deleteAll($("mpCart_"+inProd+"_"+inOffer));//delete the children
		$("mpCartSubWrap").removeChild($("mpCart_"+inProd+"_"+inOffer)); //delete this wrapper
		
		//SUMMARY PAGE
		if(gbSummaryPage) fSwapMessage();
	}

	fCartCount();
}

function fCartCount(){
	//SHOW/HIDE EMPTY MESSAGE
	if(iCount==0){
		$("continueButton").src = strAkamai+"mp_submitEntry.gif";//SHOW THE ENTRY ONLY BUTTOM
		$("mpCartCount").innerHTML = "No Items In Cart";
		$("mpCartSubWrap").style.backgroundPosition="50% 50%"; //SHOW THE BG
	}else{
		$("continueButton").src = strAkamai+"mp_submitEntryOrder.gif";//SHPW THE ENTRY/ORDER BUTTON
		if(iCount==1){
			$("mpCartCount").innerHTML = iCount + " Item In Cart";
		}else{
			$("mpCartCount").innerHTML = iCount + " Items In Cart";
		}

		$("mpCartSubWrap").style.backgroundPosition="0 -1000px"; //HIDE THE BG
	}
}

function fCartGo(inProd){
	//find my page
	var iPageMax=0;
	var myPage;
	for(var ip=0;ip<gProdPerPageDisp.length;ip++){
		iPageMax += gProdPerPageDisp[ip];
		if(inProd<iPageMax){
			myPage = ip+1;
			break;
		}
	}
	
	if(myPage!=gCurrPage){
		fQuickPage(myPage, inProd);
	}else{
		fCartGoScroll(inProd);
	}
}

function fCartGoScroll(inProd){
	if(inProd==currBlinkProd) return;
	var scrolly = findPos($("mpProd_"+inProd)) - 10;
	window.scrollTo(0,scrolly);
	fBlinkBox(inProd);
}

var currBlinkProd=-1;
var blinkSwitch = 0;
var blinkTimeout;

function fClearBlink(bBorder){
	if(currBlinkProd==-1) return;
	window.clearTimeout(blinkTimeout);
	blinkSwitch = 0;
	if($("mpImg_"+currBlinkProd)) $("mpImg_"+currBlinkProd).style.borderColor = "#fff";
}

function fBlinkBox(inProd){
	if(inProd!=currBlinkProd || !$("mpImg_"+inProd)){
		fClearBlink();
		if(!$("mpImg_"+inProd)) return;
	}

	currBlinkProd=inProd
	var clr;
	blinkSwitch++
	if (blinkSwitch%2==0){
		clr = "#fff";
	}else{
		clr = "#0099cc";/*light blue*/
	}

	$("mpImg_"+inProd).style.borderColor = clr;

	if(blinkSwitch<10){
		blinkTimeout = window.setTimeout("fBlinkBox("+inProd+")", 500);
	}else{
		blinkSwitch=0;
		currBlinkProd=-1;
	}
}

function fOtherImageNav(inParent,inProd){
	if(arrImages[inProd].length > 1){ //HAS OTHER IMGS
		var oNav = fObjCreator("ul",inParent,"id=oNavWrap_"+inProd);
		var oLI, oHref, strAtts;
		fObjCreator("li",oNav,strClass+"=oLabel","Image Viewer:");
		
		var imgCnt=0; //to differentiate features from standard
		var bIsValid;
		for(var nX=0;nX<arrImages[inProd].length;nX++){

			bIsValid = false;//always reset
			if(arrProds[inProd].feature){
				if(arrImages[inProd][nX].indexOf("330x330") !=-1) bIsValid=true;
			}else{
				if(arrImages[inProd][nX].indexOf("220x220") !=-1) bIsValid=true;
			}
			
			if(bIsValid){
				imgCnt++;
				
				strAtts="";
				if(imgCnt==1) strAtts=strClass+"=first"
				oLI = fObjCreator("li",oNav,strAtts);
				
				strAtts="";
				if(imgCnt==1) strAtts= "~"+strClass+"=current";
				oHref=fObjCreator("a",oLI,"href=javascript:funcShowImage("+inProd + "," + nX + "," + imgCnt +")~id=oNav_"+inProd+"_"+imgCnt+"~title=click to see this image" + strAtts,imgCnt);
				
				if(document.all) oHref.onclick= function(){_globalSubmit = true;}
			}
		}
		
		if(imgCnt==1) $("oNavWrap_" + inProd).style.display="none";
	}
}

function funcShowImage(inProd, inImg, inNav){
	$("mpImg_" + inProd).src=arrImages[inProd][inImg];

	//reset all the links
	//skip 0 (first) because that is the LABEL (ex."additional views")
	for(var iNv=1;iNv<$("oNavWrap_"+inProd).childNodes.length;iNv++) $("oNav_"+inProd+"_"+iNv).className="";

	$("oNav_"+inProd+"_"+inNav).className="current";
}

function fShowHideShell(){
	$("mpHeader").style.display = "block";
	$("mpNav").style.display = "block";
	$("continueButtonWrap").style.display = "none";		
	
	if(gbLastPage || gbSubmitOverride){
		$("mpNav").style.display = "none";
		$("continueButtonWrap").style.display = "block";
		if(gbSummaryPage) $("mpHeader").style.display = "none";
	}
	
	//IF NOT FROM TAB OR NOT PAGE LOAD, AUTO SCROLL TO TOP OF MP
	if(!gbStart){
		if(!gbQuick) scrollTo(0, findPos($("mpWrap")));
	}

	fSwapMessage();
	
	//RESET GLOBAL VARS
	gbQuick=false;
}

function fSwapMessage(){
	$("mpOrdercopy1").style.display="block"; //MESSAGE: IF ORDERING: PAY NOTHING NOW! NO CREDIT CARD REQUIRED!
	$("mpOrdercopy2").style.display="none";
	$("mpOrdercopy3").style.display="none";
	
	if(gbSummaryPage){
		$("mpOrdercopy1").style.display="none";
		if(iCount==0){
		//IF NOTHING IN CART
			$("mpOrdercopy2").style.display="block"; //MESSAGE: YOU ARE NOT PLACING AN ORDER TODAY
		}else{
			$("mpOrdercopy3").style.display="block"; //MESSAGE: TO PLACE YOUR ORDER: Simply click the SUBMIT button below.
		}
	}
}
/*******************************************************************************************
SHELF: Smooth opening & closing
*******************************************************************************************/

//GENERAL INFO
//------------
//The Shelf v1.1
//By Digital Pen
//LICENSE STATEMENT
//-----------------
//The following code is made available free of cost for non-commercial use and is governed by a GPL license which can be viewed at http://www.gnu.org/licenses/gpl.txt.
//********************

//GLOBAL VARIABLES
var shelf_status = 0 //0:collapsed, 1:expanded

//GENERAL FUNCTIONS
function curr_top(e) {
	var the_top = parseInt(e.offsetTop);
	return the_top;
}

function curr_height(e) {
	var the_height = parseInt(e.offsetHeight);
	return the_height;
}

//SHELF FUNCTIONS
function activate_shelf(action) {
	//action 0: collpase, 1:expand
	if (arguments.length == 1){
		if (action) {
			$("mpLoadingMessage").style.display="none";
			expand_shelf();
		}else{
			collapse_shelf();
		}
	}else{
		if (!shelf_status) {
			$("mpLoadingMessage").style.display="none";
			expand_shelf();
		}else if (shelf_status) {
			collapse_shelf();
		}
	}
}

var iSpeed = 33;
//EXPANSION FUNCTION
function expand_shelf() {
	//Establish object variables
	iSpeed+=iSpeed;
	var object_shelf = $("mpSubwrap");
	var object_collapse_link = $("mpSubwrapBottom"); //the last thing in the expando-box

	//Shelf calculations
	var height_to_set =  curr_height(object_shelf) + iSpeed;
	var height_to_set_string = height_to_set + "px;";


	var height_limit;
	if (navigator.appName == "Microsoft Internet Explorer") {
		height_limit= curr_top(object_collapse_link);
	}else{
		height_limit= curr_top(object_collapse_link) -curr_top(object_shelf);
	}

	//The shelf loop: continue expansion until all the shelf content is displayed.
	if (height_to_set < height_limit) {
		//Implement height change
		if (navigator.appName == "Microsoft Internet Explorer") {
			object_shelf.style.pixelHeight = height_to_set;
		}else {
			object_shelf.style.height = height_to_set_string;
		}

		setTimeout('expand_shelf()', 1);
	}else {

		if (navigator.appName == "Microsoft Internet Explorer") {
			object_shelf.style.pixelHeight = height_limit;
		}else{
			object_shelf.style.height = height_limit + "px";
		}
		shelf_status = 1;
		gBoolLoaded=true;
		//show page counts
		$("mpNavPgCnt").style.visibility="visible";		
		iSpeed=33;
	}
}

//COLLAPSING FUNCTION
function collapse_shelf() {
	var iSpeed = 100;
	//Establish object variables
	var object_shelf = $("mpSubwrap");
	var height_limit = 0 //curr_top(object_collapse_link) -curr_top(object_shelf);
/*

	var object_collapse_link = $("mpSubwrapBottom"); //the last thing in the expando-box

	//Shelf calculations
	var height_to_set = curr_height(object_shelf) - iSpeed;
	var height_to_set_string = height_to_set + "px;"

	//The shelf loop: continue expansion until all the shelf content is displayed.
	if (height_to_set > height_limit) {
		//Implement height change
		if (navigator.appName == "Microsoft Internet Explorer") {
			object_shelf.style.pixelHeight = height_to_set;
		}else{
			object_shelf.style.height = height_to_set_string;
		}

		setTimeout('collapse_shelf()', 1);
	}else {
*/
		if (navigator.appName == "Microsoft Internet Explorer") {
			object_shelf.style.pixelHeight = height_limit;
		}else{
			object_shelf.style.height = height_limit + "px";
		}

		shelf_status = 0;
		gBoolLoaded = false;
		$("mpLoadingMessage").style.display="block";
	//}
}

/*******************************************************************************************
GLOBAL FUNCTIONS
*******************************************************************************************/

function fObjCreator(inStrObj,inParent,inStrAtt,inStrHTML){
	var arrMulti, arrAtts;
	var newObj = document.createElement(inStrObj);//create it

	if (arguments.length > 2 ){
		if(inStrAtt.length){
			//alert(inStrAtt.indexOf(","))
			if(inStrAtt.indexOf("~")==-1){
				arrAtts=inStrAtt.split("=");
				//alert("ONE:\n"+arrAtts[0]+"\n"+arrAtts[1])
				newObj.setAttribute(arrAtts[0],arrAtts[1]);//set the attributes
			}else{
				arrMulti=inStrAtt.split("~");
				for(var i=0;i<arrMulti.length;i++){
					arrAtts=arrMulti[i].split("=");
					//alert("MANY:\n"+arrAtts[0]+"\n"+arrAtts[1])
					newObj.setAttribute(arrAtts[0],arrAtts[1]);//set the attributes
				}
			}
		}

		if (arguments.length == 4) newObj.innerHTML=inStrHTML;
	}

	//alert(inParent)
	inParent.appendChild(newObj);//place ELEMENT in its PARENT

	return newObj;
}

function deleteAll(inElement){
	while (inElement.hasChildNodes()){
		inElement.removeChild(inElement.firstChild);
	}
}

//SPECIAL "getElementById" FUNCTION!
function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}

function findPos(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curtop += obj.offsetTop;
		}
	}
	return curtop
}


/******************************************************************/
//NAV AWAY
/******************************************************************/
var _globalSubmit = false;
window.onbeforeunload = function() {
	if (_globalSubmit){
		_globalSubmit = false; //reset it
		return;
	}

var strAlert ="";
strAlert +="\n------------------------------------ WARNING! ---------------------------------------------\n";
strAlert +="YOUR ENTRY WILL BE FORFEITED IF YOU LEAVE THIS PAGE.\n";
strAlert +="Press CANCEL to stay on this page to claim your chance to win.\n";
strAlert +="------------------------------------------------------------------------------------------------------";

	//return "You have not yet completed your entry!";
	
	return strAlert;
}
/******************************************************************/

function fAddOnclick(){	
	var elem =  document.getElementsByTagName('A');
	var strTest;
	for(var i = 0; i < elem.length; i++){
		if(!elem[i].onclick){
			elem[i].onclick = function(){_globalSubmit = true;}
		}else{
			strTest = new String(elem[i].onclick);
			if(strTest.indexOf("_globalSubmit")==-1){				
				alert("PCH ERROR: An Href already exists with an ONCLICK EVENT, you will have to add it manually before continuing.\n\n The Href in question is:\n\n" + elem[i] + "\n\n Adding the code manually will stop this alert from showing.");
			}

			//elem[i].onclick += function(){_globalSubmit = true;}//put the leading semicolon just to be safe	
		}
	}
}

//IE only 
if(document.all) window.attachEvent("onload", fAddOnclick);


/******************************************************************/
//HTML Predefined Character Entities & their UNICODE alternate
/******************************************************************/
var arrCharEnt=[];
arrCharEnt.push([/&quot;/g,"&#x0022;"]);
arrCharEnt.push([/&amp;/g,"&#x0026;"]);
arrCharEnt.push([/&apos;/g,"&#x0027;"]);
arrCharEnt.push([/&lt;/g,"&#x003C;"]);
arrCharEnt.push([/&gt;/g,"&#x003E;"]);
arrCharEnt.push([/&nbsp;/g,"&#x00A0;"]);
arrCharEnt.push([/&iexcl;/g,"&#x00A1;"]);
arrCharEnt.push([/&cent;/g,"&#x00A2;"]);
arrCharEnt.push([/&pound;/g,"&#x00A3;"]);
arrCharEnt.push([/&curren;/g,"&#x00A4;"]);
arrCharEnt.push([/&yen;/g,"&#x00A5;"]);
arrCharEnt.push([/&brvbar;/g,"&#x00A6;"]);
arrCharEnt.push([/&sect;/g,"&#x00A7;"]);
arrCharEnt.push([/&uml;/g,"&#x00A8;"]);
arrCharEnt.push([/&copy;/g,"&#x00A9;"]);
arrCharEnt.push([/&ordf;/g,"&#x00AA;"]);
arrCharEnt.push([/&laquo;/g,"&#x00AB;"]);
arrCharEnt.push([/&not;/g,"&#x00AC;"]);
arrCharEnt.push([/&shy;/g,"&#x00AD;"]);
arrCharEnt.push([/&reg;/g,"&#x00AE;"]);
arrCharEnt.push([/&macr;/g,"&#x00AF;"]);
arrCharEnt.push([/&deg;/g,"&#x00B0;"]);
arrCharEnt.push([/&plusmn;/g,"&#x00B1;"]);
arrCharEnt.push([/&sup2;/g,"&#x00B2;"]);
arrCharEnt.push([/&sup3;/g,"&#x00B3;"]);
arrCharEnt.push([/&acute;/g,"&#x00B4;"]);
arrCharEnt.push([/&micro;/g,"&#x00B5;"]);
arrCharEnt.push([/&para;/g,"&#x00B6;"]);
arrCharEnt.push([/&middot;/g,"&#x00B7;"]);
arrCharEnt.push([/&cedil;/g,"&#x00B8;"]);
arrCharEnt.push([/&>sup1;/g,"&#x00B9;"]);
arrCharEnt.push([/&ordm;/g,"&#x00BA;"]);
arrCharEnt.push([/&raquo;/g,"&#x00BB;"]);
arrCharEnt.push([/&frac14;/g,"&#x00BC;"]);
arrCharEnt.push([/&frac12;/g,"&#x00BD;"]);
arrCharEnt.push([/&frac34;/g,"&#x00BE;"]);
arrCharEnt.push([/&iquest;/g,"&#x00BF;"]);
arrCharEnt.push([/&Agrave;/g,"&#x00C0;"]);
arrCharEnt.push([/&Aacute;/g,"&#x00C1;"]);
arrCharEnt.push([/&Acirc;/g,"&#x00C2;"]);
arrCharEnt.push([/&Atilde;/g,"&#x00C3;"]);
arrCharEnt.push([/&Auml;/g,"&#x00C4;"]);
arrCharEnt.push([/&Aring;/g,"&#x00C5;"]);
arrCharEnt.push([/&AElig;/g,"&#x00C6;"]);
arrCharEnt.push([/&Ccedil;/g,"&#x00C7;"]);
arrCharEnt.push([/&Egrave;/g,"&#x00C8;"]);
arrCharEnt.push([/&Eacute;/g,"&#x00C9;"]);
arrCharEnt.push([/&Ecirc;/g,"&#x00CA;"]);
arrCharEnt.push([/&Euml;/g,"&#x00CB;"]);
arrCharEnt.push([/&Igrave;/g,"&#x00CC;"]);
arrCharEnt.push([/&Iacute;/g,"&#x00CD;"]);
arrCharEnt.push([/&Icirc;/g,"&#x00CE;"]);
arrCharEnt.push([/&Iuml;/g,"&#x00CF;"]);
arrCharEnt.push([/&ETH;/g,"&#x00D0;"]);
arrCharEnt.push([/&Ntilde;/g,"&#x00D1;"]);
arrCharEnt.push([/&Ograve;/g,"&#x00D2;"]);
arrCharEnt.push([/&Oacute;/g,"&#x00D3;"]);
arrCharEnt.push([/&Ocirc;/g,"&#x00D4;"]);
arrCharEnt.push([/&Otilde;/g,"&#x00D5;"]);
arrCharEnt.push([/&Ouml;/g,"&#x00D6;"]);
arrCharEnt.push([/&times;/g,"&#x00D7;"]);
arrCharEnt.push([/&Oslash;/g,"&#x00D8;"]);
arrCharEnt.push([/&Ugrave;/g,"&#x00D9;"]);
arrCharEnt.push([/&Uacute;/g,"&#x00DA;"]);
arrCharEnt.push([/&Ucirc;/g,"&#x00DB;"]);
arrCharEnt.push([/&Uuml;/g,"&#x00DC;"]);
arrCharEnt.push([/&Yacute;/g,"&#x00DD;"]);
arrCharEnt.push([/&THORN;/g,"&#x00DE;"]);
arrCharEnt.push([/&szlig;/g,"&#x00DF;"]);
arrCharEnt.push([/&agrave;/g,"&#x00E0;"]);
arrCharEnt.push([/&aacute;/g,"&#x00E1;"]);
arrCharEnt.push([/&acirc;/g,"&#x00E2;"]);
arrCharEnt.push([/&atilde;/g,"&#x00E3;"]);
arrCharEnt.push([/&auml;/g,"&#x00E4;"]);
arrCharEnt.push([/&aring;/g,"&#x00E5;"]);
arrCharEnt.push([/&aelig;/g,"&#x00E6;"]);
arrCharEnt.push([/&ccedil;/g,"&#x00E7;"]);
arrCharEnt.push([/&egrave;/g,"&#x00E8;"]);
arrCharEnt.push([/&eacute;/g,"&#x00E9;"]);
arrCharEnt.push([/&ecirc;/g,"&#x00EA;"]);
arrCharEnt.push([/&euml;/g,"&#x00EB;"]);
arrCharEnt.push([/&igrave;/g,"&#x00EC;"]);
arrCharEnt.push([/&iacute;/g,"&#x00ED;"]);
arrCharEnt.push([/&icirc;/g,"&#x00EE;"]);
arrCharEnt.push([/&iuml;/g,"&#x00EF;"]);
arrCharEnt.push([/&eth;/g,"&#x00F0;"]);
arrCharEnt.push([/&ntilde;/g,"&#x00F1;"]);
arrCharEnt.push([/&ograve;/g,"&#x00F2;"]);
arrCharEnt.push([/&oacute;/g,"&#x00F3;"]);
arrCharEnt.push([/&ocirc;/g,"&#x00F4;"]);
arrCharEnt.push([/&otilde;/g,"&#x00F5;"]);
arrCharEnt.push([/&ouml;/g,"&#x00F6;"]);
arrCharEnt.push([/&divide;/g,"&#x00F7;"]);
arrCharEnt.push([/&oslash;/g,"&#x00F8;"]);
arrCharEnt.push([/&ugrave;/g,"&#x00F9;"]);
arrCharEnt.push([/&uacute;/g,"&#x00FA;"]);
arrCharEnt.push([/&ucirc;/g,"&#x00FB;"]);
arrCharEnt.push([/&uuml;/g,"&#x00FC;"]);
arrCharEnt.push([/&yacute;/g,"&#x00FD;"]);
arrCharEnt.push([/&thorn;/g,"&#x00FE;"]);
arrCharEnt.push([/&yuml;/g,"&#x00FF;"]);
arrCharEnt.push([/&OElig;/g,"&#x0152;"]);
arrCharEnt.push([/&oelig;/g,"&#x0153;"]);
arrCharEnt.push([/&Scaron;/g,"&#x0160;"]);
arrCharEnt.push([/&scaron;/g,"&#x0161;"]);
arrCharEnt.push([/&Yuml;/g,"&#x0178;"]);
arrCharEnt.push([/&fnof;/g,"&#x0192;"]);
arrCharEnt.push([/&circ;/g,"&#x02C6;"]);
arrCharEnt.push([/&tilde;/g,"&#x02DC;"]);
arrCharEnt.push([/&Alpha;/g,"&#x0391;"]);
arrCharEnt.push([/&Beta;/g,"&#x0392;"]);
arrCharEnt.push([/&Gamma;/g,"&#x0393;"]);
arrCharEnt.push([/&Delta;/g,"&#x0394;"]);
arrCharEnt.push([/&Epsilon;/g,"&#x0395;"]);
arrCharEnt.push([/&Zeta;/g,"&#x0396;"]);
arrCharEnt.push([/&Eta;/g,"&#x0397;"]);
arrCharEnt.push([/&Theta;/g,"&#x0398;"]);
arrCharEnt.push([/&Iota;/g,"&#x0399;"]);
arrCharEnt.push([/&Kappa;/g,"&#x039A;"]);
arrCharEnt.push([/&Lambda;/g,"&#x039B;"]);
arrCharEnt.push([/&Mu;/g,"&#x039C;"]);
arrCharEnt.push([/&Nu;/g,"&#x039D;"]);
arrCharEnt.push([/&Xi;/g,"&#x039E;"]);
arrCharEnt.push([/&Omicron;/g,"&#x039F;"]);
arrCharEnt.push([/&Pi;/g,"&#x03A0;"]);
arrCharEnt.push([/&Rho;/g,"&#x03A1;"]);
arrCharEnt.push([/&Sigma;/g,"&#x03A3;"]);
arrCharEnt.push([/&Tau;/g,"&#x03A4;"]);
arrCharEnt.push([/&Upsilon;/g,"&#x03A5;"]);
arrCharEnt.push([/&Phi;/g,"&#x03A6;"]);
arrCharEnt.push([/&Chi;/g,"&#x03A7;"]);
arrCharEnt.push([/&Psi;/g,"&#x03A8;"]);
arrCharEnt.push([/&Omega;/g,"&#x03A9;"]);
arrCharEnt.push([/&alpha;/g,"&#x03B1;"]);
arrCharEnt.push([/&beta;/g,"&#x03B2;"]);
arrCharEnt.push([/&gamma;/g,"&#x03B3;"]);
arrCharEnt.push([/&delta;/g,"&#x03B4;"]);
arrCharEnt.push([/&epsilon;/g,"&#x03B5;"]);
arrCharEnt.push([/&zeta;/g,"&#x03B6;"]);
arrCharEnt.push([/&eta;/g,"&#x03B7;"]);
arrCharEnt.push([/&theta;/g,"&#x03B8;"]);
arrCharEnt.push([/&iota;/g,"&#x03B9;"]);
arrCharEnt.push([/&kappa;/g,"&#x03BA;"]);
arrCharEnt.push([/&lambda;/g,"&#x03BB;"]);
arrCharEnt.push([/&mu;/g,"&#x03BC;"]);
arrCharEnt.push([/&nu;/g,"&#x03BD;"]);
arrCharEnt.push([/&xi;/g,"&#x03BE;"]);
arrCharEnt.push([/&omicron;/g,"&#x03BF;"]);
arrCharEnt.push([/&pi;/g,"&#x03C0;"]);
arrCharEnt.push([/&rho;/g,"&#x03C1;"]);
arrCharEnt.push([/&sigmaf;/g,"&#x03C2;"]);
arrCharEnt.push([/&sigma;/g,"&#x03C3;"]);
arrCharEnt.push([/&tau;/g,"&#x03C4;"]);
arrCharEnt.push([/&upsilon;/g,"&#x03C5;"]);
arrCharEnt.push([/&phi;/g,"&#x03C6;"]);
arrCharEnt.push([/&chi;/g,"&#x03C7;"]);
arrCharEnt.push([/&psi;/g,"&#x03C8;"]);
arrCharEnt.push([/&omega;/g,"&#x03C9;"]);
arrCharEnt.push([/&thetasym;/g,"&#x03D1;"]);
arrCharEnt.push([/&upsih;/g,"&#x03D2;"]);
arrCharEnt.push([/&piv;/g,"&#x03D6;"]);
arrCharEnt.push([/&ensp;/g,"&#x2002;"]);
arrCharEnt.push([/&emsp;/g,"&#x2003;"]);
arrCharEnt.push([/&thinsp;/g,"&#x2009;"]);
arrCharEnt.push([/&zwnj;/g,"&#x200C;"]);
arrCharEnt.push([/&zwj;/g,"&#x200D;"]);
arrCharEnt.push([/&lrm;/g,"&#x200E;"]);
arrCharEnt.push([/&rlm;/g,"&#x200F;"]);
arrCharEnt.push([/&ndash;/g,"&#x2013;"]);
arrCharEnt.push([/&mdash;/g,"&#x2014;"]);
arrCharEnt.push([/&lsquo;/g,"&#x2018;"]);
arrCharEnt.push([/&rsquo;/g,"&#x2019;"]);
arrCharEnt.push([/&sbquo;/g,"&#x201A;"]);
arrCharEnt.push([/&ldquo;/g,"&#x201C;"]);
arrCharEnt.push([/&rdquo;/g,"&#x201D;"]);
arrCharEnt.push([/&bdquo;/g,"&#x201E;"]);
arrCharEnt.push([/&dagger;/g,"&#x2020;"]);
arrCharEnt.push([/&Dagger;/g,"&#x2021;"]);
arrCharEnt.push([/&bull;/g,"&#x2022;"]);
arrCharEnt.push([/&hellip;/g,"&#x2026;"]);
arrCharEnt.push([/&permil;/g,"&#x2030;"]);
arrCharEnt.push([/&prime;/g,"&#x2032;"]);
arrCharEnt.push([/&Prime;/g,"&#x2033;"]);
arrCharEnt.push([/&lsaquo;/g,"&#x2039;"]);
arrCharEnt.push([/&rsaquo;/g,"&#x203A;"]);
arrCharEnt.push([/&oline;/g,"&#x203E;"]);
arrCharEnt.push([/&frasl;/g,"&#x2044;"]);
arrCharEnt.push([/&euro;/g,"&#x20AC;"]);
arrCharEnt.push([/&image;/g,"&#x2111;"]);
arrCharEnt.push([/&weierp;/g,"&#x2118;"]);
arrCharEnt.push([/&real;/g,"&#x211C;"]);
arrCharEnt.push([/&trade;/g,"&#x2122;"]);
arrCharEnt.push([/&alefsym;/g,"&#x2135;"]);
arrCharEnt.push([/&larr;/g,"&#x2190;"]);
arrCharEnt.push([/&uarr;/g,"&#x2191;"]);
arrCharEnt.push([/&rarr;/g,"&#x2192;"]);
arrCharEnt.push([/&darr;/g,"&#x2193;"]);
arrCharEnt.push([/&harr;/g,"&#x2194;"]);
arrCharEnt.push([/&crarr;/g,"&#x21B5;"]);
arrCharEnt.push([/&lArr;/g,"&#x21D0;"]);
arrCharEnt.push([/&uArr;/g,"&#x21D1;"]);
arrCharEnt.push([/&rArr;/g,"&#x21D2;"]);
arrCharEnt.push([/&dArr;/g,"&#x21D3;"]);
arrCharEnt.push([/&hArr;/g,"&#x21D4;"]);
arrCharEnt.push([/&forall;/g,"&#x2200;"]);
arrCharEnt.push([/&part;/g,"&#x2202;"]);
arrCharEnt.push([/&exist;/g,"&#x2203;"]);
arrCharEnt.push([/&empty;/g,"&#x2205;"]);
arrCharEnt.push([/&nabla;/g,"&#x2207;"]);
arrCharEnt.push([/&isin;/g,"&#x2208;"]);
arrCharEnt.push([/&notin;/g,"&#x2209;"]);
arrCharEnt.push([/&ni;/g,"&#x220B;"]);
arrCharEnt.push([/&prod;/g,"&#x220F;"]);
arrCharEnt.push([/&sum;/g,"&#x2211;"]);
arrCharEnt.push([/&minus;/g,"&#x2212;"]);
arrCharEnt.push([/&lowast;/g,"&#x2217;"]);
arrCharEnt.push([/&radic;/g,"&#x221A;"]);
arrCharEnt.push([/&prop;/g,"&#x221D;"]);
arrCharEnt.push([/&infin;/g,"&#x221E;"]);
arrCharEnt.push([/&ang;/g,"&#x2220;"]);
arrCharEnt.push([/&and;/g,"&#x2227;"]);
arrCharEnt.push([/&or;/g,"&#x2228;"]);
arrCharEnt.push([/&cap;/g,"&#x2229;"]);
arrCharEnt.push([/&cup;/g,"&#x222A;"]);
arrCharEnt.push([/&int;/g,"&#x222B;"]);
arrCharEnt.push([/&there4;/g,"&#x2234;"]);
arrCharEnt.push([/&sim;/g,"&#x223C;"]);
arrCharEnt.push([/&cong;/g,"&#x2245;"]);
arrCharEnt.push([/&asymp;/g,"&#x2248;"]);
arrCharEnt.push([/&ne;/g,"&#x2260;"]);
arrCharEnt.push([/&equiv;/g,"&#x2261;"]);
arrCharEnt.push([/&le;/g,"&#x2264;"]);
arrCharEnt.push([/&ge;/g,"&#x2265;"]);
arrCharEnt.push([/&sub;/g,"&#x2282;"]);
arrCharEnt.push([/&sup;/g,"&#x2283;"]);
arrCharEnt.push([/&nsub;/g,"&#x2284;"]);
arrCharEnt.push([/&sube;/g,"&#x2286;"]);
arrCharEnt.push([/&supe;/g,"&#x2287;"]);
arrCharEnt.push([/&oplus;/g,"&#x2295;"]);
arrCharEnt.push([/&otimes;/g,"&#x2297;"]);
arrCharEnt.push([/&perp;/g,"&#x22A5;"]);
arrCharEnt.push([/&sdot;/g,"&#x22C5;"]);
arrCharEnt.push([/&lceil;/g,"&#x2308;"]);
arrCharEnt.push([/&rceil;/g,"&#x2309;"]);
arrCharEnt.push([/&lfloor;/g,"&#x230A;"]);
arrCharEnt.push([/&rfloor;/g,"&#x230B;"]);
arrCharEnt.push([/&lang;/g,"&#x2329;"]);
arrCharEnt.push([/&rang;/g,"&#x232A;"]);
arrCharEnt.push([/&loz;/g,"&#x25CA;"]);
arrCharEnt.push([/&spades;/g,"&#x2660;"]);
arrCharEnt.push([/&clubs;/g,"&#x2663;"]);
arrCharEnt.push([/&hearts;/g,"&#x2665;"]);
arrCharEnt.push([/&diams;/g,"&#x2666;"]);

