var photoData = new Array();
var shownPhoto = new Array();
var photoBlock = new Array();
var photoArray = new Array();
var realmCurrency = null;
var isAdminString = document.location.search.indexOf("do=1") > -1;


// Magnify a thumbnail image in its block's medium-sized header.
function magnify(id)
{
	var block = photoBlock[id];
	if (block == null)
		return;

	var img = document.getElementById('photoBlock' + block);
	var caption = document.getElementById('caption' + block);	

	var data = photoData[id];
	if (img != null)
	{	
		if(document.all && img.filters) {
		    img.filters.blendTrans.apply();
		}
				
		img.src = data[1];
		img.width = data[3];
		img.height = data[4];
		
		if(document.all && img.filters) {
		    img.filters.blendTrans.play();
		}		
	}
	
	if (caption != null && data[0] != null)
	{
		caption.innerHTML = data[0];
	}
	
	var t1 = document.getElementById("thumb" + shownPhoto[block]);
	if(t1 != null)
	    t1.className = "smallPhoto";
	
	var t2 = document.getElementById("thumb" + id);
	if(t2 != null)
	    t2.className = "smallPhotoSelected"; 


	shownPhoto[block] = id;
}

// Show the full-sized version of an image in a popup window.
function showFull(block)
{
	var data = photoData[shownPhoto[block]];
	var w = window.open("", "showFull",
			"width=720" +
			",height=650" +
			",resizable,scrollbars", true);
	w.document.open();
	w.document.write('<html><head><title>');
	if (eqDesc != null)
		w.document.write(eqDesc);
	w.document.write(" "+JS_photoGalle_PhotoEq_6850);	
	w.document.write('</title><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body bgcolor=#3F3F3F>');
	w.document.write('<table border=0 cellpadding=1 cellspacing=0 width=95% align=center><tr valign=top><td bgcolor=#333333><table border=0 cellpadding=5 cellspacing=10 width=100% bgcolor=ffffff><tr><td><table border=0 cellpadding=0 cellspacing=0 width=100% bgcolor=FFFFFF><tr valign=top><td>');
	
	w.document.write('<table border=0 cellpadding=3 cellspacing=0><tr bgcolor=e7effa><td valign=top bgcolor=#DFDFDF>');
	if(data[6] > 480) {
		w.document.write('<img id=fullPhoto src="' + data[2] + '" height=480 lowsrc="' + data[1] + '" style="filter:blendTrans(duration=1)" />');	
	} else {
		w.document.write('<img id=fullPhoto src="' + data[2] + '" width="' + data[5] +
						'" height="' + data[6] + '" lowsrc="' + data[1] + '" style="filter:blendTrans(duration=1)" />');	
	}					
	w.document.write('</td></tr></table>');
		
	var fullPhotoIndex = -1;
	var total = photoArray.length;
	for(i=0; i<total; i++) {
		if(photoArray[i] == shownPhoto[block]) {
		   fullPhotoIndex = i;
		}
	}			
			
	w.document.write('<table cellpadding=0 cellspacing=0 width=100%><tr valign=top><td><table border=0 cellpadding=1 cellspacing=1 width=100% bgcolor=#ffffff><tr><td><table border=0 cellpadding=5 cellspacing=4 width=100%><tr><td valign=top width=27% align=right>');	
	w.document.write('<input type=image title="'+JS_photoGalle_PhotoEq_6851+'" id=prev src=/images/button_prev.gif border=0 onClick="prev();">');
	w.document.write('&nbsp;&nbsp;&nbsp;');
	w.document.write('<input type=image title="' + JS_photoGalle_PhotoEq_6853 + '" id="play" src="/images/button_play.gif" border=0 onClick="play();">');
	w.document.write('&nbsp;&nbsp;&nbsp;');
	w.document.write('<input type=image title="' + JS_photoGalle_PhotoEq_6852 + '" id=next src=/images/button_next.gif border=0 onClick="next();">');	
	w.document.write('<span id="slideTimer">&nbsp;</span>');
	w.document.write('</td><td valign=top width=72%><table border=0 cellpadding=0 cellspacing=0 width=100% style="font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px;">');
	
	if (data[0] != null && data[7] != null) {
		w.document.write('<tr><td valign=top><span id=fullPhotoText1>');
		w.document.write((fullPhotoIndex+1) +" ");
		w.document.write(JS_photoGalle_PhotoEq_6855);
		w.document.write(" "+total+" | ");
  		w.document.write('<b>'+data[7]+'</b>' + data[0]);
		w.document.write('</span></td></tr>');	
	}
  	
  	if (data[8] != null) {  		
	  	w.document.write('<tr><td><table style="font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px;" valign=top cellpadding=0 cellspacing=0><tr><td width=49></td><td><span id=fullPhotoText2>');	  	
  		w.document.write('<i>'+data[8]+'</i>');
		w.document.write('</span></td></tr></table></td></tr>');			
  	} 	
  	
	w.document.write('<script language="Javascript"> var playCounter=0; var timer; var timerSecs = 3; var running=false; var t = window.opener.photoArray.length; var photoIndex ='+fullPhotoIndex+';');
	w.document.write('disablePrev(); disableNext();');		
	w.document.write('function next() { ');		
	w.document.write(' if(running) { running = false; disableTimerCount(); } ');		
	w.document.write(' ++photoIndex; ');		
	w.document.write('if( (photoIndex) == 1) { enablePrev(); }');
	w.document.write('if( (photoIndex+1) == t) { disableNext(); running = false;  }');
	w.document.write('display(photoIndex);');				
	w.document.write('}');				
	w.document.write('function prev() { ');
	w.document.write(' if(running) { running = false; disableTimerCount(); } ');			
	w.document.write('enableNext();');
	w.document.write('--photoIndex;');
	w.document.write('disablePrev();');
	w.document.write('display(photoIndex);');
	w.document.write('}');				
	
	w.document.write('function display(j) { ');
	w.document.write('if (window.opener != null && !window.opener.closed) { } else { window.close(); }');
	w.document.write('var d = window.opener.photoData[window.opener.photoArray[j]];');						
	w.document.write('if (d == null) {return;} ');
	w.document.write('var img = document.getElementById(\'fullPhoto\');');
	w.document.write('if (img != null) { if(document.all && img.filters) { img.filters.blendTrans.apply(); }');
	w.document.write('img.src = d[2];');
	w.document.write(' if(d[6] > 480) { img.height = 480; } else { img.width = d[5]; img.height = d[6]; }  '); 
	w.document.write('if(document.all && img.filters) { img.filters.blendTrans.play(); } ');	
	w.document.write('}');		
    w.document.write('var text1 = document.getElementById(\'fullPhotoText1\');');
    w.document.write('if (text1 != null && d[7] != null && d[0] != null) { text1.innerHTML = (j+1)+\' '  + JS_photoGalle_PhotoEq_6855+  ' \' +t+" | "+"<b>"+d[7]+"</b>"+d[0]; }');
    w.document.write('var text2 = document.getElementById(\'fullPhotoText2\');');
    w.document.write('if (text2 != null && d[8] != null) { text2.innerHTML = "<i>"+d[8]+"</i>"; }');	
	w.document.write('}');				
	
	w.document.write('function play() { var text3 = document.getElementById(\'slideTimer\'); if((photoIndex+1) == t) {enableNext(); photoIndex=-1;  } if(photoIndex == 0) {enablePrev(); } ');
	w.document.write('if(playCounter++%2==0) { document.getElementById("play").src="/images/button_pause.gif"; document.getElementById("play").title="'+ JS_photoGalle_PhotoEq_6854 +'"; running=true; ');			
   	w.document.write('\nif (text3 != null) { text3.innerHTML = "<table cellpadding=0 cellspacing=0 align=center style=\'font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px; \'><tr><td width=9></td><td><img src=/images/button_incr_minus.gif onClick=decrTimer();></td><td width=63 align=center><span id=timerCountText>"+timerSecs+"</span> ');
	w.document.write(JS_ir_seconds_8701);
	w.document.write('</td><td align=left><img src=/images/button_incr_plus.gif onClick=incrTimer();></td><tr></table>"; }');		
	w.document.write('slideShow();');		
	w.document.write('} else { ');			
	w.document.write('if (text3 != null) { text3.innerHTML = "" }');
	w.document.write('clearTimeout(timer);');	
	w.document.write('document.getElementById("play").src="/images/button_play.gif"; document.getElementById("play").title="'+ JS_photoGalle_PhotoEq_6853 +'"; running=false;');		
	w.document.write('} }');		
	
	w.document.write('function slideShow() { ');		
	w.document.write('if(running) { ');		
	w.document.write('nextSlide();');		
	w.document.write('timer = setTimeout("slideShow()", timerSecs * 1000);');					
	w.document.write('} else { playCounter++; ');
	w.document.write('clearTimeout(timer);');	
	w.document.write('document.getElementById("play").src="/images/button_play.gif"; document.getElementById("play").title="'+ JS_photoGalle_PhotoEq_6853 +'"; running=false; disableTimerCount();');			
	w.document.write('}');
	w.document.write('}');
	
	w.document.write('function nextSlide() { ');		
	w.document.write(' ++photoIndex; ');		
	w.document.write('if( (photoIndex) == 1) { enablePrev(); }');
	w.document.write('if( (photoIndex+1) == t) { disableNext(); running = false; }');
	w.document.write('display(photoIndex);');				
	w.document.write('}');	


	w.document.write('function enableNext() { ');
	w.document.write('if( (photoIndex+1) == t) { document.getElementById("next").src = "/images/button_next.gif"; document.getElementById("next").disabled = false; }');
	w.document.write('}');

	w.document.write('function disableNext() { ');
	w.document.write('if( (photoIndex+1) == t ) { document.getElementById("next").src = "/images/button_next_disabled.gif"; document.getElementById("next").disabled = true; }');	
	w.document.write('}');

	w.document.write('function enablePrev() { ');
	w.document.write('if( (photoIndex) == 1) { document.getElementById("prev").src = "/images/button_prev.gif"; document.getElementById("prev").disabled = false; }');
	w.document.write('}');

	w.document.write('function disablePrev() { ');
	w.document.write('if( (photoIndex) == 0 ) { document.getElementById("prev").src = "/images/button_prev_disabled.gif"; document.getElementById("prev").disabled = true; }');	
	w.document.write('}');
	
	w.document.write('function decrTimer() { ');
	w.document.write('if(timerSecs > 1) { timerSecs--;');
	w.document.write('var timerText = document.getElementById(\'timerCountText\');');
   	w.document.write('if (timerText != null) { timerText.innerHTML = timerSecs; }');	
	w.document.write('clearTimeout(timer);');   	
	w.document.write('timer = setTimeout("slideShow()", timerSecs * 1000);');					
	w.document.write('} }');		
	
	w.document.write('function incrTimer() { ');
	w.document.write('if(timerSecs < 20) { timerSecs++;');
	w.document.write('var timerText = document.getElementById(\'timerCountText\');');	
   	w.document.write('if (timerText != null) { timerText.innerHTML = timerSecs; }')	
	w.document.write('clearTimeout(timer);');   	
	w.document.write('timer = setTimeout("slideShow()", timerSecs * 1000);');					
	w.document.write('} }');	
	
	w.document.write('function disableTimerCount() { ');
	w.document.write('var text4 = document.getElementById(\'slideTimer\'); if (text4 != null) { text4.innerHTML = ""; }');		
	w.document.write('}');

	w.document.write('</script>');	  	  	  		
	w.document.write('</table></td></tr></table></td></tr></table>');	
	w.document.write('</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><td><table style="font-family: Tahoma, Verdana, Arial, Helvetica; border: #cccc99 solid 1px; background: #FFFFCC; font-size: 11px;"><tr><td>'+ JS_photoGalle_PhotoEq_6856 +'</td></tr></table></td></tr></table>');	
	w.document.write('</body></html>');
	w.document.close();
	
	if (w != null)
		w.focus();			
}

