// 2007.10.01 KJD: Set the buttons
var Currency_ProductButtons = new Array();

document.onclick = TrackMouseLocation;

var thisMouseX = 0;
var thisMouseY = 0;

// 2007.09.26 KJD: Set x,y as vars
var xDiff = 20;
var yDiff = -50;

// 2007.08.31 KJD: 
var Currency_Items = new Array();


var AddToCartURL = "";

// 2007.08.30 KJD: Track mouse location
function TrackMouseLocation( event )
{
	if( ( typeof event == 'undefined' ) )
	{
		// 2007.09.06 KJD: For IE
		var thisevent = window.event; 
		
		thisMouseX = thisevent.clientX + xDiff;
		thisMouseY = thisevent.clientY + yDiff;
		
	}
	else
	{
		thisMouseX = event.clientX + xDiff;
		thisMouseY = event.clientY + yDiff;
	}
}

// 2007.08.30 KJD: show change
function ShowChangeCurrency( divName )
{
	////alert("ShowChangeCurrency");
	document.getElementById( 'Norton_CurrencySelector_Buttons' ).innerHTML = Currency_PopulateDiv( divName );

	SetLocationNorton_CurrencyDiv();
	SetVisibilityNorton_CurrencyDiv( "visible" );
}

// 2007.08.30 KJD: Hide box
function HideChangeCurrency()
{	////alert("HideChangeCurrency");
	SetVisibilityNorton_CurrencyDiv( "hidden" );

}

// 2007.08.30 KJD: get the div
function Norton_CurrencyDiv()
{
	////alert("Norton_CurrencyDiv");
	return document.getElementById( 'Norton_CurrencySelector' );
}

// 2007.08.30 KJD: set the visibility
function SetVisibilityNorton_CurrencyDiv( thisStyle )
{
	////alert("SetVisibilityNorton_CurrencyDiv");
	var thisDivBox = Norton_CurrencyDiv();
	thisDivBox.style.visibility = thisStyle;
}

// 2007.08.30 KJD: set the location
function SetLocationNorton_CurrencyDiv()
{
	////alert("SetLocationNorton_CurrencyDiv");
	var thisDivBox = Norton_CurrencyDiv();
	thisDivBox.style.left = thisMouseX + "px";
	thisDivBox.style.top = thisMouseY + "px";
}

// 2007.08.30 KJD: select a currency
function Norton_CurrencySelect( divName, thisValue )
{
	////alert("Norton_CurrencySelect");
	Norton_CurrencySetPrice( divName, thisValue );
	
	Currency_SetCookie( thisValue );
	
	HideChangeCurrency();
}

// 2007.08.31 KJD: Set the price
function Norton_CurrencySetPrice( divName, thisValue )
{
	////alert("Norton_CurrencySetPrice");
	// ////alert("Norton_CurrencySetPrice divName :" + divName);
	// ////alert("Norton_CurrencySetPrice thisValue :" + thisValue);
	// 2007.08.31 KJD: Change price for all items
	for( var i in Currency_Items )
	{
		try
		{
			if( Currency_Items[ i ][ thisValue ][ 'priceText' ] )
			{
				if( document.getElementById( i ) )
				{
					document.getElementById( i ).innerHTML = Currency_Items[ i ][ thisValue ][ 'priceText' ];
					
					Currency_CreateButtons( thisValue );
				}
			}
		} catch (e) {}
	}
}





