/*----------------------*/
/*--[ External links ]--*/
/*----------------------*/

function transform_rel() {
	var W3CDOM = (document.createElement && document.getElementsByTagName);
	if (!W3CDOM) return; // If the browser doesn't support the W3C DOM, don't do anything.

	var links = document.getElementsByTagName('a');
	for(var i = 0; i < links.length; i++) {
		if(links[i].getAttribute('href') && links[i].getAttribute('rel') == 'external') {
			links[i].target = '_blank';
		}
		if(links[i].getAttribute('href') && links[i].getAttribute('rel') == 'popup') {
			links[i].onclick = function() {
				popup(this.href, this.className);
				return false;
			}
		}
	}
}
window.onload = function onLoader(){
	transform_rel();
	init_tooltips();
	}

//////////////-----------{ TOOLTIPS DEALER MAPS }-----------------------------

function init_tooltips() {
	if(!document.getElementById || !document.getElementsByTagName) return;
	if(!document.getElementById('regios')) return;

	var myDiv = document.getElementById('sales-map');
	if(myDiv) {
		var myImg =  myDiv.getElementsByTagName('img');
		myImg[0].setAttribute('galleryimg', 'no');
	
		var myList = myDiv.getElementsByTagName('li');
		for(i = 0; i < myList.length; i++){
			setOpacity(myList[i]);
	
			myList[i].onmouseout = function() {
				this.className = this.className.replace(/ show/, "");
				this.className = this.className + ' noshow';
			}
			myList[i].onmouseover = function() {
				this.className = this.className.replace(/ noshow/, "");
				this.className = this.className + ' show';
			}
		}
	}
}

function setOpacity(el){
	el.style.filter="alpha(opacity:85)";
	el.style.KHTMLOpacity="0.85";
	el.style.MozOpacity="0.85";
	el.style.opacity="0.85";
}