// Highlight an inspection line item and (possibly) its associated photo.
function highlightLineItem(id)
{
	var lineItemRow = document.getElementById("lineItem" + id);
	if (lineItemRow != null) {
		lineItemRow.oldClass = lineItemRow.className;
		lineItemRow.className = "tableDataHighlighted";
	}

	var thumb = document.getElementById("thumb" + id);
	if (thumb != null) {
		var block = photoBlock[id];
		if (shownPhoto[block] != id)
			thumb.className = "smallPhotoHighlighted";
	}
}

// Unhighlight an inspection line item and (possibly) its associated photo.
function unhighlightLineItem(id)
{
	var lineItemRow = document.getElementById("lineItem" + id);
	if (lineItemRow != null) {
		lineItemRow.className = lineItemRow.oldClass;
	}

	var thumb = document.getElementById("thumb" + id);
	if (thumb != null) {
		var block = photoBlock[id];
		if (shownPhoto[block] == id)
			thumb.className = "smallPhotoSelected";
		else
			thumb.className = "smallPhoto";
	}
}

function showUser(userid) {
	var ww = window.open('/jsp/cca/detailuser.jsp?userId='+userid,'du','width=450,height=425,resizable,scrollbars,dependent');
	if (ww != null)
		ww.focus();
}

function administer(equipId) {
	var ww = window.open('/jsp/acct/administer.jsp?equipId='+equipId,'admin'+equipId,'width=750,height=590,resizable,scrollbars,dependent');
	if (ww != null)
		ww.focus();
}

