
/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
var showsold=true
if (ie||ns6)
{
var tipobj=document.all? document.all["dek"] : document.getElementById? document.getElementById("dek") : ""
}
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip



function tipInEuros( value )
{
	ddrivetip( ShowInEuros( value ), 'lightyellow', 300 );
}


function popupInEuros( value )
{
	ShowTextInWindow( ShowInEuros( value ) );
}

function ShowTextInWindow( text )
{
   winInfo=window.open( "", "", "width=300,height=100")
   winInfo.document.write("<html><body>"+text+"</body></html>")
   winInfo.focus()
}	
function aEuros(n)
{
ShowTextInWindow( ShowInEuros(n) )
}

function ShowInEuros(value) {
        eurText=value.split("Euro:")
        eurText2=eurText[1].split("/")
	eur=new Number(eurText2[0])

	usd=Math.round(eur * 100 * DollarConversionFactor) /100 
	yen=Math.round(eur * YenConversionFactor)
	result = ''
//	result = '<font face="Arial, Helvetica, sans-serif">'
//	result = result + '<p><center><h5><b><font color="#990000">Currency exchange rate applied</font> </b></center>'
	result = result + '<table width="100%" cellpadding="0" border="0">'
	result = result + '<tr><td widht="50%" align="center" >1&euro; = US$'+ DollarConversionFactor + '</td><td width="50%" align="center"> '+eur+'&euro; = US$'+usd+'</td></tr>'
	result = result + '<tr><td colspan="2"><HR /></td></tr>'
	result = result + '<tr><td width="50%" align="center">1&euro; = '+ YenConversionFactor + ' Yen</td><td width="50%" align="center"> '+eur+'&euro; = '+yen+' Yen</td></tr>'
	result = result + '</table>'
	return result
}


function changecss(theClass,element,value) {
	//documentation for this script at http://www.shawnolson.net/a/503/
	 var cssRules;
	 if (document.all) {
	  cssRules = 'rules';
	 }
	 else if (document.getElementById) {
	  cssRules = 'cssRules';
	 }
	 for (var S = 0; S < document.styleSheets.length; S++){
	  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
	   if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
	    document.styleSheets[S][cssRules][R].style[element] = value;
	   }
	  }
	 }
	}


function blinkit(){
	intrvl=0;
	color=document.bgColor;
	setTimeout("document.bgColor='#CCCCCC';",100);
	setTimeout("document.bgColor='#BBBBBB';",200);
	setTimeout("document.bgColor='#AAAAAA';",300);
	setTimeout("document.bgColor='#BBBBBB';",400);
	setTimeout("document.bgColor='#CCCCCC';",500);
	setTimeout("document.bgColor='"+color+"';",600);
}

function changeSoldView(msgshow, msghide)
{
	if (ie||ns6)
	{
		var changesoldobj=document.all? document.all["changesold"] : document.getElementById? document.getElementById("changesold") : ""
	}
	if( showsold )
	{
		changecss('.SoldMineralSpecimen', 'display','none')
		changecss('.SoldMineralSpecimenSpacer', 'display','inline')
		if( changesoldobj ) changesoldobj.innerHTML=msgshow
		showsold=false
		blinkit()
	}else{
		changecss('.SoldMineralSpecimen', 'display','inline')
		changecss('.SoldMineralSpecimenSpacer', 'display','none')
		if( changesoldobj ) changesoldobj.innerHTML=msghide
		showsold=true
		blinkit()
	}
	
}