// 2007.08.14 KJD: Create curve
// 2007.08.31 KJD: Updated to include border
function Norton_CreateCurveTest( thisID, thisSection, thisColor, borderColor )
{
	////alert("Norton_CreateCurveTest");
	if( !( borderColor ) )
	{
		borderColor = thisColor;
	}

	var thisString = ""
		+ "<STYLE>"
		+ ".curve_" + thisID + "_top, .curve_" + thisID + "_bottom {display:block; background:transparent;}"
		+ "	.curve_" + thisID + "_Bdygs1, .curve_" + thisID + "_Bdygs2, .curve_" + thisID + "_Bdygs3, .curve_" + thisID + "_Bdygs4 {display:block; overflow:hidden}"
		+ "	.curve_" + thisID + "_Bdygs1, .curve_" + thisID + "_Bdygs2, .curve_" + thisID + "_Bdygs3 {height:1px}"
		+ "	.curve_" + thisID + "_Bdygs2, .curve_" + thisID + "_Bdygs3, .curve_" + thisID + "_Bdygs4 {background:" + thisColor + "; border:1px solid " + borderColor + "; border-width:0 1px}"
		+ "	.curve_" + thisID + "_Bdygs1 {margin:0 5px; background:" + thisColor + ";border-bottom:solid " + borderColor + " 1px;}"
		+ "	.curve_" + thisID + "_Bdygs2 {margin:0 3px; border-width:0 2px}"
		+ "	.curve_" + thisID + "_Bdygs3 {margin:0 2px;}"
		+ "	.curve_" + thisID + "_Bdygs4 {height:2px; margin:0 1px}"
		+ "</STYLE>";
		
	if( thisSection == 'top' )
	{
		thisString += ""
			+ "	<div class='curve_" + thisID + "_" + thisSection + "'>"
			+ "		<div class='curve_" + thisID + "_Bdygs1'><b></b></div>"
			+ "		<div class='curve_" + thisID + "_Bdygs2'></div>"
			+ "		<div class='curve_" + thisID + "_Bdygs3'><b></b></div>"
			+ "		<div class='curve_" + thisID + "_Bdygs4'><b></b></div>"
			+ "	</div>";
	}
	else
	{
		thisString += ""
			+ "	<div class='curve_" + thisID + "_" + thisSection + "'>"
			+ "		<div class='curve_" + thisID + "_Bdygs4'><b></b></div>"
			+ "		<div class='curve_" + thisID + "_Bdygs3'></div>"
			+ "		<div class='curve_" + thisID + "_Bdygs2'><b></b></div>"
			+ "		<div class='curve_" + thisID + "_Bdygs1'><b></b></div>"
			+ "	</div>";
	}
		
	return thisString;
}


// 2007.08.31 KJD: Add Item
function Currency_ItemPrice( priceDiv, priceText, priceMsrp, priceCode, priceDesc, priceURL, priceMedia, disclaimer, pkgOptions )
{
	////alert("Currency_ItemPrice");
	Currency_AddDiv( priceDiv, priceText,priceMsrp, priceCode, priceDesc, priceURL, priceMedia, disclaimer, pkgOptions );
	
	
}

