﻿function EliminarObjeto(objCont, Objeto){ 
    var obj=document.getElementById(objCont);
    var objEliminar=document.getElementById(Objeto);
    if (obj!=null && objEliminar!=null) obj.removeChild(objEliminar);
}
   function getExt(Archivo){
  var arrArchivo=Archivo.split(".");
  var Ext=arrArchivo[arrArchivo.length - 1];
  return Ext=Ext.toUpperCase();
}
function CrearImagen(objCont, Id, Archivo, Ancho, Altura){
    EliminarObjeto(objCont, Id);
    var objImg=document.createElement("img");
    objImg.setAttribute("id", Id);
    objImg.setAttribute("src", Archivo);
    objImg.setAttribute("height", Altura);
    objImg.setAttribute("width", Ancho);
    objImg.setAttribute("alt","Publicidad");
    document.getElementById(objCont).appendChild(objImg);
}

function CrearLink(objCont, Id, HRef, Target){
    if (Target==""||Target==null) Target="_self";
    EliminarObjeto(objCont, Id);
    if (!esIE()) {
        var objA=document.createElement("a");
        objA.setAttribute("id", Id);
        objA.setAttribute("href", HRef);
        objA.setAttribute("Target", Target);
        document.getElementById(objCont).appendChild(objA);
    } else 
        document.write("<a id='"+Id+"' href='"+HRef+"' target='"+Target+"' />"); 
}

function CargarFlash(objCont, Archivo, Width, Height, UsarTransparencia,Link){
                             
        if (UsarTransparencia){
            document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + 
                        'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ Width + '" height="'+ Height +'">' + 
                        '<param name="movie" value="' + Archivo + '">' + 
                        '<param name="wmode" value="transparent" />' + 
                        '<param name="quality" value="high">' + 
                        '<param name="FlashVars" value="var='+Link+'">' +   
                        '<embed src="'+ Archivo +'" wmode="transparent" quality="high" ' + 
                        'pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ Width + '" height="'+ Height + '">' + 
                        '</embed>' + 
                '</object>');
        }else{
            document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + 
                        'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ Width + '" height="'+ Height +'">' + 
                        '<param name="movie" value="' + Archivo + '">' + 
                        '<param name="wmode" value="transparent" />' + 
                        '<param name="quality" value="high">' + 
                            '<param name="wmode" value="transparent" />' + 
                             '<param name="FlashVars" value="var='+Link+'">' +   
                        '<embed src="' + Archivo +'" quality="high"  wmode="transparent"  ' + 
                        'pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" width="'+ Width + '" height="'+ Height + '">' + 
                        '</embed>' + 
                '</object>');
        }

}