<!--
///----------------------------------------------------------------------------------------------------------------------------------
//DisableEnterKeyAction()
//----------------------------------------------------------------------------------------------------------------------------------
function DisableEnterKeyAction()
{
	if(document.all)
	{
		if(event.keyCode == 13)
		{
			event.returnValue = false;
			event.cancel = true;
		}
	}
}


//----------------------------------------------------------------------------------------------------------------------------------
//viewPanel - CategorySelector control
//----------------------------------------------------------------------------------------------------------------------------------
function VC(x, img)
{
	//alert("viewPanel");
	
	var str = img.src;

	if(x.style.display == "none")
	{
		x.style.display = "";
		img.src = str.replace("plus.gif", "minus.gif");
	}
	else
	{ 
		x.style.display = "none";
		img.src = str.replace("minus.gif", "plus.gif");
	}
}	

/*
	Change the view in the control +/-


*/
function ChangeView(group, img)
{
	
	var str = img.src;
	var row;
	for ( i=0; i< tableZonaView.rows.length; i++)
	{
		row = tableZonaView.rows[i];
		var s = row.id.substr(0,group.length);
		if (s == group)
		{
			if (row.style.display == "none")
			{
				row.style.display = "";
				img.src = str.replace("plus.gif", "minus.gif");
			}
			else
			{
				row.style.display = "none";
				img.src = str.replace("minus.gif", "plus.gif");
			}
		}
	}
	
}	
	
function ShowImage(url)
{
	
		//window.showModelessDialog(url, window , "dialogTop:" + 100 + "; dialogLeft:" + 200 + "; dialogHeight: 550px ; dialogWidth: 450px ; Help : no ; scroll : no ; center : no ; help : no ; resizable : no ; status : no ; unadorned : no");					
		//window.showModelessDialog(url, window , "dialogTop:" + 100 + "; dialogLeft:" + 200 + "; dialogHeight: 550px ; dialogWidth: 450px ; Help : no ; scroll : no ; center : no ; help : no ; resizable : no ; status : no ; unadorned : no");							
		window.open(url, null,"height=450,width=550,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
}
		

//----------------------------------------------------------------------------------------------------------------------------------
//FocusOn()
//----------------------------------------------------------------------------------------------------------------------------------
function FocusOn(obj)
{
	if(typeof(obj) == "object")
	{
		obj.focus();
	}
}


//----------------------------------------------------------------------------------------------------------------------------------
//CheckKeyPressed()
//----------------------------------------------------------------------------------------------------------------------------------
function CheckKeyPressed(obj)
{
	if(document.all)
	{
		if(event.keyCode == 13)
		{
			event.returnValue = false;
			event.cancel = true;
			obj.click();
		}
	}
}


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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


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_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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

//Show The Calendar Window
function CalendarWindowOpen(ControlID, allowTime, left, top)
{
	var strTarget =  "/PortalRadio/Scripts/DateSelectionIFrame.aspx?id=" + ControlID + "&ReturnTime=" + allowTime;
	var resStr = window.showModalDialog(strTarget, window , "dialogTop:" + top + "; dialogLeft:" + left + "; dialogHeight: 190px ; dialogWidth: 215px ; Help : no ; scroll : no ; center : no ; help : no ; resizable : no ; status : no ; unadorned : no");			
	if(resStr !=undefined)
		window.document.all[ControlID + ":" + ControlID].value = resStr;
}

function doPesquisar(  ){
	__doPostBack ("PESQUISA", '');
		
}


MM_reloadPage(true);

// Open Sintonizador Window
function OpenSintonizador(radioID)
{
	window.open("/portalradio/Sintonizador/?radio_id=" + radioID + "&scope=0","Sintonizador","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,directories=0,status=0,height=445,width=250,left=0,top=0,screenX=0,screenY=100");
}


//----------------------------------------------------------------------------------------------------------------------------------
// GN_WriteUTC2Local()
//----------------------------------------------------------------------------------------------------------------------------------

// Define constants
var GN_ARRAY_MONTH_NAME = new Array ("Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez");

//	Write date in local time
function GN_writeUTC2Local(strDate)
{
	var pDate = new Date(strDate);
	GN_writeDate(GN_convertUTC2Local(pDate));
}

//	Write date using document.write()
function GN_writeDate(pDate) 
{
	document.write( GN_formatDateToString( pDate, false ) );
}

//	Convert GMT time to local time
function GN_convertUTC2Local(pDateUTC)
{
	return new Date(pDateUTC.getTime() - pDateUTC.getTimezoneOffset() * 60 * 1000);
}	

//	Return a date string in the "DD MMM YYYY, hh:mm:ss am/pm" or 24 hour "DD MMM YYYY, hh:mm:ss" format
function GN_formatDateToString( pDate, bAmPm )
{
	if (bAmPm)
	{
		var nHours =  pDate.getHours();
		var strAmPm;
		if (nHours == 0) {
			nHours = 12;
			strAmPm = "am";
		} else if (nHours == 12) {
			strAmPm = "pm";
		} else if (nHours > 12) {
			nHours = nHours - 12;
			strAmPm = "pm";
		} else {
			strAmPm = "am";
		}

		return ( GN_addLeadingZero(pDate.getDate()) + " " + GN_ARRAY_MONTH_NAME[pDate.getMonth()] + " " + GN_fixJavaScriptYear(pDate.getFullYear()) + ", " + GN_addLeadingZero(nHours) + ":" + GN_addLeadingZero(pDate.getMinutes()));// + ":" + GN_addLeadingZero(pDate.getSeconds()) + " " + strAmPm );
	}
	else
	{
		return ( GN_addLeadingZero(pDate.getDate()) + " " + GN_ARRAY_MONTH_NAME[pDate.getMonth()] + " " + GN_fixJavaScriptYear(pDate.getFullYear()) + " " + GN_addLeadingZero(pDate.getHours()) + ":" + GN_addLeadingZero(pDate.getMinutes()));// + ":" + GN_addLeadingZero(pDate.getSeconds()));
	}
}

// Add leading zero to number less than 10
function GN_addLeadingZero(nNum)
{
	if (nNum < 10) 
	{
		return "0" + nNum;
	}
	else 
	{
		return nNum;
	}
}

// Returns correct year for any year after 1000
function GN_fixJavaScriptYear( nYear )
{
	if (nYear < 1000) 
	{
		return nYear + 1900;
	}
	else 
	{
		return nYear;
	}
}

//	Convert GMT time to local time
function GN_convertUTC2Local(pDateUTC)
{
	return new Date(pDateUTC.getTime() - pDateUTC.getTimezoneOffset() * 60 * 1000);
}	

function ShowUtcDate( strdata )
	{
		//alert(strdata)
		
		var arrData = strdata.split( '-');
		//alert(" DATA DE ENTRADA:" + strdata.getDate() + "-" + strdata.getMonth() + 1 + "-" + strdata.getFullYear())
		//var pDate = new Date(strdata);
		if(arrData.length > 5){
			//
			var pDate = new Date(arrData[2],arrData[1] - 1,arrData[0], arrData[3], arrData[4],arrData[5]);		
			//alert(" DATA DE SAIDA:" + pDate.getDate() + "-" + pDate.getMonth()  + "-" + pDate.getFullYear())
						
			return GN_formatDateToString(GN_convertUTC2Local(pDate), false)			
		}
		return strdata;
	}




//-->