// 2007.08.31 KJD: Add the div name to the currency array
//AKD: Added more mrsp,disclaimer and package options
function Currency_AddDiv( divName, priceText,priceMsrp, priceCode, priceDesc, priceURL, priceMedia, disclaimer, pkgOptions )
{
	////alert("Currency_AddDiv");
	//////alert(" ----priceText :"+ priceText + "---priceDesc : "+ priceDesc +"---priceURL :"+  priceURL + "----disclaimer :" + disclaimer);
	var doAdd = 1;
	
	for( var i in Currency_Items )
	{
		if( i == divName )
		{
			doAdd = 0;
			Currency_Items[ i ][ 'count' ]++;
			
			// 2007.08.31 KJD: Add the currency info
			Currency_Items[ i ][ priceCode ]				= new Array();
			Currency_Items[ i ][ priceCode ][ 'priceText' ]	    = priceText;
			Currency_Items[ i ][ priceCode ][ 'priceDesc' ]	    = priceDesc;
			Currency_Items[ i ][ priceCode ][ 'priceURL' ]	    = priceURL;
			Currency_Items[ i ][ priceCode ][ 'priceMsrp' ]	    = priceMsrp;
			Currency_Items[ i ][ priceCode ][ 'disclaimer' ]	= disclaimer;
			Currency_Items[ i ][ priceCode ][ 'pkgOptions' ]	= pkgOptions;
			
			Currency_Items[ i ][ priceCode ][ priceMedia ]				= new Array();
			Currency_Items[ i ][ priceCode ][ priceMedia ][ 'priceText' ]	= priceText;
			Currency_Items[ i ][ priceCode ][ priceMedia ][ 'priceDesc' ]	= priceDesc;
			Currency_Items[ i ][ priceCode ][ priceMedia ][ 'priceURL' ]	= priceURL;
			Currency_Items[ i ][ priceCode ][ priceMedia ][ 'priceMsrp' ]	= priceMsrp;
			Currency_Items[ i ][ priceCode ][ priceMedia ][ 'disclaimer' ]	= disclaimer;
			Currency_Items[ i ][ priceCode ][ priceMedia ][ 'pkgOptions' ]	= pkgOptions;
			
			/*
			////alert("priceDiv :" + i + "priceCode :" + priceCode + "priceMedia :" + priceMedia + " URL :" 
				    + Currency_Items[ 'priceDiv' ][ priceCode ][ priceMedia ][ 'priceURL' ]);
			*/
			
		}
	}
	
	
	if( doAdd )
	{
		Currency_Items[ divName ]				= new Array();
		Currency_Items[ divName ]['default']	= priceCode;
		Currency_Items[ divName ]['count']		= 1;

		Currency_Items[ divName ][ priceCode ]					= new Array();
		Currency_Items[ divName ][ priceCode ][ 'priceText' ] 	= priceText;
		Currency_Items[ divName ][ priceCode ][ 'priceDesc' ] 	= priceDesc;
		Currency_Items[ divName ][ priceCode ][ 'priceURL' ]	= priceURL;
		Currency_Items[ divName ][ priceCode ][ 'priceMsrp' ]	= priceMsrp;
		Currency_Items[ divName ][ priceCode ][ 'disclaimer' ]	= disclaimer;
		Currency_Items[ divName ][ priceCode ][ 'pkgOptions' ]	= pkgOptions;

		Currency_Items[ divName ][ priceCode ][priceMedia]				= new Array();
		Currency_Items[ divName ][ priceCode ][priceMedia][ 'priceText' ]	= priceText;
		Currency_Items[ divName ][ priceCode ][priceMedia][ 'priceDesc' ]	= priceDesc;
		Currency_Items[ divName ][ priceCode ][priceMedia][ 'priceURL' ]	= priceURL;
		Currency_Items[ divName ][ priceCode ][priceMedia][ 'priceMsrp' ]	= priceMsrp;
		Currency_Items[ divName ][ priceCode ][priceMedia][ 'disclaimer' ]	= disclaimer;
		Currency_Items[ divName ][ priceCode ][priceMedia][ 'pkgOptions' ]	= pkgOptions;
		
		/*
		////alert("priceCode :" + priceCode + "priceMedia :" + priceMedia + " and URL :" 
			  + Currency_Items[ 'priceDiv' ][ priceCode ][priceMedia][ 'priceURL' ]);
		*/
	}
	
	// ////alert( 'added: ' + priceCode + " for " + divName + " = " + Currency_Items[ divName ][ priceCode ][ 'priceText' ] );
}

// 2007.08.31 KJD: Check to show Change Currency link
function Currency_Link( divName )
{
	////alert("Currency_Link");
	var thisString = "";
	
	// 2007.08.31 KJD: Check value
	
	// 2007.09.26 KJD: Check for value too
	try
	{
		if( Currency_Items[ divName ]['count'] > 1 )
		{
			thisString = "<a href=\"javascript:ShowChangeCurrency( '" + divName + "' )\">" + ChangeCurrencyText + "</a>";
		}
	}
	catch( e ){}
	
	document.getElementById( divName ).innerHTML = Currency_DisplayPrice( divName );

	
	return thisString;
}

