// JavaScript Document

jQuery(document).ready(function(){

    var x = document.getElementsByTagName('a');
    var y;
    var newDiv;
    //			var newTxt = "";
    var parent;

    for (var i = 0; i < x.length; i++) {
        y = x[i];
        if (y.className && y.className == 'tour') {
            newDiv = document.createElement('div');
            //newDiv.setAttribute("onMouseOver", "showCurrencies(" + i + ");");
            //newDiv.setAttribute("onMouseOut", "hideCurrencies(" + i + ");");
			//jQuery(newDiv).css('position', 'relative');
            var oldcuid = y.toString();
            var usdcuid = oldcuid.replace("6010", "8954");
			var gbpcuid = oldcuid.replace("6010", "8956");
			var eurcuid = oldcuid.replace("6010", "8955");			
            newDiv.innerHTML = "<div class='curDiv'><a style='cursor:pointer;display:block;' id='newLink" + i + "' href='" + y + "'>Info / Book Online &raquo;</a><div class='toggleDiv' id='toggleDiv" + i + "'><p style='padding:5px 10px 0 13px;margin:0'><strong>Select Currency:</strong></p><ul style='margin:0 0 0 13px;padding: 0 10px 10px 0;font-size:90%;'><li style='list-style-type:none;background-image:none;'><a style='float:none;' href='" + y + "'>Australian Dollar (<strong>AUD</strong>)</a></li><li style='list-style-type:none;background-image:none;'><a style=';float:none;' href='" + usdcuid + "'>United States Dollar (<strong>USD</strong>)</a></li><li style='list-style-type:none;background-image:none;'><a style=';float:none;' href='" + gbpcuid + "'>British Pounds (<strong>GBP</strong>)</a></li><li style='list-style-type:none;background-image:none;'><a style=';float:none;' href='" + eurcuid + "'>Euros (<strong>EUR</strong>)</a></li></ul></div></div>";
            parent = y.parentNode;
            parent.replaceChild(newDiv, y);
        }
    }


/*
function showCurrencies(var1) {
    document.getElementById('newLink' + var1).style.visibility = 'hidden';
    document.getElementById('toggleDiv' + var1).style.display = 'block';
}

function hideCurrencies(var2) {
    document.getElementById('newLink' + var2).style.visibility = 'visible';
    document.getElementById('toggleDiv' + var2).style.display = 'none';
}
*/
	
	jQuery('.curDiv').hover(
		function() {
		jQuery(this).children('.toggleDiv').show();
		}, 
		function () {
		jQuery(this).children('.toggleDiv').hide();
    });
});

