/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
function t(){
}




/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
function hidePlot()
{
	document.getElementById("FULL-LIST").style.display = "block";
	//document.getElementById('FULL-LIST').style.visibility = 'visible';	
	document.getElementById("PLOTVIEW").style.display = "none";	
}
function hideFrame()
{
	document.getElementById("FULL-LIST").style.display = "block";
	document.getElementById("FRAMEAREA").style.display = "none";	
}
/**********************************************************************/


TypeSelected="GALLERY";

function changeElements(parent,NewType) {
	var y = parent.childNodes;
	var t='<br>'+parent.id+"  :  "+y.length+"";
	for(var c=0; c<y.length;c++) {
		if(y[c].tagName!="DIV" && y[c].tagName!=null) {
			y[c].className=NewType;			
			if(y[c].hasAttribute('data-id-type'))
				if(y[c].getAttribute('data-id-type')!=null)
					y[c].className=NewType+'-'+y[c].getAttribute('data-id-type');			
		}		
		//t+="   {   "+y[c].id+'@'+y[c].tagName+": "+y[c].className+"  }  ";
		t+=changeElements(y[c],NewType);		
	}	
	return t+"<br>";
}

function changeView(NewType)
{
	var debug = document.getElementById('DEBUG001');
	//document.getElementById("P001").className = NewType;//"mystyle";
	var y = document.getElementById("FULL-LIST").childNodes;
	var txt="<br>LISTA<br>";
	for (var i=0; i<y.length; i++) {
		y[i].className=NewType;
		//changeElements(y[i],NewType);
		var c = y[i].childNodes;//firstChild.getElementsByTagName("table");
		for (var f = 0; f < c.length; f++) {
			c[f].className=NewType+"-CONTROLS";
			txt+=changeElements(c[f],NewType);					
		}	
	}	
	//if(debug)	debug.innerHTML = txt;
}


/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
function hideFrame()
{
	//document.getElementById("FULL-LIST").style.display = "block";
	//document.getElementById("BASEFRAME").style.display = "none";
	//document.getElementById("FULL-LIST").style.visibility = "visible";	
	document.getElementById("FRAMEAREA").style.display = 'none';	
	document.getElementById("HTMLBODY").style.overflow = "auto";	
}
function loadPLAYER(selid) 
{	
	//document.getElementById("FULL-LIST").style.display = "none";	
	document.getElementById("HTMLBODY").style.overflow = "hidden";
	//document.getElementById("FULL-LIST").style.visibility = "collapse";//"hidden";
	document.getElementById("FRAMEAREA").style.display = 'block';
	document.getElementById('WAFRAME').src = "player/?id="+selid;	
} /**********************************/
function loadFrame(URL,SID) 
{	
	//document.getElementById("FULL-LIST").style.display = "none";	
	document.getElementById("HTMLBODY").style.overflow = "hidden";
	//document.getElementById("FULL-LIST").style.visibility = "collapse";//"hidden";
	document.getElementById("FRAMEAREA").style.display = 'block';
	document.getElementById('WAFRAME').src = URL+"?id="+SID;	
}
/**********************************************************************/




/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
function hideViewer()
{
	//alert("VIEWERAREA");
	
	document.getElementById("HTMLBODY").style.overflow = "auto";	
	
	//document.getElementById("FULL-LIST").style.display = "block";	
	
	
	document.getElementById('FULL-LIST').style.visibility = 'visible';	
	document.getElementById('DIVCLIENT').style.visibility = 'visible';
	
	document.getElementById("VIEWER-AREA").style.display = "none";
	document.getElementById("DIVCLIENT").style.opacity = "1";
	//opacity
}
function showViewer(viewer,selid) 
{	
	var URL = viewer+"?id="+selid;
	//document.getElementById("DIVCLIENT").style.opacity = "0.2";
	//document.getElementById('FULL-LIST').style.display = 'none';
	
	document.getElementById("HTMLBODY").style.overflow = "hidden";	
	
	document.getElementById('DIVCLIENT').style.visibility = 'hidden';	
	document.getElementById('FULL-LIST').style.visibility = 'hidden';	
		
	document.getElementById("VIEWER-AREA").style.display = 'block';
	document.getElementById("VIEWER-CLIENT").innerHTML = "<br><br><br><center>Loading informations: !!!!!<br>Please wait</center><br><br><br>";
	var xmlhttp = new XMLHttpRequest();
	xmlhttp.onreadystatechange = function() {
		if (this.readyState == 1) {	
			document.getElementById("VIEWER-CLIENT").innerHTML = "<br><br><br><center>OPENED</center><br><br><br>";
		}					
		if (this.readyState == 2) {	
			document.getElementById("VIEWER-CLIENT").innerHTML = "<br><br><br><center>HEADERS_RECEIVED<br><br>"+URL+"</center><br><br><br>";
		}		
		if (this.readyState == 3) {	
			document.getElementById("VIEWER-CLIENT").innerHTML = "<br><br><br><center>Carregando informoçoes<br><br><br>"+URL+"<br>Por favor agarde!!<br></center><br><br><br>";
		}						
		if (this.readyState == 4 && this.status == 200) {	
			document.getElementById("VIEWER-CLIENT").innerHTML = this.responseText;
		}
	};
	xmlhttp.open("GET",URL,true);
	xmlhttp.send();		
}