// 2007.08.31 KJD: Populate the div with the array info
function Currency_PopulateDiv( divName )
{
	////alert("Currency_PopulateDiv");
	// 2007.08.31 KJD: Get the default type
	var currencydefault = Currency_Default( divName );
	var thisChecked		= "";
	var thisString 		= "";
	
	for( var i in Currency_Items[ divName ] )
	{
		if( ( i !== 'count' ) && ( i !== 'default' ) )
		{
		
			thisChecked = "";
			if( i == currencydefault )
			{
				thisChecked = " CHECKED";
			}
		
			thisString += "<br>"
				+ "<INPUT TYPE='RADIO' NAME='norton_currency' VALUE='" + i + "' ID='norton_currency" + i + "' onClick=\"Norton_CurrencySelect( '" + divName + "', this.value )\"" + thisChecked + ">"
				+ "<LABEL for='norton_currency" + i + "'>" 
				+ Currency_Items[ divName ][ i ][ 'priceDesc' ] 
				+ "</LABEL>";
		}
	}

	return thisString;
}


// 2007.08.31 KJD: Set the currency cookie
function Currency_SetCookie( thisValue )
{	
	Currency_createCookie( 'NortonCurrency', thisValue, 30 );
}



// 2007.08.31 KJD: Create the cookie
function Currency_createCookie( name, value, days )
{
	if( days )
	{
		var date = new Date();
		date.setTime( date.getTime() + ( days * 24 * 60 * 60 * 1000 ) );
		var Currency_expires = "; expires=" + date.toGMTString();
	}
	else
	{
		var Currency_expires = "";
	}
	
	document.cookie = name + "=" + value + Currency_expires + "; path=/";
}

// 2007.08.31 KJD: Read the cookie
function Currency_readCookie( name )
{
	var nameEQ	= name + "=";
	var ca		= document.cookie.split( ';' );
	for(var i = 0; i < ca.length; i++ )
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	
	return null;
}

// 2007.08.31 KJD: Clear the cookie
function Currency_eraseCookie(name)
{
	Currency_createCookie(name,"",-1);
}


// 2007.08.31 KJD: Show default price
function Currency_DisplayPrice( divName )
{
	////alert("Currency_DisplayPrice");
	thisString			= "";
	

	// 2007.09.26 KJD: Check if the string exists, if not, show default
	try
	{
		var currencytype	= Currency_Default( divName );
		thisString 			= Currency_Items[ divName ][ currencytype ][ 'priceText' ];
	}
	catch( e )
	{
		try
		{
			var currencytype	= Currency_Items[ divName ]['default'];
			thisString			= Currency_Items[ divName ][ currencytype ][ 'priceText' ];
		}
		catch( e ){}
	}

	// ////alert( 'divName' + divName + ": " + thisString );
	return thisString;
}

// 2007.08.31 KJD: Get the Default currency
function Currency_Default( divName )
{
	////alert("Currency_Default");
	//////alert("calling curency default : " + divName);
	var currencytype	= "";
	
	// 2007.08.31 KJD: Check for cookie
	var cookievalue = Currency_readCookie( 'NortonCurrency' );
	if( cookievalue )
	{
		currencytype = cookievalue;
	}
	else
	{
		currencytype = Currency_Items[ divName ]['default'];
	}	
	
	// 2007.09.06 KJD: Check if currency exists
	if( Currency_Exists( currencytype ) )
	{
		return currencytype;
	}
	else
	{
		return  Currency_Items[ divName ]['default'];
	}
}

// 2007.09.06 KJD: Check if that currency exists
function Currency_Exists( currencytype )
{
	////alert("Currency_Exists");
	for( var thisDiv in Currency_Items )
	{
		for( var thisType in Currency_Items[ thisDiv ] )
		{
			if( ( thisType != 'count' ) && ( thisType != 'default' ) && ( thisType == currencytype ) )
			{
				return true;
			}
		}
	}

	return false;
}


// 2007.10.01 KJD: Set the currency for a product
function Currency_SetCurrency( countrytype, currencyname, buttonname, secondline, thisPrice, thisMsrp, thisURL, disclaimer, pkgOptions )
{ 	////alert("Currency_SetCurrency");
	// 2007.10.01 KJD: Determine currency and buttons to show
	Currency_SetButton( countrytype, currencyname, buttonname, secondline, thisPrice,thisMsrp, thisURL, disclaimer, pkgOptions );
	
	
	Currency_ItemPrice( 'priceDiv', thisPrice,thisMsrp, countrytype, currencyname, thisURL, buttonname, disclaimer, pkgOptions);
}