function emailFriend(equipId) {
	var ww = window.open('/jsp/mail/emailFriend.jsp?equipId='+equipId,'emailFriend'+equipId,'width=500,height=500,resizable,scrollbars,dependent');
	if (ww != null)
		ww.focus();
}

function printWindow(equipId) {
	var ww=window.open('/jsp/equip/printBrochure.jsp?equipId='+equipId,
					'printWindow'+equipId,
					'width=680,height=500,directories=yes,location=no,'+
						'menubar=yes,scrollbars=yes,status=yes,toolbar=yes,'+
						'resizable=yes');
    if (ww!=null)
		ww.focus();
}

function editTitle(eqId, flag, titleStr){
	if(titleStr.length > 0)
		titleStr = titleStr.replace(/#/g,"%23");

	var w2 = window.open('/jsp/include/editTitle.jsp?from=equip&eqId='+eqId+'&titleFlag='+flag+'&titleFlag2='+flag+'&title='+titleStr, 'EditTitle', 'width=500,height=320,resizable,scrollbars');
	if (w2!=null)
		w2.focus();
}

function editCanExport(eqId, sellerId) {
	var w2 = window.open('/jsp/include/editCanExport.jsp?equipId='+eqId+'&sellerId='+sellerId, 'EditCanExportFlag', 'width=500,height=320,resizable,scrollbars');
	if (w2!=null)
		w2.focus();
}

function editARBDisclosureFlag(eqId) {
	var w2 = window.open('/jsp/include/editARBDisclosure.jsp?equipId='+eqId, 'EditCaARBFlag', 'width=500,height=320,resizable,scrollbars');
	if (w2!=null)
		w2.focus();
}

function showPriorAucHistory(eq, sId) {
	var ww=window.open('/jsp/equip/priorAucHistory.jsp?equipId=' + eq + '&sellerId=' + sId,'ah','width=540,height=390,resizable,scrollbars,dependent');
	if (ww!=null)
		ww.focus();
}

function loaded() {
	if (self.init_page)
		init_page();
}

function requireRegistration(equipId, h) {

	if (!getCookie("login") && !getCookie("loggedin") && !isTrialValid(equipId) && !isLandingPage() && (!document.URL || document.URL.search(/\/jsp\/s\/item\/.*\/011907/i) < 0)) {
		window.parent.location.replace("/jsp/acct/reg_login.jsp?page=equip&id="+equipId+"&h="+h);
	}
}


function isLandingPage() {

	if (!document.referrer) return true;

	if (document.referrer.search(/http:\/\/.*\.ironplanet\./i) == 0) return false;

	return true;
}


function isTrialValid(equipId) {	

	if(typeof maxNbOfTrialItems != 'undefined')
		itemMax = maxNbOfTrialItems;
	else
		itemMax = 2;

	if(itemMax == 0)
		return false;
		
	var visitedItems = getCookie("favorites");
	var regex = /[0-9]+/;
	var wasVisited = false;
	var itemMax;
	if(visitedItems) {
		var i = 0;
		var info;
		while(!wasVisited && (info=regex.exec(visitedItems))) {
			i = i + 1;
			wasVisited = (info[0] == equipId);
			visitedItems = visitedItems.replace(regex, ",");
		}
		if(!wasVisited) {
			if(i >= itemMax) {				
				return false;
			} else
				setCookie("favorites", getCookie("favorites") + "," + equipId);
		} 
	} else {
		setCookie("favorites", equipId);
	}
	return true;
}

function setCookie(name, value) {
	var today = new Date();
	today.setTime(today.getTime());
	var expires = 10000 * 1000 * 60 * 60 * 24;
	var expires_date = new Date( today.getTime() + (expires) );
    document.cookie= name + "=" + escape(value) +
        "; expires=" + expires_date.toGMTString() +
        "; path=/";
}

function tipsWindow(url, name, w, h) {
	ww=window.open(url, name, 'width='+w+',height='+h);
    if (ww!=null) ww.focus();
}

function timeRemaining (milliseconds, extflag) {
   var seconds = Math.floor(milliseconds / 1000);
   var rem_sec1 = Math.floor(seconds % 86400);
   var rem_sec2 = Math.floor(rem_sec1 % 3600);
   var days =  Math.floor(seconds / 86400);
   var hours = Math.floor(rem_sec1 / 3600);

   var min = Math.floor(rem_sec2 / 60);
   var sec = Math.floor(rem_sec2 % 60);

   if (days > -1) {
        if (days == 1 && hours == 0) {
           days = 0;
           hours = 24;
           }

        else if (days == 0 && hours == 1 && min == 0) {
           hours = 0;
           min = 60;
           }

        else if (days == 0 && hours == 0 && min == 1 && sec == 0) {
           min = 0;
           sec = 60;
           }

        dayString  = days  + (days == 1 ? " "+JS_ir_day_8705 : " "+JS_ir_days_8706);
        hourString = hours + (hours== 1 ? " "+JS_ir_hour_8696: " "+JS_ir_hours_8697);
        minuteString = min + ( min == 1 ? " "+JS_ir_minute_8698 : " "+JS_ir_minutes_8699);

        if (days == 0) {
            if (hours == 0) {
                if (min == 0) return JS_item_Lesstha_6464;
                return minuteString + (extflag == 1 ? " "+JS_bidHistory_extende_8883 : "");
                }
            else
                return hourString + (min > 0 ? ", "+minuteString : "");
            }
        else
            {
            //return dayString;
            if (min > 0) {
               hours = hours + 1;
               hourString = hours + (hours== 1 ? " hour": " hours");
            }
            
            return dayString + (hours > 0 ? ", "+hourString : "");
        }
    }
   return (JS_item_Notimel_8718);
}

function showControlPanel2(wname,fname, eqId) {
	
	if (fname.indexOf('?') > -1)
		fname += '&equipId='+eqId;
	else
		fname += '?equipId='+eqId;
	

	wname = wname.replace(/ /g, '');	
	
	ww = window.open(fname, wname, 'width=700,height=680,resizable,scrollbars,status');
			
	if (ww!=null) {
		ww.focus();
		ww.location.href = fname;
	}
}

function currConvert(eqId, curr) {
	var w = window.open('/jsp/equip/currConverter.jsp?calculate=yes&equipId='+eqId+'&fromCurrency='+curr,'convert',
		'width=425,height=80,scrollbars,resizable');
	if (w != null) 
		w.focus();

}

function getConvRate(fromCurrency, toCurrency)
{
	var d = 0.0;
	var usdEQ = 1;
	
	if ("USD" != fromCurrency) {
		if ("AUD" == fromCurrency)
			usdEQ = 1 / currRates["AUD"];
		else if ("EUR" == fromCurrency)
			usdEQ = 1 / currRates["EUR"];
		else if ("GBP" == fromCurrency)
			usdEQ = 1 / currRates["GBP"];
		else if ("CAD" == fromCurrency)
			usdEQ = 1 / currRates["CAD"];
	}
	
	if ("USD" != toCurrency) {
		if ("AUD" == toCurrency)
			d = usdEQ * currRates["AUD"];
		else if ("EUR" == toCurrency)
			d = usdEQ * currRates["EUR"];
		else if ("GBP" == toCurrency)
			d = usdEQ * currRates["GBP"];
		else if ("CAD" == toCurrency)
			d = usdEQ * currRates["CAD"];
	}
	else {
		d = usdEQ;
	}
	
	return d;
}

function convDollarStr(value, ic, pc, rc)
{
	var convRate = getConvRate(ic, pc);
	var newValue = Math.floor(value * convRate);
	return dollarString(newValue, getPrefCurrency(rc));
}

function getPrefCurrency(rc) {
	pc = getCookie("curr");
	if (pc == null) {
		return rc;
	}
	
	if (pc.indexOf("US") != -1) {
		return "USD";
	}
	else if (pc.indexOf("GB") != -1) {
		return "GBP";
	}
	else if (pc.indexOf("AU") != -1) {
		return "AUD";
	}
	else if (pc.indexOf("CA") != -1) {
		return "CAD";
	}
	else if (pc.indexOf("IE") != -1) {
		return "EURO-IE";
	}
	else if (pc.indexOf("NL") != -1) {
		return "EURO-NL";
	}
	else if (pc.indexOf("DE") != -1) {
		return "EURO-DE";
	}
	else if (pc.indexOf("FR") != -1) {
		return "EURO-FR";
	}
}

function getCurrInfoForRealm()
{
	var cvc = getCookie("curr");
	if (cvc == null) {	
		cvc = realmCurrency;
		if (cvc.match(/^EURO/))
			return 'EUR';
		else 
			return cvc;
	}
	
	var pc = '';
	if (cvc.indexOf("EUR") != -1) 
		pc = 'EUR';
	else if (cvc.indexOf("GB") != -1)
		pc = 'GBP';
	else if (cvc.indexOf("AU") != -1)
		pc = 'AUD';
	else if (cvc.indexOf("CA") != -1)
		pc = 'CAD';
	else
		pc = "USD";
	
	return pc;
}

function dollarString(value, currency)
{
	var price;
	var tmp;

	tmp = value % 1000;
	price = tmp.toString();
	if (value >= 1000) {
		tmp = Math.floor((value % 1000000) / 1000);
		price = tmp.toString() + threeDigitize(price, currency);
	}
	if (value >= 1000000) {
		tmp = Math.floor((value % 1000000000) / 1000000);
		price = tmp.toString() + threeDigitize(price, currency);
	}


   var currencyCode = '';
   var currencySign = '$';
   var rs = currencySign + price;

   if (currency.toString() == "USD".toString()) {
   	  currencyCode = 'US ';
      currencySign = '$';
   }
   else if (currency.toString() == "AUD".toString()) {
   	  currencyCode = 'AU ';
      currencySign = '$';
   }
   else if (currency.toString() == "CAD".toString()) {
   	  currencyCode = 'C';
      currencySign = '$';
   }
   else if (currency.toString() == "GBP".toString()) {
      currencySign = '&pound;';
   }
   else if (currency.toString().indexOf('EURO') > -1) {
      currencySign = '&euro;';
   }

   if (JS_ir_formatLocale.indexOf('es_ES') > -1 
   		|| JS_ir_formatLocale.indexOf('de_') > -1 
   		|| JS_ir_formatLocale.indexOf('fr_') > -1
   		|| JS_ir_formatLocale.indexOf('pl_') > -1
   		|| JS_ir_formatLocale.indexOf('ru_') > -1) {
      rs = currencyCode + price + ' ' + currencySign;
   } else if(JS_ir_formatLocale.indexOf('it_') > -1) {
   	  rs = currencyCode + currencySign + ' ' + price;
   } else {
   	  rs = currencyCode + currencySign + price;
   }

	return rs;
}

function threeDigitize(s, c)
{
   var sep = ",";
   if (JS_ir_formatLocale.indexOf('fr_') > -1) {
      sep = " ";
   }
   else if (JS_ir_formatLocale.indexOf('de_') > -1 || JS_ir_formatLocale.indexOf('it_') > -1 || JS_ir_formatLocale.indexOf('es_ES') > -1) {
      sep = "."
   }

   switch (s.length % 4) {
	case 0:
		return s;
	case 1:
		return sep + "00" + s;
	case 2:
		return sep + "0" + s;
	case 3:
		return sep + s;
	}
}

function dispCurrConv(ic, amt, rc, eqId) {
	var hasConverted = 0;
	realmCurrency = rc;
	var pfc = getCurrInfoForRealm();
	var iamt = parseInt(amt, 10);
	
	if (p = document.getElementById("IP$"+eqId+"_price")) {
		iamt = parseInt(p.innerHTML.replace(/[^0-9]/g,''), 10);
	}
	
	if (p = document.getElementById("IP_ConvPriceBox")) {
		if (ic.match(/^EURO/))
			ic = "EUR";
		
		if (ic != pfc) {
			p.innerHTML = '<i>(*' + convDollarStr(iamt, ic, pfc, rc) + ')</i>';
			hasConverted = 1;
		}
	}
	
	if (hasConverted == 1) {
		document.getElementById("cfn").style.display='inline';
	}
}



