
//GLOBAL HELP and CURRENCY CONVERTOR

//Developed from ~ Pop-it menu- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com

var link=new Array(2)

//	Purchasing HELP
link[1]='<div class=\"defttl\">How to purchase</div>'
link[1]+='<div class=\"defbox\"><img src=\"../type_icon1.gif\" width=28 height=38 border=0 align=left vspace=3><img src=\"../type_icon_ap.gif\" width=28 height=38 border=0 align=left vspace=3>Point to the icon of the option you may wish to purchase and the highlighted price of that option will appear<hr size=1 >Point to <img src=\"../def_mini_orig.gif\" width=104 height=13 border=0> or <img src=\"../def_mini_pr.gif\" width=104 height=13 border=0> above for full details<hr size=1 >Point to <img src=\"../icon_convert.gif\" width=18 height=11 border=0> to convert the price to other currencies<hr size=1 >Click <span class=\"flag\">add to cart</span> to purchase your selected option &#151; Repeat for other selected options from this artist\'s gallery<hr size=1 >Click <span class=\"flag\">view cart</span> to amend your shopping list or to checkout.</div>'




////No need to edit beyond here

var ie4=document.all
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function menuOn(e,links){

if (!document.all&&!document.getElementById&&!document.layers)
return

clearhide()

menuobj=ie4? document.all.convert : ns6? document.getElementById("convert") : ns4? document.convert : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

////--------------Currency converter ----------------------------------
      var mainCurr   = document.forms['paypal'].amount.value
      var currency   = document.forms['paypal'].currency_code.value
          var pound  = "";
       var currType  = "";
       var currCode  = "$";

 if (currency == 'EUR'){
        currType = 'Euros';
        currCode = '&#128;';
         pound   = ((1/parseFloat(eu)) * parseFloat(mainCurr));
	   eur   = mainCurr;
}
 if (currency == 'USD'){
	currType = 'US Dollars';
         pound   = ((1/parseFloat(us)) * parseFloat(mainCurr));
	   usd   = mainCurr;
}
 if (currency == 'CAD'){
	currType = 'Canadian $';
         pound   = ((1/parseFloat(cd)) * parseFloat(mainCurr));
	   cad   = mainCurr;
}
 if (currency == 'AUD'){
	currType = 'Australian $';
         pound   = ((1/parseFloat(ad)) * parseFloat(mainCurr));
	   aud   = mainCurr;
}
 if (currency == 'GBP'){
	currType = 'UK Pounds';
        currCode = '&pound;';
         pound   = (parseFloat(mainCurr));
	   gbp   = mainCurr;
}

        var eur  = (pound * parseFloat(eu)).toFixed(2) + "";
        var usd  = (pound * parseFloat(us)).toFixed(2) + "";
        var gbp  = (pound).toFixed(2) + "";
        var cad  = (pound * parseFloat(cd)).toFixed(2) + "";
        var aud  = (pound * parseFloat(ad)).toFixed(2) + "";
        var jpy  = (pound * parseFloat(jp)).toFixed(2) + "";


var src2 = '<div class=\"defttl\">Currency Converter</div>';
    src2 +='<div class=\"defbox\">Currency : ' + currType + '</div>';
    src2 +='<div class=\"defbox\">' + currCode + ' ' + mainCurr + '<hr size=1 ></div>';
    src2 +='<div class=\"defbox\"><table class=\"defbox\">';
    src2 +='<tr align=right><td>USA = $&nbsp;</td><td>' + usd + '</td></tr>';
    src2 +='<tr align=right><td>UK = &pound;&nbsp;</td><td>' + gbp + '</td></tr>';
    src2 +='<tr align=right><td>Europe = &#128;&nbsp;</td><td>' + eur + '</td></tr>';
    src2 +='<tr align=right><td>Canada = $&nbsp;</td><td>' + cad + '</td></tr>';
    src2 +='<tr align=right><td>Australia = $&nbsp;</td><td>' + aud + '</td></tr>';
    src2 +='<tr align=right><td>Japan = &#165;&nbsp;</td><td>' + jpy + '</td></tr>';
    src2 +='</table></div>';
    src2 +='<hr size=1 ><a href=\"http://www.xe.com/ucc/\" target=\"_blank\" class=\"deflink2\" style=\"text-decoration:underline;\">convert to other currency</a>';
link[2] = src2

////---END--------- Currency converter------------------------------


if (links == 'help'){
  menuobj.innerHTML= link[1]
}else{
  menuobj.innerHTML= link[2]
}


menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y

//Find out how close the mouse is to the corner of the window
var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : ns6? window.pageXOffset+eventX : eventX

//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight
else
menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight
menuobj.thestyle.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hideIt(){
if (window.menuobj)
menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function dynahide(e){
if (ie4&&!menuobj.contains(e.toElement))
hideIt()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hideIt()
}

function dlayhide(){
if (ie4||ns6||ns4)
delayhide=setTimeout("hideIt()",250)
}

function clearhide(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie4||ns6)
document.onclick=hideIt