// 2007.10.01 KJD: Determine currency and buttons to show
//AKD :Added more functionality to take mrsp disclamer and pkage options
function Currency_SetButton( countrytype, currencyname, buttonname, secondline, thisPrice,thisMsrp, thisURL, disclaimer, pkgOptions )
{	//////alert("Currency_SetButton");
	if( !( Currency_CheckCountry( countrytype ) ) )
	{
		Currency_ProductButtons[ countrytype ] = new Array();
	}

	Currency_ProductButtons[ countrytype ][ Currency_ProductButtons[ countrytype ].length ] = countrytype + "####" + currencyname + "####" + buttonname + "####" + secondline + "####" + thisPrice + "####" + thisMsrp + "####" + thisURL + "####" + disclaimer + "####" + pkgOptions;
}

// 2007.10.01 KJD: Check if country exists
function Currency_CheckCountry( countrytype )
{	////alert("Currency_CheckCountry");
	try
	{
		if( Currency_ProductButtons[ countrytype ] )
		{
			return true;
		}
	}
	catch( e ){}
	
	return false;
}

// 2007.10.01 KJD: Create the buttons
function Currency_CreateButtons( thisCountry )
{
	//alert("Currency_CreateButtons");
	var thisString = "";
	
	if( typeof thisCountry == 'undefined' )
	{
		var thisCountry = PageElements['country'];
	}
	
	for( var i in Currency_ProductButtons )
	{
		// 2007.10.01 KJD: Check if country matches
		if( i == thisCountry )
		{
			for( var j = 0; j < Currency_ProductButtons[ i ].length; j++ )
			{
				var thisValues = Currency_ProductButtons[ i ][ j ].split( '####' );
				
				// If there is a package selection drop-down, lets construct an id for it.
				var radioId = "button" + i + "" + j;
				var selectorId = "pkgSelect" + i + "" + j;
				
				thisString += "<INPUT TYPE='radio' NAME='currencybutton'" 
				           + " VALUE=" + "'" + thisValues[2] + "'" 
						   + " ID='" + radioId + "'"
						   // + " onClick=\""  + "Currency_ShowPrice('" + thisValues[ 4 ] + "')"  + "\"";
						   // AKD: Changed to take the strike discliamer and drop down
						   + " onClick=\""  + " Currency_ShowPrice('" + thisValues[ 4 ] + "'); "
						                    + " Currency_ShowMsrp( '" + thisValues[ 5 ] + "' ); "
											+ " Currency_SetURL( '" + thisValues[ 6 ] + "' ); "
											+ " Currency_ShowDisclaimer( '" + thisValues[7] + "'); "
											+ " ShowBtm_RadioValue('" + thisValues[ 2 ] + "'); "
											+ " Currency_SelectBuyPackage('" + selectorId + "');"
											+ "\"";
				
				if( !( j ) )
				{
					Currency_ShowMsrp( "" + thisValues[ 5 ] );
					// 2007.10.01 KJD: Set default price and select 1st
					Currency_ShowPrice( "" + thisValues[ 4 ] );
					thisString += " CHECKED";
					
					AddToCartURL = thisValues[ 6 ];
					
					Currency_ShowDisclaimer(thisValues[7]);
				}
					
				thisString	+= ">"
				
				thisString += "<LABEL FOR='button" + i + "" + j + "'>";
				if (!(j)) {
					thisString +=  "<strong>" + thisValues[ 2 ] + "</strong>";
					// Bottom box - Set value for the product name
					if (!thisValues[8]) {
						ShowBtm_RadioValue(thisValues[2]);
					}
					
				} else {
					thisString += thisValues[2];
				}
					
				
				if( thisValues[ 3 ] )
				{
					thisString += "<br>"+ "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ thisValues[ 3 ];
				}
				
				thisString += "</LABEL>";
				
				if (thisValues[8])
				{
					javascript:var iarr = eval(thisValues[8]);
					thisString += "&nbsp;&nbsp;&nbsp;"+"<SELECT "
				   				  + " ID='" + selectorId + "'"
					              + "onChange=\"document.getElementById('" + radioId + "').checked='true';"
											   + " Currency_SelectBuyPackage('" + selectorId + "');\"" 
					              + "onFocus=\"document.getElementById('" + radioId + "').checked='true';"
											   + " Currency_SelectBuyPackage('" + selectorId + "');\"" 
								  + ">";
					for (var k = 0; k < iarr.length; k++)
					{
						var optVal = iarr[k].innerTitle;
//						//alert("Option (innerTitle) :" + iarr[k].innerTitle);
						
						thisString += "<OPTION value=\"" + thisValues[8] + "\""
						if (k == 0)
						{
							thisString += " selected=\"true\"";
						}
						thisString += ">" + optVal + "</OPTION>";
					}
					thisString += "</SELECT>";
					
					if (!(j))
					{
						javascript:var iarr = eval(thisValues[8]);
						Currency_ShowPrice( iarr[0].innerPrice);
						Currency_ShowMsrp(iarr[0].innerMSRP);
						Currency_SetURL( iarr[0].innerURL );
						Currency_ShowDisclaimer(iarr[0].innerDisclaimer);
						// Bottom box - set value for the product name - first selected item
						if (iarr.length > 0) {
							ShowBtm_RadioValue(thisValues[2] + " - " + iarr[0].innerTitle);
						}
					}
				}
				
				thisString +="<br>";
				
			}
		}
	}
	//////alert("Set it in radiobuttons :" + thisString);
	document.getElementById( 'radiobuttons' ).innerHTML = thisString;
}

