/**
 * Escreve na página um objeto do tipo SWF
 *
 * @param swf arquivo para ser visualizado
 * @param width largura do clip
 * @param height altura do clip
 */
function print_swf(swf, width, height )
{
    //swf = 'fla/banner_top.swf';
    //width = 726;
    //height = 190;
	
    str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+ width +'" height="'+ height +'"><param name="movie" value="' + swf + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed wmode="transparent" src="' + swf + '" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'"></embed></object>';
	
    document.write(str);
}




var ban_arquivo = '';
var ban_width   = '';
var ban_height  = '';
var ban_destino = '';

function print_swf_load_action() {
    str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+ ban_width +'" height="'+ ban_height +'"><param name="movie" value="' + ban_arquivo + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed wmode="transparent" src="' + ban_arquivo + '" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ ban_width +'" height="'+ ban_height +'"></embed></object>';
    document.getElementById(ban_destino).innerHTML = str;
}

function print_swf_load(swf, width, height, destino)
{        
    if(destino != ""){
        ban_arquivo = swf;
        ban_width = width;
        ban_height = height;
        ban_destino = destino;

        addEvent(window,'load',print_swf_load_action);
    }
    else {
        print_swf(swf, width, height );
    }       
}

/**
 * Escreve conteúdo diverso na página
 *
 * @param str conteúdo a ser impresso na página
 */
function print_conteudo(str)
{
    document.write(str);
}

/**
 * ao setar o foco do elemento
 */
function input_blur(ele)
{
    if(ele.value =='')
    {
        ele.value= ele.defaultValue;
        ele.className = 'c_ml TextItalic';
        ele.s='';
    }
}
function input_focus(ele)
{
	
    if(ele.s!='t')
    {
        ele.value='';
        ele.className = 'DefaultFont';
        ele.s='t';
    }
}

function input_pass(ele, alvo)
{	
	
    ele.style.display = 'none';
	
    eleAlvo = document.getElementById(alvo);
    eleAlvo.style.display = 'inline';
	
    input_focus(eleAlvo);
	
    eleAlvo.focus();
}

function input_pass_blur(ele, alvo)
{
    if(ele.value === '')
    {
        ele.style.display = 'none';
		
        eleAlvo = document.getElementById(alvo);
        eleAlvo.style.display = 'inline';
		
        input_blur(eleAlvo);
    }
	
}

function setaEstilo(ele, valor)
{
    ele.style.backgroundColor = '#000';
    ele.style.opacity = valor/100;
    ele.style.filter= "Alpha(opacity="+ valor +")";
}

function alphaElementos()
{
    //arrEle = $('pagina').getElementsBySelector(".efeito");
    arrEle = document.getElementsByTagName('span');
	
    for(i=0; i<arrEle.length; i++)
    {
        if(arrEle[i].className == "efeito")
            setaEstilo(arrEle[i], 50);
    /*
		arrEle[i].setStyle({
			backgroundColor: '#000',
			opacity: 0.5
		});
		*/
    }
}

addEvent(window,'load',alphaElementos);



function onFocusHandler_p(fld)
{
    fld.style.display = 'none';
    var fld2 = (document.getElementById) ? document.getElementById('password') : document.all['password'];
    fld2.style.display = 'inline';
    fld2.focus();
    return true;
}
function onBlurHandler_p(fld)
{
    if(fld.value === ''){
        fld.style.display = 'none';
        var fld2 = (document.getElementById) ? document.getElementById('fauxPassword') : document.all['fauxPassword'];
        fld2.style.display = 'inline';
    }
    return true;
}


/**
 * Redireciona página = "link href"
 */
function getURL(url)
{
    window.location.href = url;
}
