function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=1,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
//WinPrint.close();
}


function comments(myurl) {
var w = 480
var h = 580
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes, resizable=no, status=yes'
var newWindow;
newWindow = window.open(myurl, "PETITA", props);
newWindow.window.focus();
}

function small_window(myurl) {
var w = 350
var h = 260
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
var newWindow;
newWindow = window.open(myurl, "Add_from_Src_to_Dest", props);
}

function small_window2(myurl) {
var w = 550
var h = 350
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winl+', scrollbars=no, resizable=no'
var newWindow;
newWindow = window.open(myurl, "Add_from_Src_to_Dest", props);
}

function small_window3(myurl) {
var w = 400
var h = 360
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winl+', scrollbars=no, resizable=no'
var newWindow;
newWindow = window.open(myurl, "Add_from_Src_to_Dest", props);
}

function addToParentList() {
history.go(0)
}


function addSelectedItemsToParent() {
self.opener.history.go(-1);
window.close();
}

function additemsToParent() {
self.opener.history.go(0);
window.close();
}


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_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) { //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 MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}


function mail(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage, myname, winprops)

if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function errores(msg, vari) {
if(vari == 0){
alert (msg)
}
else {
window.location = "edit_secciones_rec.asp?p_cat1="+vari;
}
}

function ajuda_form(msg) {
(alert(msg))
}  


function confirmaborrar(msg, url) {
if (confirm(msg)) {
window.location = url;
}  
} 

function informa(msg) {
(info(msg))
}  


function confirmaborrar_doc(msg, item) {
if (confirm(msg)) {
window.location = "edit_docs_action.asp?p_delete="+item;
}  
}  


function confirmaborrar_artista(msg, item) {
if (confirm(msg)) {
window.location = "edit_jugadores_action.asp?p_delete="+item;
}  
}  

function confirmaborrar_user(msg, item) {
if (confirm(msg)) {
window.location = "edit_usuaris_action.asp?p_delete="+item;
}  
}  

function confirmaborrar_espect(msg, item) {
if (confirm(msg)) {
window.location = "edit_espects_action.asp?p_delete="+item;
}  
}  

function confirmaborrar_event(msg, item) {
if (confirm(msg)) {
window.location = "edit_events_action.asp?p_delete="+item;
}  
}  

function confirmaborrarC(msg, item) {
if (confirm(msg)) {
window.location = "edit_clients_action.asp?p_delete="+item;
}  
}  

function no_seccion(item) {
if (item==0) {
alert ("Seleccione una Sección")
}  
} 
   
function jugador(item) {
if (item==0) {
alert ("¿Quién eres?")
return false
}  else {
return true
}
} 
  
function errores2(msg1, msg2, vari1, vari2) {
if(vari1 == 0){
alert (msg1)
}
else if(vari2 == 0){
alert (msg2)
}
else {
window.location = "edit_variedades_rec.asp?p_cat1="+vari1+"&p_cat2="+vari2;
}
}

function calcular(f, max){
	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;
if (f.p_desc.value.length>max){
alert ("No puede escribir más de "+max+" caracteres.")
}
}
function calcular(f, max){
	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;
if (f.p_desc.value.length>max){
alert ("No puede escribir más de "+max+" caracteres.")
}
}

function calcular2(f, max){
	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;
if (f.p_desc.value.length>max){
alert ("Por favor, acorte el texto.")
}
}

function info(info){
alert (info)
}

function check(f, vari1, vari2, vari3) {
if (f.p_nom.value.length<1){
alert ("Introduzca el Nombre del Artículo.");
return false;
}
else if (f.p_desc.value.length<1){
alert ("Introduzca la Descripción del Artículo.");
return false;
}
else if (f.p_precio.value.length<1){
alert ("Introduzca el Precio del Artículo.");
return false;
}
else {
return true;
}
}
// End -->
function currencyFormat(fld, milSep, decSep, e) {
var sep = 0;
var key = '';
var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789';
var aux = aux2 = '';
var whichCode = (window.Event) ? e.which : e.keyCode;
if (whichCode == 13) return true;  // Enter
key = String.fromCharCode(whichCode);  // Get key value from key code
if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
len = fld.value.length;
for(i = 0; i < len; i++)
if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
aux = '';
for(; i < len; i++)
if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
aux += key;
len = aux.length;
if (len == 0) fld.value = '';
if (len == 1) fld.value = '0'+ decSep + '0' + aux;
if (len == 2) fld.value = '0'+ decSep + aux;
if (len > 2) {
aux2 = '';
for (j = 0, i = len - 3; i >= 0; i--) {
if (j == 3) {
aux2 += milSep;
j = 0;
}
aux2 += aux.charAt(i);
j++;
}
fld.value = '';
len2 = aux2.length;
for (i = len2 - 1; i >= 0; i--)
fld.value += aux2.charAt(i);
fld.value += decSep + aux.substr(len - 2, len);
}
return false;
}

function ajuda(mypage) {
var myname='';
var winl = (screen.width - 420) / 2;
var wint = (screen.height - 300) / 2;
winprops = 'height=300, width=420, top='+wint+',left='+winl+', scrollbars=yes, resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function circular(mypage) {
var myname='';
var winl = (screen.width - 620) / 2;
var wint = (screen.height - 300) / 2;
winprops = 'height=300, width=620, top='+wint+',left='+winl+', scrollbars=yes, resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function finestra1(mypage) {
var myname='';
var winl = (screen.width - 600) / 2;
var wint = (screen.height - 325) / 2;
winprops = 'height=325, width=600, top='+wint+',left='+winl+', scrollbars=no, resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function finestra2(mypage) {
var myname='';
var winl = (screen.width - 780) / 2;
var wint = (screen.height - 580) / 2;
winprops = 'height=580, width=780, top='+wint+',left='+winl+', scrollbars=no, resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function showHintGo(temporada,order,indice) {
document.getElementById("tabla2").innerHTML ="<img src='http://www.visualonline.com/images/loading2.gif'  border=0>";
xmlHttp1=GetXmlHttpObject()
if (xmlHttp1==null) {
alert ("Browser does not support HTTP Request")
return
} 
var url="/clasificaciones.asp?order="+order
url=url+"&temporada="+temporada
url=url+"&sid="+Math.random()
xmlHttp1.onreadystatechange=stateCh1
xmlHttp1.open("GET",url,true)
xmlHttp1.send(null)
document.calData1.sortby.selectedIndex=indice
} 

function stateCh1() { 
if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete") { 
document.getElementById("tabla").innerHTML=xmlHttp1.responseText 
document.getElementById("tabla2").innerHTML=""
} 
} 