//AKD: Added for package options 
function Currency_SelectBuyPackage(selectorId) {

	var selectEl = document.getElementById(selectorId);
	if (selectEl) {
		var selectedIndex = selectEl.selectedIndex;
		var pkgOption = selectEl.options[selectEl.selectedIndex].value;
		javascript:var iarr = eval(pkgOption);
		Currency_ShowPrice( iarr[selectedIndex].innerPrice);
		Currency_ShowMsrp(iarr[selectedIndex].innerMSRP);
		Currency_SetURL( iarr[selectedIndex].innerURL );
		Currency_ShowDisclaimer(iarr[selectedIndex].innerDisclaimer);
		
		var radioValue = Evaluate_RadioTextFromPkgSelect(selectorId);
		var btmValue = radioValue + " - " + iarr[selectedIndex].innerTitle;
		ShowBtm_RadioValue(btmValue);
		
		//alert("setting for selector ID : " + selectorId);
	}
}

function Evaluate_RadioTextFromPkgSelect(selectorId) {
	var selectorPrefix = 'pkgSelect';
	var radioPrefix = 'button';
	
	if (selectorId && selectorId.indexOf(selectorPrefix) >= 0) {
		var selectorSuffix = selectorId.replace(selectorPrefix, "");
		var radioId =  radioPrefix + selectorSuffix;
		var radioEl = document.getElementById(radioId);
		return radioEl.value;
	}
	
	return "REMOVE ME";
}


// 2007.10.09 KJD: Set the URL
function Currency_SetURL( thisURL )
{
	AddToCartURL = thisURL;
}


