// JavaScript Document

//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

function janela(url, w, h){
window.open(url,"","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,status=no,resizable=yes, width= " + w + ", height = " + h + ", top=0,left=0")
}

function janela2(url, w, h){
window.open(url,"","toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=yes, width= " + w + ", height = " + h + ", top=0,left=0")
}

function videom() {
        self.location = document.mus.musc.options[document.mus.musc.selectedIndex].value;
}

function videoe() {
        self.location = document.erg.ergo.options[document.erg.ergo.selectedIndex].value;
}

function fotos(url, w, h){
window.open(url,"","toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=no, width= " + w + ", height = " + h + ", top=0,left=0")
}

function goto() {
        self.location = document.datagoto.data.options[document.datagoto.data.selectedIndex].value;
}

function val_busca(){
	if(document.all.busca.value.length < 3){
		alert('Para se fazer a busca deve-se digitar pelo menos 3 caracteres!');
		return false;
	}
	return true;
}

function openPic(url){
newWindow=window.open(url,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
newWindow.document.write('<html><title>Rad Performance Wheels</title><head></head>')
newWindow.document.write('<body onLoad="self.resizeTo(document.images[0].width,document.images[0].height+30);" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" rightmargin="0" bottommargin="0"><img src="'+url+'" align="top"></body></html>')
newWindow.location.reload();
newWindow.focus();
}

/****************************************************
	XMLHttpRequest
****************************************************/
/*
Cross-Browser XMLHttpRequest v1.2
=================================

Emulate Gecko 'XMLHttpRequest()' functionality in IE and Opera. Opera requires
the Sun Java Runtime Environment <http://www.java.com/>.

by Andrew Gregory
http://www.scss.com.au/family/andrew/webdesign/xmlhttprequest/

This work is licensed under the Creative Commons Attribution License. To view a
copy of this license, visit http://creativecommons.org/licenses/by-sa/2.5/ or
send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
94305, USA.

Attribution: Leave my name and web address in this script intact.

Not Supported in Opera
----------------------
* user/password authentication
* responseXML data member

Not Fully Supported in Opera
----------------------------
* async requests
* abort()
* getAllResponseHeaders(), getAllResponseHeader(header)

*/
// IE support
if (window.ActiveXObject && !window.XMLHttpRequest) {
  window.XMLHttpRequest = function() {
    var msxmls = new Array(
      'Msxml2.XMLHTTP.5.0',
      'Msxml2.XMLHTTP.4.0',
      'Msxml2.XMLHTTP.3.0',
      'Msxml2.XMLHTTP',
      'Microsoft.XMLHTTP');
    for (var i = 0; i < msxmls.length; i++) {
      try {
        return new ActiveXObject(msxmls[i]);
      } catch (e) {
      }
    }
    return null;
  };
}
// Gecko support
/* ;-) */
// Opera support
if (window.opera && !window.XMLHttpRequest) {
  window.XMLHttpRequest = function() {
    this.readyState = 0; // 0=uninitialized,1=loading,2=loaded,3=interactive,4=complete
    this.status = 0; // HTTP status codes
    this.statusText = '';
    this._headers = [];
    this._aborted = false;
    this._async = true;
    this._defaultCharset = 'ISO-8859-1';
    this._getCharset = function() {
      var charset = _defaultCharset;
      var contentType = this.getResponseHeader('Content-type').toUpperCase();
      val = contentType.indexOf('CHARSET=');
      if (val != -1) {
        charset = contentType.substring(val);
      }
      val = charset.indexOf(';');
      if (val != -1) {
        charset = charset.substring(0, val);
      }
      val = charset.indexOf(',');
      if (val != -1) {
        charset = charset.substring(0, val);
      }
      return charset;
    };
    this.abort = function() {
      this._aborted = true;
    };
    this.getAllResponseHeaders = function() {
      return this.getAllResponseHeader('*');
    };
    this.getAllResponseHeader = function(header) {
      var ret = '';
      for (var i = 0; i < this._headers.length; i++) {
        if (header == '*' || this._headers[i].h == header) {
          ret += this._headers[i].h + ': ' + this._headers[i].v + '\n';
        }
      }
      return ret;
    };
    this.getResponseHeader = function(header) {
      var ret = getAllResponseHeader(header);
      var i = ret.indexOf('\n');
      if (i != -1) {
        ret = ret.substring(0, i);
      }
      return ret;
    };
    this.setRequestHeader = function(header, value) {
      this._headers[this._headers.length] = {h:header, v:value};
    };
    this.open = function(method, url, async, user, password) {
      this.method = method;
      this.url = url;
      this._async = true;
      this._aborted = false;
      this._headers = [];
      if (arguments.length >= 3) {
        this._async = async;
      }
      if (arguments.length > 3) {
        opera.postError('XMLHttpRequest.open() - user/password not supported');
      }
      this.readyState = 1;
      if (this.onreadystatechange) {
        this.onreadystatechange();
      }
    };
    this.send = function(data) {
      if (!navigator.javaEnabled()) {
        alert("XMLHttpRequest.send() - Java must be installed and enabled.");
        return;
      }
      if (this._async) {
        setTimeout(this._sendasync, 0, this, data);
        // this is not really asynchronous and won't execute until the current
        // execution context ends
      } else {
        this._sendsync(data);
      }
    }
    this._sendasync = function(req, data) {
      if (!req._aborted) {
        req._sendsync(data);
      }
    };
    this._sendsync = function(data) {
      this.readyState = 2;
      if (this.onreadystatechange) {
        this.onreadystatechange();
      }
      // open connection
      var url = new java.net.URL(new java.net.URL(window.location.href), this.url);
      var conn = url.openConnection();
      for (var i = 0; i < this._headers.length; i++) {
        conn.setRequestProperty(this._headers[i].h, this._headers[i].v);
      }
      this._headers = [];
      if (this.method == 'POST') {
        // POST data
        conn.setDoOutput(true);
        var wr = new java.io.OutputStreamWriter(conn.getOutputStream(), this._getCharset());
        wr.write(data);
        wr.flush();
        wr.close();
      }
      // read response headers
      // NOTE: the getHeaderField() methods always return nulls for me :(
      var gotContentEncoding = false;
      var gotContentLength = false;
      var gotContentType = false;
      var gotDate = false;
      var gotExpiration = false;
      var gotLastModified = false;
      for (var i = 0; ; i++) {
        var hdrName = conn.getHeaderFieldKey(i);
        var hdrValue = conn.getHeaderField(i);
        if (hdrName == null && hdrValue == null) {
          break;
        }
        if (hdrName != null) {
          this._headers[this._headers.length] = {h:hdrName, v:hdrValue};
          switch (hdrName.toLowerCase()) {
            case 'content-encoding': gotContentEncoding = true; break;
            case 'content-length'  : gotContentLength   = true; break;
            case 'content-type'    : gotContentType     = true; break;
            case 'date'            : gotDate            = true; break;
            case 'expires'         : gotExpiration      = true; break;
            case 'last-modified'   : gotLastModified    = true; break;
          }
        }
      }
      // try to fill in any missing header information
      var val;
      val = conn.getContentEncoding();
      if (val != null && !gotContentEncoding) this._headers[this._headers.length] = {h:'Content-encoding', v:val};
      val = conn.getContentLength();
      if (val != -1 && !gotContentLength) this._headers[this._headers.length] = {h:'Content-length', v:val};
      val = conn.getContentType();
      if (val != null && !gotContentType) this._headers[this._headers.length] = {h:'Content-type', v:val};
      val = conn.getDate();
      if (val != 0 && !gotDate) this._headers[this._headers.length] = {h:'Date', v:(new Date(val)).toUTCString()};
      val = conn.getExpiration();
      if (val != 0 && !gotExpiration) this._headers[this._headers.length] = {h:'Expires', v:(new Date(val)).toUTCString()};
      val = conn.getLastModified();
      if (val != 0 && !gotLastModified) this._headers[this._headers.length] = {h:'Last-modified', v:(new Date(val)).toUTCString()};
      // read response data
      var reqdata = '';
      var stream = conn.getInputStream();
      if (stream) {
        var reader = new java.io.BufferedReader(new java.io.InputStreamReader(stream, this._getCharset()));
        var line;
        while ((line = reader.readLine()) != null) {
          if (this.readyState == 2) {
            this.readyState = 3;
            if (this.onreadystatechange) {
              this.onreadystatechange();
            }
          }
          reqdata += line + '\n';
        }
        reader.close();
        this.status = 200;
        this.statusText = 'OK';
        this.responseText = reqdata;
        this.readyState = 4;
        if (this.onreadystatechange) {
          this.onreadystatechange();
        }
        if (this.onload) {
          this.onload();
        }
      } else {
        // error
        this.status = 404;
        this.statusText = 'Not Found';
        this.responseText = '';
        this.readyState = 4;
        if (this.onreadystatechange) {
          this.onreadystatechange();
        }
        if (this.onerror) {
          this.onerror();
        }
      }
    };
  };
}
// ActiveXObject emulation
if (!window.ActiveXObject && window.XMLHttpRequest) {
  window.ActiveXObject = function(type) {
    switch (type.toLowerCase()) {
      case 'microsoft.xmlhttp':
      case 'msxml2.xmlhttp':
      case 'msxml2.xmlhttp.3.0':
      case 'msxml2.xmlhttp.4.0':
      case 'msxml2.xmlhttp.5.0':
        return new XMLHttpRequest();
    }
    return null;
  };
}

function callBack(file,targetwait,post,params,hand,type){

	if(targetwait)
		targetwait.innerHTML = getLoad();

	var xmlcontent = new XMLHttpRequest();
	if (xmlcontent){
		xmlcontent.onreadystatechange = function() { 
			if(xmlcontent.readyState == 4 && (xmlcontent.status == 200 || xmlcontent.status == 304)) {
				if(hand){
					switch(type){
						case 'xml':
							result = xmlcontent.responseXML;
						break;
							case 'data':
							result = eval(unescape(xmlcontent.responseText));
						break;
						default:
							result = unescape(xmlcontent.responseText);
						break;
					}
					eval(hand);					
				}else{
					if(targetwait) {
					targetwait.innerHTML = xmlcontent.responseText;
					}
					//alert(xmlcontent.responseText);
				}
			}else if(xmlcontent.readyState == 4 && (xmlcontent.status == 500 || xmlcontent.status == 404)){
				alert('AVISO!\n\n [ ERRO na requisição ] \n\n Entre em contato com o suporte \n \n _________________________________________\n 2006 Manager - Assessoria em Recursos Humanos ');
                 return false;
				//Tirar o comentário abaixo para exibição do Erro técnico.
				//alert(xmlcontent.responseText) 				
			}
		};
		if(!post){
 			xmlcontent.open('GET', file + '?' + params, true);
			if(type == 'xml')
				xmlcontent.setRequestHeader('Content-Type','text/xml');
			else			
				xmlcontent.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
			xmlcontent.send(null);
		}else{
			xmlcontent.open('POST', file, true);
			if(type == 'xml')
				xmlcontent.setRequestHeader('Content-Type','text/xml');
			else
				xmlcontent.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
			
			xmlcontent.send(params);
		}		
	}
}

/**********************************************************
	Detecta qual borwser o usuario esta utilizando
**********************************************************/
function detectBrowser() {
	return navigator.appName;
}

/**********************************************************
	Cria um requisicao HTTP utilizando objeto XMLHTTP
**********************************************************/
function createHttpRequest() {
	if(detectBrowser() == 'Microsoft Internet Explorer')
		return new ActiveXObject ("Microsoft.XMLHTTP");
	else
		return new XMLHttpRequest();
}


/**********************************************************
	Abre e envia uma requisicao HTTP
**********************************************************/

function sendRequest(method, url, sync) {
	xmlhttp = createHttpRequest();
	xmlhttp.open(method, url, sync);
	xmlhttp.send(null);
	return xmlhttp;
}


/**********************************************************
	Retorna um objeto de texto XML baseado no nome do
	elemento solicitado
**********************************************************/
function getSingleTextObject(elem_obj, elem_name) {
	element_object = elem_obj.getElementsByTagName(elem_name);
	text_object = element_object[0].firstChild;
	return text_object;
}

function getLoad(){

	return '<div style="text-align:center; padding-top:10px;">' +
		   '<img src="pictures/carregando.gif" style="vertical-align:middle;"> Aguarde, carregando...' +
		   '</div>';
}

function loadCidadesEstado(){
	loadCidades(document.getElementById('estado'), document.getElementById('cidade_id'));
}

function loadCidadesEstado_pj(){
	loadCidades(document.getElementById('pj_estado'), document.getElementById('pj_cidade_id'));
}



/****************************************************
	Carrega todas as cidades para um determinado estado
	Integrado em XML
****************************************************/
function loadCidades(obj_estados, obj_cidades, cidade_id_value) {
	var uf = obj_estados[obj_estados.selectedIndex].value;	
	obj_cidades.disabled = false;
	obj_cidades.length = 0;

	// Requisicao de dados ao XML
	xmlhttp = sendRequest('GET', 'xml_cidades.php?uf='+uf, false);	
	var elem_cidades = xmlhttp.responseXML.documentElement.getElementsByTagName('cidade');
	
	// Itera nas cidades do XML
	if(elem_cidades.length > 0)
		obj_cidades.options[0] = new Option('-- Selecione --', '0');
	for(i=0; i < elem_cidades.length; i++) {
		var cidade_id = getSingleTextObject(elem_cidades[i], 'cidade_id');
		var nome = getSingleTextObject(elem_cidades[i], 'nome');
		obj_cidades.options[i+1] = new Option(nome.nodeValue, cidade_id.nodeValue);
		
		if(cidade_id_value == cidade_id.nodeValue)
			obj_cidades.options[i+1].selected = true;
	}
}


/**********************************************************
	Verifica se e um email valido
**********************************************************/
function isEmail(campo){
	//campo_email = campo.value;
	//strMail = new String(campo_email);
	//re = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	//return strMail.search(re); 
	var valEmail = /^[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;

	if (valEmail.test(campo.value)) { 
		return false; 
	} else { 
		return true; 
	}
}

/**********************************************************
	Verifica se e um Telefone valido
**********************************************************/
function isTelefone(campo) {
	if(RegXp("[0-9]{7,15}", campo))
		return true;
	else
		return false;
}


/**************************************************** 
	Verifica se uma data e valida
****************************************************/
function setGoodDate(objFrmDate) {

	arrDate = objFrmDate.value.split('/');
	if(arrDate.length == 3) {
		dia = arrDate[0];
		mes = arrDate[1];
		ano = arrDate[2];
		objDate = new Date(ano, mes-1, dia);
		if(ano != objDate.getFullYear() || mes != objDate.getMonth()+1 || dia != objDate.getDate()) {
			alert('Digite a data no formato: dd/mm/aaaa');
			objFrmDate.focus();
		}
	}
	else if(objFrmDate.value.length != 0) {
		alert('Digite a data no formato: dd/mm/aaaa');
		objFrmDate.focus();
	}
}

function init()	{	
	var vBanners = new Array("pictures/banner01.jpg", "pictures/banner02.jpg", "pictures/banner03.jpg", "pictures/banner04.jpg");
	var index = parseInt((vBanners.length * Math.random()));
	var bannerImg = vBanners[index];
	var oBanner = document.getElementById("ba");
	if (!oBanner) oBanner = document.all["ba"];
	oBanner.src = bannerImg;
}