function GoogleView(arg1,arg2,arg3,arg4,arg5) {
	thePage="/onde/default.aspx?accao="+arg5+"&regiao="+arg4+"&distrito="+arg3+"&lat="+arg1+"&long="+arg2
	window.location=thePage;

	//thePage="/lojas/mapa.aspx?lat="+arg1+"&long="+arg2
	//window.open(thePage,'nova','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=510')
	}

function ValidarDistrito(source, arguments) {
	if (document.form1.ListboxDistrito.selectedIndex == 0) {
		arguments.IsValid = false
	} else {
		arguments.IsValid = true
	}
}

function ValidarMarca(source, arguments) {
	if (document.form1.ListboxMarcas.selectedIndex == 0) {
		arguments.IsValid = false
	} else {
		arguments.IsValid = true
	}
}

function ValidarModelo(source, arguments) {
	if (document.form1.ListboxModelos.selectedIndex == 0) {
		arguments.IsValid = false
	} else {
		arguments.IsValid = true
	}
}

function ValidarVersao(source, arguments) {
	if (document.form1.ListboxVersoes.selectedIndex == 0) {
		arguments.IsValid = false
	} else {
		arguments.IsValid = true
	}
}

function ValidarStand(source, arguments) {
	if (document.form1.cboStand.selectedIndex == 0) {
		arguments.IsValid = false
	} else {
		arguments.IsValid = true
	}
}



function flag(){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '50',
			'height', '110',
			'src', '/flash/flag',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'acessorios_vetus',
			'bgcolor', '#ffffff',
			'name', '/flag',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', '/flash/flag',
			'salign', ''
			); //end AC code
	}
}
function bannerTopo(){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '365',
			'height', '110',
			'src', '/flash/bannerTopo',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'acessorios_vetus',
			'bgcolor', '#ffffff',
			'name', '/flag',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', '/flash/bannerTopo',
			'salign', ''
			); //end AC code
	}
}
function homeDestaque(){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '487',
			'height', '291',
			'src', '/flash/home/homeDestaque',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'acessorios_vetus',
			'bgcolor', '#ffffff',
			'name', 'destqueHome',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', '/flash/home/homeDestaque',
			'salign', ''
			); //end AC code
	}
}

function xmlDataReader(){
	this.xmlList = null;
	this.htmlTemplate = null;
	this.htmlTemplate2 = null;
	this.xmlObjct = null;
	this.xmlLoadFinishCallBack = null;
	this.loader = 0;
}

xmlDataReader.prototype.load = function(xmlPath, callBack){
	this.xmlLoadFinishCallBack = callBack;
	
	if(xmlPath.indexOf("?") != -1){xmlPath = xmlPath+"&v="+Math.random();}
	else{xmlPath= xmlPath+"?v="+Math.random();}
	
	if (window.XMLHttpRequest)
	{
		this.loader = new XMLHttpRequest();
		this.loader.onreadystatechange = this.xmlLoadFinished;
		this.loader.open("GET",xmlPath,true);
		this.loader.send(null);
	}
		// Procura por uma versão ActiveX (IE)
	else if (window.ActiveXObject)
	{
		this.loader = new ActiveXObject("Microsoft.XMLHTTP");
		if (this.loader)
		{
			this.loader.onreadystatechange = this.xmlLoadFinished;
			this.loader.open("GET",xmlPath,true);
			this.loader.send();
		}
	}
	this.loader.supra = this;
}

xmlDataReader.prototype.xmlLoadFinished = function(){
	// apenas quando o estado for "completado"
	if (this.readyState == 4)
	{
		// apenas se o servidor retornar "OK"
		if (this.status == 200)
		{
			//this.xmlList = this.loader.responseText;
			this.supra.xmlList = this.supra.parseXml(this.responseText);
			if(this.supra.xmlLoadFinishCallBack != null){
				this.supra.xmlLoadFinishCallBack();
			}
		}
		else
		{
			alert("Ocorreu um erro ao carregar dados XML.");
		}
	}
	if(this.readyState == 1){
		//
	}
}

xmlDataReader.prototype.parseXml = function(xml){
   var dom = null;
   if (window.DOMParser) {
	  try { 
		 dom = (new DOMParser()).parseFromString(xml, "text/xml"); 
	  } 
	  catch (e) { dom = null; }
   }
   else if (window.ActiveXObject) {
	  try {
		 dom = new ActiveXObject('Microsoft.XMLDOM');
		 dom.async = false;
		 if (!dom.loadXML(xml)) // parse error ..
			window.alert(dom.parseError.reason + dom.parseError.srcText);
	  } 
	  catch (e) { dom = null; }
   }
   else
	  alert("oops");
   return dom;
}

xmlDataReader.prototype.parseXmlTemplate = function(itemRef, div, callBack){
	if(this.xmlList != null){json = xml2json(this.xmlList, " ");}else{alert('XMLNeed to Load First!');return;}
	
	this.xmlObjct = eval('(' + json + ')');
	
	this.htmlTemplate = this.xmlObjct.content.htmlTemplate["#cdata"];
	
	for(var i=0; i < this.xmlObjct.content.item.length; i++){
		if(this.xmlObjct.content.item[i]["@itemRef"] == itemRef){
		
			for(var j=0; j < this.xmlObjct.content.item[i].node.length; j++){
				this.htmlTemplate = this.htmlTemplate.replace(this.xmlObjct.content.item[i].node[j]["@ref"], 
															  this.xmlObjct.content.item[i].node[j]["#cdata"]);
			}
			
		}
	}
	document.getElementById(div).innerHTML = this.htmlTemplate;
	if(callBack != null){callBack();}
}

var index = 0;

xmlDataReader.prototype.allXML = function(){
	clearInterval(this.intervalid);
	if(this.xmlList != null){json = xml2json(this.xmlList, " ");}else{alert('XMLNeed to Load First!');return;}
	
	this.xmlObjct = eval('(' + json + ')');
	
	this.htmlTemplate = this.xmlObjct.content.htmlTemplate["#cdata"];
			
			for(var j=0; j < this.xmlObjct.content.item[index].node.length; j++){
					this.htmlTemplate = this.htmlTemplate.replace(this.xmlObjct.content.item[index].node[j]["@ref"], 
																  this.xmlObjct.content.item[index].node[j]["#cdata"]);
					}		
					
			document.getElementById('homeDeploy').innerHTML = this.htmlTemplate;
		index++;
		if (index >= this.xmlObjct.content.item.length) {index=0;}
		
		supra = this;
		
		this.intervalid = setInterval("supra.allXML()", 5000);	
}

var index2 = 0;

xmlDataReader.prototype.allXMLConsultados = function(){
	clearInterval(this.intervalid2);
	if(this.xmlList != null){json = xml2json(this.xmlList, " ");}else{alert('XMLNeed to Load First!');return;}
	
	this.xmlObjct = eval('(' + json + ')');
	
	this.htmlTemplate2 = this.xmlObjct.content.htmlTemplate2["#cdata"];
			
			for(var j=0; j < this.xmlObjct.content.item[index2].node.length; j++){
					this.htmlTemplate2 = this.htmlTemplate2.replace(this.xmlObjct.content.item[index2].node[j]["@ref"], 
																  this.xmlObjct.content.item[index2].node[j]["#cdata"]);
				}		
				

			document.getElementById('consultadosDeploy').innerHTML = this.htmlTemplate2;
		index2++;
		if (index2 >= this.xmlObjct.content.item.length) {index2=0;}
		
		supra2 = this;
		
		this.intervalid2 = setInterval("supra2.allXMLConsultados()", 5000);	
}




