/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	WriteSWF
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function writeswfhtml(nome, width, height, html) {
	document.writeln('<object type="application/x-shockwave-flash" data="'+ nome +'.swf" width="'+ width +'" height="'+ height +'">');
	document.writeln('<param name="movie" value="'+ nome +'.swf" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="wmode" value="transparent">');	
	document.writeln(html);
	document.writeln('</object>');
}

function writeswftxt(nome,width,height,img,txtFra) {
	

	//newValue = escape(txtFra)
	document.writeln('<object type="application/x-shockwave-flash" data="'+ nome +'.swf?img=' + img + '&txtFrase=' + txtFra + '" width="'+ width +'" height="'+ height +'">');
	document.writeln('<param name="movie" value="'+ nome +'.swf?img=' + img + '&txtFrase=' + txtFra +'" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="wmode" value="transparent">');
	document.writeln('</object>');
}

function teste(value){
	alert(value);	
}



/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	External Link
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function init() {
	createExternalLinks();
}//end function


function createExternalLinks() {
    if(document.getElementsByTagName) {
        var anchors = document.getElementsByTagName('a');
        for(var i=0; i<anchors.length; i++) {
            var anchor = anchors[i];
            if(anchor.getAttribute("href") && anchor.getAttribute('rel')=='blank') { 
                anchor.target = '_blank';
             
            }
        }
    }
}//end function

function addEvent(obj, evType, fn){
    if(obj.addEventListener){
        obj.addEventListener(evType, fn, false);

        return true;

    } else if (obj.attachEvent){
        var r = obj.attachEvent('on'+evType, fn);

        return r;

    } else {
        return false;

    }
}//end function

addEvent(window, "load", init);



/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	Add Title
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
// JavaScript Document
	function addTitle(el){
			var a = document.getElementsByTagName(el);
			for(i=0;i<a.length;i++){
					a[i].title = (a[i].title=='')?a[i].innerHTML : a[i].title;				
				}
		}
	window.onload = function(){
		addTitle('A');
	}
	

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	Banners Flash - Trocar de Página
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function trocaPagina(value){
	if(value=='faq'){
		var popUp = window.open;
		popUp('http://www.google.com.br','self');
	}
	
};

*/

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	Estilizar Input File
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

      function fakeFile(image, input, pathfield) {
      var w = image.offsetWidth, h = image.offsetHeight,
          s = parseInt(w/4.2), wrapper = document.createElement('div');
      wrapper.style.cssText = "position:relative; width:"+w+"px; height:"+h+"px; overflow:hidden; z-index:100;";
      input.style.cssText = "position:absolute; height:"+h+"px; top:0; right:0; font-size:"+s+"px; "+
                            "filter:alpha(opacity=0); opacity:0; z-index:101;";
        if(pathfield)
          addEvent(input, 'change', new Function('$("'+pathfield.id+'").value = $("'+input.id+'").value;'));
      image.parentNode.insertBefore(wrapper, image);
      wrapper.appendChild(image);
      wrapper.appendChild(input);
      return wrapper;
      }
       
      function $(id) { return typeof(id) == 'object' ? id : (document.getElementById(id) || null); }
     
      function addEvent(obj, evType, fn){
       if(obj.addEventListener) obj.addEventListener(evType, fn, false);
       else if(obj.attachEvent) obj.attachEvent("on"+evType, fn);
      }


*/