
//Create an array 
var allPageTags = new Array(); 

function changeCurrency(theClass, type) {
	//Populate the array with all the page tags
	var allPageTags=document.getElementsByTagName("*");
	
	//Cycle through the tags using a for loop
	for (i=0; i<allPageTags.length; i++) {
		//Pick out the tags with our class name
		if (allPageTags[i].className==theClass) {
			
			if(type == 'none' || type == 'inline'){
				//Manipulate this in whatever way you want
				allPageTags[i].style.display=type;
			}else if(type == 'is_usd'){
				if(allPageTags[i].className == 'currency_img_usd'){
					allPageTags[i].src = 'fileadmin/templates/gfx/elements/purchase_site_currency_usd_na.png';	
				}
				if(allPageTags[i].className == 'currency_img_eur'){
					allPageTags[i].src = 'fileadmin/templates/gfx/elements/purchase_site_currency_eur.png';	
				}
			}else if(type == 'is_eur'){
				if(allPageTags[i].className == 'currency_img_usd'){
					allPageTags[i].src = 'fileadmin/templates/gfx/elements/purchase_site_currency_usd.png';	
				}
				if(allPageTags[i].className == 'currency_img_eur'){
					allPageTags[i].src = 'fileadmin/templates/gfx/elements/purchase_site_currency_eur_na.png';	
				}
			}
		}
	}
}
