function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ValidaLingua(lang)
{
document.goHome.lang.value = lang;
document.goHome.submit();
}

function NavigateURL(URL)
{
	document.goHome.action = URL
	document.goHome.submit();
}
function DoLogin()
{
if ((document.login.username.value != "") && (document.login.password.value != "")) {
	document.login.action = "../login.asp"
	document.login.submit();
} else {
	return;
}		
}	
function popupImage(path,width,height,resize,scroll,limit)
{
	if (resize == 1) {
			resize = "yes";
		} else {
			resize = "no";
		}
	if (scroll == 1) {
			scroll = "yes";
		} else {
			scroll = "no";
		}		
	var popup = window.open('../generic/ShowImg.asp?limit='+limit+'&Img='+ path , "Imagens", "width="+width+",height="+height+",scrollbars="+scroll+",dependent=no,location=no,titlebar=no,menubar=no,resizable="+resize+",status=no");
}
function popupImageClean(path,width,height,resize,scroll,limit)
{
	if (resize == 1) {
			resize = "yes";
		} else {
			resize = "no";
		}
	if (scroll == 1) {
			scroll = "yes";
		} else {
			scroll = "no";
		}		
	var popup = window.open(path , "Imagens", "width="+width+",height="+height+",scrollbars="+scroll+",dependent=yes,location=no,titlebar=no,menubar=no,resizable="+resize+",status=no");
}
function GoNewsDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
if (uid != "") {
	FormNav.idnoticia.value = uid;
} else {
	var FormId = FormNav.NewsCombo.options[FormNav.NewsCombo.options.selectedIndex].value;
	if (FormId != "") {
		FormNav.idnoticia.value = FormId;
	} else {
		return;
	}
}
FormNav.action = '../news/news_detail.asp';
FormNav.submit();
}

function GoInterDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
if (uid != "") {
	FormNav.idinter.value = uid;
} else {
	var FormId = FormNav.InterCombo.options[FormNav.InterCombo.options.selectedIndex].value;
	if (FormId != "") {
		FormNav.idinter.value = FormId;
	} else {
		return;
	}
}		
FormNav.action = '../Inter/Interview_detail.asp';
FormNav.submit();
}

function GoMediaDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
if (uid != "") {
	FormNav.idmedia.value = uid;
} else {
	var FormId = FormNav.MediaCombo.options[FormNav.MediaCombo.options.selectedIndex].value;
	if (FormId != "") {
		FormNav.idmedia.value = FormId;
	} else {
		return;
	}
}		
FormNav.action = '../Inter/media_detail.asp';
FormNav.submit();
}

function GoShowsDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
FormNav.idshow.value = uid.split("|")[0];
FormNav.codband.value = uid.split("|")[1];
FormNav.codbanddesig.value = uid.split("|")[2];
FormNav.action = '../show/show_band.asp';
FormNav.submit();
}

function GoShowsBandsDet(frmName)
{
var FormNav=eval("document."+frmName);
if ((FormNav.ShowBandSelect.options[FormNav.ShowBandSelect.options.selectedIndex].value) != "") {
	var FormShowId = (FormNav.ShowBandSelect.options[FormNav.ShowBandSelect.options.selectedIndex].value).split("|")[0];
	var FormId = (FormNav.ShowBandSelect.options[FormNav.ShowBandSelect.options.selectedIndex].value).split("|")[1];
	var FormIdDesig = FormNav.ShowBandSelect.options[FormNav.ShowBandSelect.options.selectedIndex].text;
		if (FormId != "") {
			FormNav.idshow.value = FormShowId;
			FormNav.codband.value = FormId;
			FormNav.codbanddesig.value = FormIdDesig; 
		} else {
			return;
		}
			
	FormNav.action = '../Show/show_band.asp';
	FormNav.submit();
} else {
			return;
		}	
}
function GoEventDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
if (uid != "") {
	FormNav.idevent.value = uid;
} else {
	var FormId = FormNav.EventCombo.options[FormNav.EventCombo.options.selectedIndex].value;
	if (FormId != "") {
		FormNav.idevent.value = FormId;
	} else {
		return;
	}
}		
FormNav.action = '../Event/Event_detail.asp';
FormNav.submit();
}

function GoBandsDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
if (uid != "") {
	FormNav.idband.value = uid;
} else {
	var FormId = FormNav.BandCombo.options[FormNav.BandCombo.options.selectedIndex].value;
	if (FormId != "") {
		FormNav.idband.value = FormId;
	} else {
		return;
	}
}		
FormNav.action = '../band/band_detail.asp';
FormNav.submit();
}

function GoForumDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
if (uid != "") {
	FormNav.tp.value = uid;
} else {
	return;	
}		
FormNav.action = '../Foruns/tppage.aspx';
FormNav.submit();
}
function GoNoviDet(cod,frmName)
{
var FormNav=eval("document."+frmName);
FormNav.area.value = cod;
FormNav.action = '../novi/novi_detail.asp';
FormNav.submit();
}

function GoMerchDet(frmName)
{
var FormNav=eval("document."+frmName);
var FormId = FormNav.MerchCombo.options[FormNav.MerchCombo.options.selectedIndex].value;
var FormIdDesig = FormNav.MerchCombo.options[FormNav.MerchCombo.options.selectedIndex].text;
	if (FormId != "") {
		FormNav.area.value = FormId;
		FormNav.areadesig.value = FormIdDesig; 
	} else {
		return;
	}
FormNav.action = '../merch/merch_detail.asp';
FormNav.submit();	
}	

function GoLinkDet(frmName)
{
var FormNav=eval("document."+frmName);
var FormId = FormNav.LinkCombo.options[FormNav.LinkCombo.options.selectedIndex].value;
var FormIdDesig = FormNav.LinkCombo.options[FormNav.LinkCombo.options.selectedIndex].text;
	if (FormId != "") {
		FormNav.area.value = FormId;
		FormNav.areadesig.value = FormIdDesig; 
	} else {
		return;
	}
FormNav.action = '../link/link_detail.asp';
FormNav.submit();	
}	

function MerchNav(valor){
				document.navMerch.page.value = valor;
				document.navMerch.submit();		
}

function GoPressDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
if (uid != "") {
	FormNav.pressid.value = uid;
} else {
	var FormId = FormNav.PressCombo.options[FormNav.PressCombo.options.selectedIndex].value;
	if (FormId != "") {
		FormNav.pressid.value = FormId;
	} else {
		return;
	}
}
FormNav.action = '../press/press.asp';
FormNav.submit();
}

function GoAgentDet(uid,frmName)
{
var FormNav=eval("document."+frmName);
if (uid != "") {
	FormNav.agentid.value = uid;
} else {
	var FormId = FormNav.AgentCombo.options[FormNav.AgentCombo.options.selectedIndex].value;
	if (FormId != "") {
		FormNav.agentid.value = FormId;
	} else {
		return;
	}
}
FormNav.action = '../agent/agent.asp';
FormNav.submit();
}

function bannerTopRotate() {

if(myCountTop > bannerTopArray.length-1){myCountTop=0;}

// Write out rotation
	if (document.all){			// it is IE
		document.all.DivTopBanner.innerHTML=bannerTopArray[myCountTop];
	}

	else if (document.layers){	// it is NN

	document.layers.TopBanner.document.layers.LayerSubTopBanner.document.open();
	document.layers.TopBanner.document.layers.LayerSubTopBanner.document.write(bannerTopArray[myCountTop]);
	document.layers.TopBanner.document.layers.LayerSubTopBanner.document.close();
	}
setTimeout("bannerTopRotate()", 16000);
myCountTop++;
}

function bannerDestRotate() {

if(myCountDest > bannerDestArray.length-1){myCountDest=0;}

// Write out rotation
	if (document.all){			// it is IE
		document.all.DivDestBanner.innerHTML=bannerDestArray[myCountDest];
	}

	else if (document.layers){	// it is NN

	document.layers.DestBanner.document.layers.LayerSubDestBanner.document.open();
	document.layers.DestBanner.document.layers.LayerSubDestBanner.document.write(bannerDestArray[myCountDest]);
	document.layers.DestBanner.document.layers.LayerSubDestBanner.document.close();
	}
setTimeout("bannerDestRotate()", 16000);
myCountDest++;
}
function EmailCheck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}
function GoRegisterMail()
{

if (document.EmailForm.email.value != "")  {
	if (EmailCheck(document.EmailForm.email.value))
	{
		var xmlhttp = false; 
		if (window.XMLHttpRequest) { 
			xmlhttp = new XMLHttpRequest(); 
		} 
		else if (window.ActiveXObject) { 
				try { 
					xmlhttp = new ActiveXObject("msxml2.xmlhttp"); 
					} 
					catch (e){ 
							try{ 
								xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
							} 
							catch (e){
							} 
					} 
		} 
		//dev 
		//xmlhttp.open("GET","/xuxaprod20080519_newstuff/xuxa2/new_generic/insere_mail.asp?email="+document.EmailForm.email.value, false);
		//prod
		xmlhttp.open("GET","/xuxa2/new_generic/insere_mail.asp?email="+document.EmailForm.email.value, false);
		xmlhttp.send(null);
		var xmldoc = xmlhttp.responseXML.documentElement;
		alert(xmldoc.getElementsByTagName("result")[0].childNodes[0].nodeValue);

	}
	else
	{
		alert('Email Inválido');
		return;
	}
} else {
	return;
}		
}