function showHintGo2(order,indice) {

xmlHttp12=GetXmlHttpObject()
if (xmlHttp12==null) {
alert ("Browser does not support HTTP Request")
return
} 
var url="/clasificacionesglobal.asp?order="+order

url=url+"&sid="+Math.random()
xmlHttp12.onreadystatechange=stateCh12
xmlHttp12.open("GET",url,true)
xmlHttp12.send(null)
document.calData1.sortby2.selectedIndex=indice
} 

function stateCh12() { 
if (xmlHttp12.readyState==4 || xmlHttp12.readyState=="complete") { 
document.getElementById("tabla22").innerHTML=xmlHttp12.responseText 
} 
} 

function buscaJugador(jug) {
document.getElementById("foto").innerHTML ="<img src='http://www.visualonline.com/images/loading2.gif'  border=0>";
xmlHttp0=GetXmlHttpObject()
if (xmlHttp0==null) {
alert ("Browser does not support HTTP Request")
return
} 
var url="/buscaJug.asp?id="+jug
url=url+"&sid="+Math.random()
xmlHttp0.onreadystatechange=stateCh0
xmlHttp0.open("GET",url,true)
xmlHttp0.send(null)
} 

function stateCh0() { 
if (xmlHttp0.readyState==4 || xmlHttp0.readyState=="complete") { 
document.getElementById("foto").innerHTML=xmlHttp0.responseText 
} 
} 


function showHintPartido(partido,dia) {
document.getElementById("fechaPartido").innerHTML="Partit del "+dia

//document.getElementById("partido2").innerHTML ="<img src='http://www.visualonline.com/images/loading2.gif'  border=0>";
xmlHttp2=GetXmlHttpObject()
if (xmlHttp2==null) {
alert ("Browser does not support HTTP Request")
return
} 
var url="/jugPartidos.asp?partido="+partido
url=url+"&sid="+Math.random()
xmlHttp2.onreadystatechange=stateCh2
xmlHttp2.open("GET",url,true)
xmlHttp2.send(null)
} 

function stateCh2() { 
if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete") { 
document.getElementById("partido").innerHTML=xmlHttp2.responseText 
} 
} 


function showHintForo(partido) {
xmlHttp3=GetXmlHttpObject()
if (xmlHttp3==null) {
alert ("Browser does not support HTTP Request")
return
} 
var url="/foro.asp?partido="+partido
url=url+"&sid="+Math.random()
xmlHttp3.onreadystatechange=stateCh3
xmlHttp3.open("GET",url,true)
xmlHttp3.send(null)
} 

function stateCh3() { 
if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete") { 
document.getElementById("foro").innerHTML=xmlHttp3.responseText 
} 
} 





function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
} 




				var linea='c';
				var linea_old='z';
				var base_linea_old='z';


				function cambiaColor(id, src, color)
				{
				document.all[id].bgColor = color;
				src.style.cursor="hand";
				}

				function cambiaColor3(color) {
				if (linea_old!='z') {
				document.all[linea_old].bgColor = color;
				document.all[base_linea_old].bgColor = '#C0C0C0';
				}
				}



				function cambiaColor2(id, t, src, color1, color2) {

				if (id==linea) {
				document.all[id].bgColor = color2;
				//document.all[t].bgColor =  '#C0C0C0';
				}
				else {
				document.all[id].bgColor = color1;
				//document.all[t].bgColor =   '#C0C0C0';
				}

				src.style.cursor="hand";
				}

