function loadSWF(url, targetID){
	document.getElementById (targetID).style.visibility="hidden";

	//Check for existing SWF
	if(isObject(targetID)){
		//replace object/element with a new div
		replaceSwfWithEmptyDiv(targetID);
	}

	//Embed SWF
	if (swfobject.hasFlashPlayerVersion("7")) {
		var attributes = { data: url, width:"900", height:"230" };
		var params = {wmode: "opaque"};
		var obj = swfobject.createSWF(attributes, params, targetID);
		//obj.addParam("wmode", "transparent");
	}
}

function isObject(targetID){
	var isFound = false;
	var el = document.getElementById(targetID);

	if(el && (el.nodeName === "OBJECT" || el.nodeName === "EMBED")){
		isFound = true;
	}

	return isFound;
}


function replaceSwfWithEmptyDiv(targetID){
	var el = document.getElementById(targetID);

	if(el){
		var div = document.createElement("div");
		el.parentNode.insertBefore(div, el);

		//Remove the SWF
		swfobject.removeSWF(targetID);

		//Give the new DIV the old element's ID
		div.setAttribute("id", targetID);
	}
}

var actual = 2;
function siguiente(total){
	var pos;
	actual = actual + 1;
	pos=actual;
	if(actual > total){
		pos=actual;
		actual = 1;
	}

	document.getElementById("enlace_banner").href=arrBanners[actual-1];
	document.getElementById("etiqueta").firstChild.nodeValue  = " M\u00e1s Promociones  " + (pos - 1) + " de " + total;

/*
	document.getElementById("enlace_banner").href="banners/"+actual+".swf";
	document.getElementById("etiqueta").firstChild.nodeValue = " " + (pos - 1) + " de " + total;
*/
}