// AKD: Show the price
function Currency_ShowPrice( thisPrice )
{	//alert("Currency_ShowPrice");
	if(thisPrice!=""){
		
		
		document.getElementById( 'priceDiv' ).innerHTML = thisPrice;
		document.getElementById( 'priceDiv' ).style.display="block";
		/////////////////////////////////////////////////////////
		document.getElementById( 'priceDivbtm' ).innerHTML = thisPrice;
		document.getElementById( 'priceDivbtm' ).style.display="block";
		//////////////////////////////////////////////////////////
	// KEEEP THIS CODE, UNCOMMENT FOR PRODUCTION
	 FormatPrice( 'priceDiv' );
	  FormatPrice( 'priceDivbtm' );
	}
	else{
		document.getElementById( 'priceDiv' ).style.display="none";
		document.getElementById( 'now' ).style.display="none";
		//////////////////////////////////////////////////////////
		document.getElementById( 'priceDivbtm' ).style.display="none";
		document.getElementById( 'nowbtm' ).style.display="none";
		//////////////////////////////////////////////////////////
	}
}
// AKD: Show the strike price
function Currency_ShowMsrp( thisMsrp )
{	
		//alert("Currency_ShowMsrp");
	if(thisMsrp!=""){
		
		var newMsrp = "<strike>"+thisMsrp+"</strike>";
		document.getElementById( 'was' ).style.display="block";
		document.getElementById( 'msrp' ).style.display="block";
		document.getElementById( 'now' ).style.display="block";


		document.getElementById( 'was' ).innerHTML = wasText;
		document.getElementById( 'msrp' ).innerHTML = newMsrp;
		document.getElementById( 'now' ).innerHTML = nowText;
		///////////////////////////////////////////////////////////
		
		document.getElementById( 'wasbtm' ).style.display="block";
		document.getElementById( 'msrpbtm' ).style.display="block";
		document.getElementById( 'nowbtm' ).style.display="block";

////alert("wasbtm :" + document.getElementById('wasbtm') + " ... wasText :" + wastText);
		document.getElementById( 'wasbtm' ).innerHTML = wasText;
		document.getElementById( 'msrpbtm' ).innerHTML = newMsrp;
		document.getElementById( 'nowbtm' ).innerHTML = nowText;
		
		///////////////////////////////////////////////////////////
	}
	else{
		
		document.getElementById( 'now' ).style.display="none";
		document.getElementById( 'msrp' ).style.display="none";
		document.getElementById( 'was' ).style.display="none";
		////////////////////////////////////////////////////////
		
		document.getElementById( 'nowbtm' ).style.display="none";
		document.getElementById( 'msrpbtm' ).style.display="none";
		document.getElementById( 'wasbtm' ).style.display="none";
		
		///////////////////////////////////////////////////////
	}
}
function Currency_ShowDisclaimer( disclaimer) 
{	//alert("Currency_ShowDisclaimer");
	document.getElementById( 'discountNote' ).innerHTML = disclaimer;
	
	///////////////////////////////////////////////////////////
	document.getElementById( 'discountNotebtm' ).innerHTML = disclaimer;
	////////////////////////////////////////////////////////////////
}

function ShowBtm_RadioValue(radiotext) 
{	//alert("radiotext");
	var str="<strong>"+radiotext+"</strong>";
	
	///////////////////////////////////////////////////////////
	document.getElementById( 'radiotextbtm' ).innerHTML = str;
	////////////////////////////////////////////////////////////////
}

// 2007.10.01 KJD: Check for multiple currencies.
function Currency_CheckCurrencies()
{	//alert("Currency_CheckCurrencies");
	var thisCount = 0;
	for( var i in Currency_ProductButtons ){ thisCount++; }

	if( thisCount > 1 )
	{
		return true;
	}

	return false;
}


// 2007.10.01 KJD: Display change currency
function Currency_DisplaySelect()
{	//alert("Currency_DisplaySelect");
	if( Currency_CheckCurrencies() )
	{
		// ////alert( 'multiple currencies, show selector');
		document.getElementById( 'CurrencySelect' ).innerHTML = "<a href=\"javascript:ShowChangeCurrency( 'priceDiv' )\">" + ChangeCurrencyText + "</a>";
	}
}

// Format Price if . put it as superscript 
function FormatPrice( divID )
{	//alert("FormatPrice");
	var thisString = document.getElementById( divID ).innerHTML;
	if(thisString.indexOf(".")!=-1){

	var thisArray = thisString.split( "." );
	if( !( thisArray[1] ) )
	{
		var thisArray = thisString.split( "," );
	}

	thisString = thisArray[0]+"."+ "<span>" + thisArray[1] + "</span>";
	}
	document.getElementById( divID ).innerHTML = thisString;
}
