
function Newwindow(filename,windowname,width,height) 
{ 
window.open(filename,windowname,"toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=738,height=650")}



function setPrint() {
   document.getElementById('header').style.display = 'none'; 
   document.getElementById('footer').style.display = 'none';
   document.getElementById('alsoVisit').style.display = 'none'; 
   document.getElementById('container').style.backgroundColor  = '#FFFFFF'; 
   document.getElementById('col21').style.backgroundColor  = '#FFFFFF'; 
   document.getElementById('col22').style.display = 'none'; 
   document.getElementById('col23').style.backgroundColor  = '#FFFFFF'; 
   document.getElementById('col23').style.textAlign = 'right';
   document.getElementById('lyricscontainer').style.backgroundColor  = '#FFFFFF'; 
   document.getElementById('body').style.backgroundColor  = '#FFFFFF'; 
  
}

function isPrint() {
	
	var urlVars = getUrlVars();
	if (urlVars[1] != 0 && urlVars[1]) {
		setPrint(); }
}

function getUrlVars(){    
var vars = [], hash;    
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');     
for(var i = 0; i < hashes.length; i++)    {       
hash = hashes[i].split('=');       
vars.push(hash[0]);       
vars[hash[0]] = hash[1];   
}    
return vars;}

function datosServidor() {
};
datosServidor.prototype.iniciar = function() {
	try {
		// Mozilla / Safari
		this._xh = new XMLHttpRequest();
	} catch (e) {
		// Explorer
		var _ieModelos = new Array(
		'MSXML2.XMLHTTP.5.0',
		'MSXML2.XMLHTTP.4.0',
		'MSXML2.XMLHTTP.3.0',
		'MSXML2.XMLHTTP',
		'Microsoft.XMLHTTP'
		);
		var success = false;
		for (var i=0;i < _ieModelos.length && !success; i++) {
			try {
				this._xh = new ActiveXObject(_ieModelos[i]);
				success = true;
			} catch (e) {
				// Implementar manejo de excepciones
			}
		}
		if ( !success ) {
			// Implementar manejo de excepciones, mientras alerta.
			return false;
		}
		return true;
	}
}

datosServidor.prototype.ocupado = function() {
	estadoActual = this._xh.readyState;
	return (estadoActual && (estadoActual < 4));
}

datosServidor.prototype.procesa = function() {
	if (this._xh.readyState == 4 && this._xh.status == 200) {
		this.procesado = true;
	}
}

datosServidor.prototype.enviar = function(urlget,datos) {
	if (!this._xh) {
		this.iniciar();
	}
	if (!this.ocupado()) {
		//this._xh.open("GET",urlget,false);
		//this._xh.send(datos);
		//if (this._xh.readyState == 4 && this._xh.status == 200) {
		//	return this._xh.responseText;
		//}
		
	}
	return false;
}


// Este es un acceso rapido, le paso la url y el div a cambiar
function _gr(reqseccion,divcont) {
	remotos = new datosServidor;
	nt = remotos.enviar(reqseccion,"");
	document.getElementById(divcont).innerHTML = nt;
}



//Estas dos son para guardar

var urlBase = "update.php?";


function rateSong(rating,songID, id)  {
		//remotos = new datosServidor;
		//nt = remotos.enviar('update.php?rating='+rating+'&imgId='+imgId);
		rating = rating * 25;
		document.getElementById('current-rating' + id).style.width = rating+'px';
		if(id==1) {
			document.vote.rating_corr.value = rating/25;
		}
		if(id==2) {
			document.vote.rating_over.value = rating/25;
		}
}







