function closeW(id) {
    document.getElementById('layer_fundo_bg').style.display = 'none';
    document.getElementById(id).style.display = 'none';
}

//== READ FILE ==
function getHTTPObject() {
    if (typeof XMLHttpRequest != 'undefined') {
        return new XMLHttpRequest();
    }
    try {
        return new ActiveXObject('Msxml2.XMLHTTP');
    } catch (e) {
        try {
            return new ActiveXObject('Microsoft.XMLHTTP');
        } catch (e) {}
    }
    return false;
}

function openfile(id, get, bg) {
    document.getElementById(bg).style.display = 'block';
    var http = getHTTPObject();
    http.open('GET', '?act=' + get, true);
    http.onreadystatechange = function() {
        if (http.readyState == 4) {
            document.getElementById(id).style.display = 'block';    
          document.getElementById(id).innerHTML = http.responseText;
//			var html = '<div style="padding:5px"><input type="hidden" name="id" id="BID" value="B0" /><input type="hidden" name="Ftype" id="Ftype" value="4" /> <span id="uploaderID1" style="font-family:verdana;font-size:10"> Upload File: <input name="ID1" id="FID1" type="file" value="ID1" class="bt_no" style="width:120px" /><br /> Link: <input type="text" class="head_bl" style="width:250px; text-align:left;" name="link" value="http://" style="width:275px" /><br /> <input type="button" value="Add" class="bt" onclick="return uploadFile(FID1)" /> <input type="button" value="Close" onclick="hide(\'edit_flash\');hide(\'ban_bg\')" class="bt" /> </span> <iframe name="iframeID1" src="imageupload.php" width="400" height="100" style="display:none"> </iframe></div> <div style="width:340px;height:300px;float:left;overflow:auto"><div id="adv_F"> <div class="content" onclick="change(\'\')"> <img src="letter_images/img2.JPG" alt="" /> </div><!--.content--> </div><!--#adv_F--> <div align="center"><a href=""></a></div> <div align="center"> | <a class="bt_link" onclick="hide(\'ban_bg\');openfile(\'edit_flash\',\'DelImage&amp;id=5\',\'ban_bg\' )">Delete</a> | <a class="bt_link"onclick="hide(\'ban_bg\');openfile(\'edit_flash\',\'FlashPlace&amp;id=5&amp;sid=\',\'ban_bg\' )" class="bt_link" >&lt;&lt;=</a> place <a onclick="hide(\'ban_bg\')openfile(\'edit_flash\','FlashPlace&amp;id=5&amp;sid=','ban_bg' )" class="bt_link">=&gt;&gt;</a> | <a class="bt_link" href="">Make Invisible</a> | </div></div> <div> <div style="clear:left">Preview</div> <img onload="document.getElementById('FLC').innerHTML=document.getElementById('FL0').innerHTML" src="img_link/expedition-media-1.gif" style="display:none" /> <div id="FLC" style="float:left;padding-left:5px;padding-right:5px"> <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="243" height="80"> <param name="movie" value="swf/HBanner.swf" /> <param name="quality" value="high" /> <param name="wmode" value="transparent" /> <param name="FlashVars" value="HTMLVar=0" /> <embed src="swf/HBanner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="243" height="90"></embed> </object> </div><!--#FLC--> <div style="padding-left:5px;padding-top:5px;color:white"> <div style="float:left"> <input type="radio" name="random" id="random" value="random" /><label for="random">Random</label><br /> <input type="radio" name="random" id="one" value="one" /><label for="one">Random First</label><br /> <input type="radio" name="random" id="none" value="none" /><label for="none">None</label><br /> <input type="hidden" name="type" value="1" /> <input type="button" name="Update" onclick="document.formNameID1.Ftype.value=2;return uploadFile(FID1)" value="Update" class="bt" /><br /> </div> <div class="fade" style="float:left;margin-left:10px;text-align:right"> <label for="delay">Delay: <input name="delay" id="delay" type="text" value="0" size="4" maxlength="2" /> sec</label><br /> <label for="fadein">Fade In: <input name="fadein" id="fadein" type="text" value="" size="4" maxlength="1" /> sec</label><br /> <label for="fadeout">Fade out: <input name="fadeout" id="fadeout" type="text" value="" size="4" maxlength="1" /> sec</label> </div><!--.fade--> </div> </div>'; 
        }
    }
    http.send();
}

function getfile(get) {
    var http = getHTTPObject();
    http.open('GET', '?act=' + get, true);
    http.onreadystatechange = function() {
        if (http.readyState == 4) {
            var info = http.responseText;
        }
    }
    http.send(null);
    return http.responseText;
}

function hide(id) {
    document.getElementById(id).style.display = 'none';
}

function dspl(id) {
    document.getElementById(id).style.display = 'block';
}
