﻿function GetXML()
{
	var http_request = false;
	var cfhttp_request = false;
	var rhttp_request = false;
	var lhttp_request = false;
	var loghttp_request = false;
	var posthttp_request = false;
	var unhttp_request = false;
	var chcathttp_request = false;
	var lhcathttp_request = false;
	var reshttp_request = false;
  this.lfload = lfload;
  this.lfhload = lfhload;
  this.lfamt = lfamt;
  this.lfhamt = lfhamt;
  this.lfdmt = lfdmt;
  this.lfhdmt = lfhdmt;
  this.lfdct = lfdct;
  this.lfhdct = lfhdct;
  this.lfchcat = lfchcat;
  this.lfhchcat = lfhchcat;
  this.lfsetop = lfsetop;
  this.lfhsetop = lfhsetop;
  this.cfload = cfload;
  this.cfhload = cfhload;
  this.oddload = oddload;
  this.oddhload = oddhload;
  this.cfreload = cfreload;
  this.cfhreload = cfhreload;
  this.cfchcat = cfchcat;
  this.cfhchcat = cfhchcat;
  this.rfload = rfload;     //ne e nujna napraeno e w indexa
  this.rfhload = rfhload;   //ne e nujna napraeno e w indexa
  this.logload =  logload;
  this.loghload =  loghload;
  this.logpost =  logpost;
  this.loghpost =  loghpost;
  this.logout = logout;
  this.loghout = loghout;
  this.rfunload = rfunload;
  this.rfhunload = rfhunload;
  this.cfshowres = cfshowres;
  this.cfhshowres = cfhshowres;
  this.cfshowodd = cfshowodd;
  this.cfhshowodd = cfhshowodd;
  this.cfshowstand = cfshowstand;
  this.cfshowhstand = cfshowhstand;
  //------------------------------------------------------------
  function lfload(url)
  {
	  http_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     http_request = new XMLHttpRequest();
	     if (http_request.overrideMimeType)
	     {
	        http_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{http_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{http_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!http_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  http_request.onreadystatechange = lfhload;
	  http_request.open('GET', url + "?load&rand="+Math.floor(Math.random()*1000000), true);
	  http_request.send(null);
  }
	function lfhload()
	{
	  	if (http_request.readyState == 4)
		{
	     	if (http_request.status == 200)
			{
				var xmldoc = http_request.responseXML;//responseXML;//responseText
           //alert("LOAD:"+xmldoc);
           //return false;
				var root = xmldoc.getElementsByTagName('root').item(0);
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName != '#text')
        		{
           		//alert("CAT "+node.getAttribute("id"));
           		var cid = node.getAttribute("id");
                 var catopt = node.getAttribute("opt");
        			AddCat(cid,catopt);
                 //selected = 0;
        			SelectCat(cid);
        		}
        		if(lfsel != 1)//Scripwa butona ako ne e selektnata 1tab na LF-a
        		{
           		var lfaddcat = document.getElementById("lfaddcat");
           		lfaddcat.style.display = "";
           		lfaddcat.style.visibility = "hidden";
           		var lfaddcath = document.getElementById("lfaddcath");
           		lfaddcath.style.display = "";
           		lfaddcath.style.visibility = "hidden";
							var lfaddcatv = document.getElementById("lfaddcatv");
           		lfaddcatv.style.display = "";
           		lfaddcatv.style.visibility = "hidden";
           		var lfmat = document.getElementById("t_rf");
           		lfmat.style.display = "none";
        		}
	      		for (var i = 0; i < node.childNodes.length; i++)//cats
	      		{
	      			var sibl = node.childNodes.item(i);
	      			var len = parseInt(sibl.childNodes.length / 2);
           		if(sibl.nodeName != '#text')
           		{
              		var flag,country,liga,dom ,res,gost,rid,mevent,rtime = '';
              		if(sibl.childNodes.item(0).nodeName == '#text') //FI
              		{
                       country = sibl.childNodes.item(1).childNodes.item(0).data;
                       flag = sibl.childNodes.item(1).getAttribute("flag");
	            			liga = sibl.childNodes.item(3).childNodes.item(0).data;
	            			dom = sibl.childNodes.item(5).childNodes.item(0).data;
	            			res = sibl.childNodes.item(7).childNodes.item(0).data;
                       mevent = sibl.childNodes.item(7).getAttribute("events");
	           	 			gost = sibl.childNodes.item(9).childNodes.item(0).data;
	            			rid = sibl.childNodes.item(11).childNodes.item(0).data;
	            			rtime = sibl.childNodes.item(13).childNodes.item(0).data;
              		}
              		else //IE
              		{
                       country = sibl.childNodes.item(0).childNodes.item(0).data;
                       flag = sibl.childNodes.item(0).getAttribute("flag");
                			liga = sibl.childNodes.item(1).childNodes.item(0).data;
								dom = sibl.childNodes.item(2).childNodes.item(0).data;
								res = sibl.childNodes.item(3).childNodes.item(0).data;
								mevent = sibl.childNodes.item(3).getAttribute("events");
								gost = sibl.childNodes.item(4).childNodes.item(0).data;
								rid = sibl.childNodes.item(5).childNodes.item(0).data;
								rtime = sibl.childNodes.item(6).childNodes.item(0).data;
              		}
              		//alert("MAT "+sibl.getAttribute("id")+" L "+liga+" D "+dom+" R "+res+" G "+gost+"  RID"+rid);
              		//alert("RID:"+rid+" LIGA:"+liga+" DOM:"+dom+" RES:"+res," GOST:"+gost);
              		//AddMat(false,'188','liga','dom','resul','gost')
              		//alert("LOAD:"+flag);
        				AddMat(rid,country,flag,liga,dom,res,gost,mevent,rtime);
           		}
					}
				}
	     	}
	     	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
	     	//hload();
		}
	}
  //------------------------------------------------------------
  function lfamt(url, mid)
  {
    //if(username == '')
    //{
    		//CheckAddMat(mid,0);
    //}
    sload();
	  http_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     http_request = new XMLHttpRequest();
	     if (http_request.overrideMimeType)
	     {
	        http_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{http_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{http_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!http_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  http_request.onreadystatechange = lfhamt;
	  http_request.open('GET', url + "?amt="+mid+"&ct="+sel_cat+"&rand="+Math.floor(Math.random()*1000000), true);
	  http_request.send(null);
  }
  function lfhamt()
  {
	  if (http_request.readyState == 4)
		{
	     	if (http_request.status == 200)
			{
        	var xmldoc = http_request.responseXML;//responseText
           //alert(xmldoc);
           //return;

				var root = xmldoc.getElementsByTagName('root').item(0);
 				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              //alert(node.nodeName); continue;
              switch (node.nodeName)
              {
              	case 'mat':
	      				var flag,country,liga,dom ,res,gost,rid = '';
              		if(node.childNodes.item(0).nodeName == '#text') //FI
              		{
                 		country = node.childNodes.item(1).childNodes.item(0).data;
                 		flag = node.childNodes.item(1).getAttribute("flag");
	            			liga = node.childNodes.item(3).childNodes.item(0).data;
	            			dom = node.childNodes.item(5).childNodes.item(0).data;
	            			res = node.childNodes.item(7).childNodes.item(0).data;
	            			mevent = node.childNodes.item(7).getAttribute("events");
	           	 			gost = node.childNodes.item(9).childNodes.item(0).data;
	            			rid = node.childNodes.item(11).childNodes.item(0).data;
	            			rtime = node.childNodes.item(13).childNodes.item(0).data;
              		}
              		else //IE
              		{
                 		country = node.childNodes.item(0).childNodes.item(0).data;
                 		flag = node.childNodes.item(0).getAttribute("flag");
              			liga = node.childNodes.item(1).childNodes.item(0).data;
								dom = node.childNodes.item(2).childNodes.item(0).data;
								res = node.childNodes.item(3).childNodes.item(0).data;
                 		mevent = node.childNodes.item(3).getAttribute("events");
								gost = node.childNodes.item(4).childNodes.item(0).data;
								rid = node.childNodes.item(5).childNodes.item(0).data;
								rtime = node.childNodes.item(6).childNodes.item(0).data;
              		}
              		//alert("ADDMAT"+" RID:"+rid+" LIGA:"+liga+" DOM:"+dom+" RES:"+res," GOST:"+gost);
              		//alert("HMM:"+flag);
        				AddMat(rid,country,flag,liga,dom,res,gost,mevent,rtime);
              	break;
              	case 'estcost':
              		//alert(node.firstChild.nodeValue);estimcost
                    var estimcost = document.getElementById("estimcost");
                    estimcost.innerHTML = node.firstChild.nodeValue;
                 break;
              }
				}
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
	    	hload();
		}
  }
  //------------------------------------------------------------
  function lfdmt(url,cid,mid)
  {
    sload();
	  http_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     http_request = new XMLHttpRequest();
	     if (http_request.overrideMimeType)
	     {
	        http_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{http_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{http_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!http_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  http_request.onreadystatechange = lfhdmt;
	  http_request.open('GET', url + "?dmt="+mid+"&ct="+cid+"&rand="+Math.floor(Math.random()*1000000), true);
	  http_request.send(null);
  }
  function lfhdmt()
  {
	  if (http_request.readyState == 4)
		{
	     	if (http_request.status == 200)
			{
        	var xmldoc = http_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              switch (node.nodeName)
              {
              	case 'dmt':
	      				var cid,mid = '';
              		if(node.childNodes.item(0).nodeName == '#text') //FI
              		{
	            			cid = node.childNodes.item(1).childNodes.item(0).data
	            			mid = node.childNodes.item(3).childNodes.item(0).data
              		}
              		else //IE
              		{
              			cid = node.childNodes.item(0).childNodes.item(0).data
								mid = node.childNodes.item(1).childNodes.item(0).data
              		}
              		//alert("DELMAT"+" CAT:"+cid+" MAT:"+mid);
        				DelMat(cid,mid)
              	break;
              	case 'estcost':
              		//alert(node.firstChild.nodeValue);estimcost
                    var estimcost = document.getElementById("estimcost");
                    estimcost.innerHTML = node.firstChild.nodeValue;
                 break;
              }
				}
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
	    	hload();
		}
  }
  //------------------------------------------------------------
  function lfdct(url, cid)
  {
	  http_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     http_request = new XMLHttpRequest();
	     if (http_request.overrideMimeType)
	     {
	        http_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{http_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{http_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!http_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  http_request.onreadystatechange = lfhdct;
	  http_request.open('GET', url + "?dct="+cid+"&rand="+Math.floor(Math.random()*1000000), true);
	  http_request.send(null);
  }
  function lfhdct()
  {
	  if (http_request.readyState == 4)
		{
	     	if (http_request.status == 200)
			{
        	var xmldoc = http_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
        		switch (node.nodeName)
        		{
              	case 'dct':
	      				var cid = '';
              		if(node.childNodes.item(0).nodeName == '#text') //FI
              		{
	            			cid = node.childNodes.item(1).childNodes.item(0).data
              		}
              		else //IE
              		{
              			cid = node.childNodes.item(0).childNodes.item(0).data
              		}
              		//alert("DELCAT"+" CAT:"+cid);
        				DelCat(cid);
              	break;
              	case 'estcost':
              		//alert(node.firstChild.nodeValue);estimcost
                    var estimcost = document.getElementById("estimcost");
                    estimcost.innerHTML = node.firstChild.nodeValue;
                 break;
        		}
				}
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
	    	hload();
		}
  }
  function lfchcat(url,cat)
  {
	  lhcathttp_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     lhcathttp_request = new XMLHttpRequest();
	     if (lhcathttp_request.overrideMimeType)
	     {
	        lhcathttp_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{lhcathttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{lhcathttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!lhcathttp_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  lhcathttp_request.onreadystatechange = lfhchcat;
	  lhcathttp_request.open('GET', url + "?setlfc&lfc="+cat+"&rand="+Math.floor(Math.random()*1000000), true);
	  lhcathttp_request.send(null);
  }
	function lfhchcat()
  {
	  if (lhcathttp_request.readyState == 4)
		{
	     	if (lhcathttp_request.status == 200)
			{
           //alert("DONE:"+res.innerHTML);
        	var xmldoc = lhcathttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              //alert(node.nodeName);
					var tlfselcat = '';
					if(root.childNodes.item(0).nodeName == '#text')//FI
					{
              	//alert(root.childNodes.item(1).childNodes.item(0));
           		if (root.childNodes.item(1).childNodes.item(0) != null)
           		{
              		tlfselcat = root.childNodes.item(1).childNodes.item(0).data;
           		}
						//alert("FI:"+login);
					}
					else //IE
					{
              	//alert(root.childNodes.item(0).childNodes.item(0));
              	if (root.childNodes.item(0).childNodes.item(0) != null)
              	{
              		tlfselcat = root.childNodes.item(0).childNodes.item(0).data
              	}
						//alert("IE:"+login);
					}
           	//alert("LFSEL DONE:"+tlfselcat);
				}
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
		}
  }
  function lfsetop(url,param)
  {
    sload();
	  http_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     http_request = new XMLHttpRequest();
	     if (http_request.overrideMimeType)
	     {
	        http_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{http_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{http_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!http_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  http_request.onreadystatechange = lfhsetop;
	  http_request.open('GET', url + "?setop&"+param+"&rand="+Math.floor(Math.random()*1000000), true);
	  http_request.send(null);
  }
  function lfhsetop()
  {
	  if (http_request.readyState == 4)
		{
	     	if (http_request.status == 200)
			{
           var xmldoc = http_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
           var error=1;
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
           	var node = root.childNodes.item(iNode);
              if(node.nodeName == '#text'){continue;}
					if(node.firstChild !== 'undefined' && node.firstChild !== null)
              {
                 if(node.nodeName == 'error')
                 {
                 	error = node.firstChild.nodeValue;
                 }
                 else if(node.nodeName == 'estcost')
                 {
                 	var estimcost = document.getElementById("estimcost");
                    estimcost.innerHTML = node.firstChild.nodeValue;
                 }
                 else if(node.nodeName == 'status')// && node.firstChild.nodeValue != ''
                 {
                    var cat = node.getAttribute("cat");
                    //alert("CAT"+cat+" SET DONE!");
                 	//if(error == 1)
                 	//{
                    	//alert("ERR");
                 	//}
                    //else
                    //{
  							//alert("OK");
                    //}
                 }
           	}
				}
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
	    	hload();
		}
  }
  //------------------------------------------------------------
  function cfload(url,date,sport,country,liga,oddtype)
  {
     //alert("DATE:"+date+" SPORT:"+sport+" COUNTRY:"+country+" LIGA:"+liga);
     sload();
		cfhttp_request = false;
	  	if (window.XMLHttpRequest) //Mozilla
	  	{
	     	cfhttp_request = new XMLHttpRequest();
	     	if (cfhttp_request.overrideMimeType)
	     	{
	        	cfhttp_request.overrideMimeType('text/xml');
	     	}
	  	}
	  	else if (window.ActiveXObject)// IE
	  	{
	     	try{cfhttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     	catch (e){try{cfhttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  	}
	  	if (!cfhttp_request)
	  	{
	     	ErrWin(1,'Cannot create XMLHTTP instance');
	     	return false;
	  	}
	 	cfhttp_request.onreadystatechange = cfhload;
		cfhttp_request.open('GET', url + "?load&oddtype="+oddtype+"&date="+date+"&sport="+sport+"&country="+country+"&liga="+liga+"&rand="+Math.floor(Math.random()*1000000), true);
	  	cfhttp_request.send(null);
  }
  function cfhload()
  {
	  if (cfhttp_request.readyState == 4)
		{
	     	if (cfhttp_request.status == 200)
			{
           //alert("sdfdsfsdfds");
           var cftabres =  document.getElementById("tabres");
           var cfmat =  document.getElementById("cfmat");
				//cfmat.parentNode.removeChild(cfmat);
				cftabres.removeChild(cfmat);
          	cfmat = document.createElement("span");
           cfmat.setAttribute("id","cfmat");

           var cfodd = document.getElementById("cfodd");
           var cfodd1 = document.getElementById("cfodd1");
           cfodd.removeChild(cfodd1);
           cfodd1 = document.createElement("span");
           cfodd1.setAttribute("id","cfodd1");

           //Scriwa ma4owete ako pri zarejdane na paga ne e selektnata Score Board
           if(cfsel != 1 || lfsel == 2){cfmat.style.display = "none";}
          	//cfmat.style.display = "block";
 		   	//cfmat.setAttribute("width","300px");
		   	//cfmat.setAttribute("height","300px");

        	var xmldoc = cfhttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
				//alert(cfhttp_request.responseText);
				var flhasmat=0;var flhasodd=0;
				//alert(xmldoc.getElementsByTagName('root').item(0).data);
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              //alert(node.getAttribute("id"));
 					for(var n1=0;n1<node.childNodes.length;n1++)
 					{
              	var node1 = node.childNodes.item(n1);
                 //if(node1.nodeName == '#text'){continue;}
                 //alert(node1.getAttribute("id"));
                 if(node1.nodeName == 'country')
                 {
                    flhasmat=1;
                 	//alert(node1.nodeName+":"+node1.getAttribute("id")+":"+node1.getAttribute("flag"));
                   	for(var n2=0;n2<node1.childNodes.length;n2++)
                   	{
                 		var node2 = node1.childNodes.item(n2);
                 		//if(node2.nodeName == '#text'){continue;}
                  		if(node2.nodeName == 'liga')
                    	{
                          var floddliga = 0;
                    		var otable = null;
                        	//alert(node2.nodeName+":"+node2.getAttribute("id"));
              				var countrytable = document.createElement("table");
                    		var countrytablebody = document.createElement("tbody");
              				countrytable.setAttribute("id",node2.getAttribute("id"));
              				var lid = node2.getAttribute("lid");
              				countrytable.setAttribute("cellSpacing","0");
									countrytable.setAttribute("cellPadding","0");
              				countrytable.style.width = "500px";
              				countrytable.style.border = "0px";
              				countrytable.style.backgroundColor = "#FFFFFF";
              				countrytable.style.marginTop = "7px";
              				countrytable.style.border = "1px solid #B11015";

                       	//Additional add button messaage
									if(username == ''){
										var messageRow = document.createElement("tr");
                             var messageData = document.createElement("td");
                          	messageData.colSpan="5";
                          	messageData.style.width = "498px";
                          	messageData.style.height = "8px";
                             messageData.align = "center";
                          	messageData.style.paddingBottom = "0px";
                          	messageData.innerHTML = '<b><font face="verdana" color="#000000" size="1">Κάντε click στο κουμπί <img src="http://img2.live2sms.gr/add.gif" style="vertical-align:middle;" border="0"> για να λάβετε ζωντανές ειδοποιήσεις SMS για το παιχνίδι</font></b>';
                             messageRow.appendChild(messageData);
                             countrytablebody.appendChild(messageRow);
									}
                       	//

              				var countrytablerow = document.createElement("tr");


                          //if(node1.getAttribute("lid"))// == 'undefined'
                          //{}
                          //else
                          //{
              					//var countrytabledata1 = document.createElement("td");
              					//countrytabledata1.style.width = "460px";
              					//countrytabledata1.style.height = "19px";
										//countrytabledata1.setAttribute("colSpan","4");
										//countrytabledata1.colSpan="4";
              					//countrytabledata1.style.backgroundColor = "#D2E0F0";
              					//countrytabledata1.className = "result";
              					//countrytabledata1.innerHTML = "<span style=\"padding-left:2px\"><b>"+node1.getAttribute("id")+" - "+node2.getAttribute("id")+"</b></span>";
                          //}
                          var countrytabledata1 = document.createElement("td");
                          countrytabledata1.colSpan="5";
                          countrytabledata1.style.width = "498px";
                          countrytabledata1.style.backgroundColor = "#B11015";
                          var standt = document.createElement("table");
                          standt.style.width = "498px";
                          var standtb = document.createElement("tbody");
                          standt.setAttribute("cellPadding","0");
                          standt.setAttribute("cellSpacing","0");
                          standt.style.border = "0px";
                          var standtr = document.createElement("tr");
                          var standtd = document.createElement("td");
                          standtd.className = "result";
                          standtd.colSpan="4";
                          standtd.style.width = "388px";
                          standtd.style.height = "19px";
                          standtd.style.backgroundColor = "#B11015";
                          //standtd.innerHTML = "<span style=\"padding-left:2px\"><b>"+node1.getAttribute("id")+" - "+node2.getAttribute("id")+"</b></span>";
                          //alert(typeof node2.getAttribute("id1")+":"+node2.getAttribute("id1"));
                          if(typeof node2.getAttribute("id1") === 'string' && node2.getAttribute("id1") !== null){
                          //if(typeof node2.getAttribute("id1") === 'object'){
                          	standtd.innerHTML = "<span style=\"padding-left:2px\"><a class=\"resultlink\" target=\"_blank\" href=\"/?country="+URLEncodeUTF8(node1.getAttribute("id"))+"&league="+URLEncodeUTF8(node2.getAttribute("id1"))+"\"><b>"+node1.getAttribute("id")+" - "+node2.getAttribute("id")+"</b></a></span>";
                          }else{
                          	standtd.innerHTML = "<span style=\"padding-left:2px\"><b>"+node1.getAttribute("id")+" - "+node2.getAttribute("id")+"</b></span>";
                          }
                          standtr.appendChild(standtd);
                          standtd = document.createElement("td");
                          standtd.align = "right";
                          standtd.style.width = "70px";
                          standtd.style.height = "19px";
                          standtd.style.backgroundColor = "#B11015";
                          //alert(node1.getAttribute("lid"));
                          if(lid){standtd.innerHTML = "<img id=\"lid_"+lid+"\" onclick=\"showstand(\'"+lid+"\',event);return false;\" style=\"cursor: pointer;\" src=\"http://img.live2sms.gr/standings1-red.gif\" title=\"Updated in Real Time\" style=\"margin: 0px 5px 0px 0px;\"/>";}
                          standtr.appendChild(standtd);

                          standtd = document.createElement("td");
                          standtd.align = "center";
                          standtd.setAttribute("align","center");
                          standtd.style.width = "40px";
                          standtd.style.backgroundColor = "#B11015";
                          standtd.innerHTML = "<img src=\"http://img1.live2sms.gr/flags/"+node1.getAttribute("flag")+"\" width=\"22\" height=\"14\">";
                          standtr.appendChild(standtd);

                          standtb.appendChild(standtr);
                          standt.appendChild(standtb);
                          countrytabledata1.appendChild(standt);
                          /////////////////////////
              				//var countrytabledata2 = document.createElement("td");
              				//countrytabledata2.align = "center";
									//countrytabledata2.setAttribute("align","center");
              				//countrytabledata2.style.width = "40px";
              				//countrytabledata2.style.backgroundColor = "#D2E0F0";
              				//countrytabledata2.innerHTML = "<img src=\"http://img1.live2sms.gr/flags/"+node1.getAttribute("flag")+"\" width=\"22\" height=\"14\">";


              				countrytablerow.appendChild(countrytabledata1);
              				//countrytablerow.appendChild(countrytabledata2);
                    		countrytablebody.appendChild(countrytablerow);
              				countrytable.appendChild(countrytablebody);
                       	for(var n3=0;n3<node2.childNodes.length;n3++)
                       	{
                          	var node3 = node2.childNodes.item(n3);
                 				//if(node3.nodeName == '#text'){continue;}
                           	if(node3.nodeName == 'date')
                            	{
                                var flodddate = 0;
                                var ocnt = 0;
                                var otr1 = null;
                            		//alert(node3.nodeName+":"+node3.getAttribute("id"));
                                var countrytablerow = document.createElement("tr");
              						var countrytabledata1 = document.createElement("td");
              						countrytabledata1.style.width = "291px";
              						//countrytabledata1.style.height = "19px";
											countrytabledata1.setAttribute("colSpan","3");
											countrytabledata1.colSpan="3";
              						countrytabledata1.style.backgroundColor = "#D1D3D4";
              						countrytabledata1.className = "result";
              						countrytabledata1.style.fontSize = '11px';
              						countrytabledata1.style.textAlign = 'right';
              						countrytabledata1.innerHTML = "<b>"+node3.getAttribute("id")+"</b>";
              						//countrytabledata1.innerHTML = "<span style=\"padding-left:2px\"><b>"+node1.getAttribute("id")+" - "+node2.getAttribute("id")+"</b></span>";

              						var countrytabledata2 = document.createElement("td");
              						countrytabledata2.align = "center";
											countrytabledata2.setAttribute("align","right");
              						countrytabledata2.style.width = "207px";
											countrytabledata2.setAttribute("colSpan","2");
											countrytabledata2.colSpan="2";
              						countrytabledata2.style.backgroundColor = "#D1D3D4";
                                countrytabledata2.className = "result";


              						countrytablerow.appendChild(countrytabledata1);
              						countrytablerow.appendChild(countrytabledata2);
                    				countrytablebody.appendChild(countrytablerow);
              						countrytable.appendChild(countrytablebody);
                                var tcnt = 0;
                              	for(var n4=0;n4<node3.childNodes.length;n4++)
                               	{
                              		var node4 = node3.childNodes.item(n4);
                                	if(node4.nodeName == '#text'){continue;}
                                 	//alert(node4.nodeName+":"+node4.getAttribute("id"));
	      									var mid = node4.getAttribute("id");
	      									var h2h = node4.getAttribute("h2h");
	      									var mdate,mdom,mres,mgost,mevent = '';
              							//if(node4.childNodes.item(0).nodeName == '#text') //FI
              							//{
	            							//	mdom =  node4.childNodes.item(1).childNodes.item(0).data;
	            							//	mres =  node4.childNodes.item(3).childNodes.item(0).data;
                          			//	mevent = node4.childNodes.item(3).getAttribute("events");
	            							//	mgost = node4.childNodes.item(5).childNodes.item(0).data;
	            							//	mdate = node4.childNodes.item(9).childNodes.item(0).data;
              							//}
              							//else //IE
              							//{
              							//	mdom = node4.childNodes.item(0).childNodes.item(0).data;
												//	mres = node4.childNodes.item(1).childNodes.item(0).data;
                          			//	mevent = node4.childNodes.item(1).getAttribute("events");
												//	mgost = node4.childNodes.item(2).childNodes.item(0).data;
												//	mdate = node4.childNodes.item(4).childNodes.item(0).data;
              							//}
                       				//alert("DATE:"+mdate+" DOM:"+mdom+" RES:"+mres+" GOST:"+mgost);
                                   for(var n5=0;n5<node4.childNodes.length;n5++)
                                   {
                                   	var node5 = node4.childNodes.item(n5);
                                		if(node5.nodeName == '#text'){continue;}
                                		//if(node5.nodeName == 'odd'){alert("ODD");}
                                      switch(node5.nodeName)
                                      {
                                      	case 'dom':
                                         	mdom =  node5.firstChild.nodeValue;
                                      	break;
                                      	case 'res':
                                         	mres =  node5.firstChild.nodeValue;
                                         	mevent = node5.getAttribute("events");
                                      	break;
                                      	case 'gost':
                                            mgost =  node5.firstChild.nodeValue;
                                      	break;
                                      	case 'finish':
                                      		mdate =  node5.firstChild.nodeValue;
                                      	break;
                                      	case 'odd':
                                            var type = node5.getAttribute("type");
                                            ocnt++;
                                            //alert(ocnt);
                                            flhasodd=1;
                                      		if(!floddliga)
                                      		{
                                            	floddliga =1;
                                            	otable = document.createElement("table");
                                            	otableb = document.createElement("tbody");
                                               //otable.id=node1.getAttribute("id")+" - "+node2.getAttribute("id");
																otable.setAttribute("cellPadding","0");
																otable.setAttribute("cellSpacing","0");
																otable.style.width = "500px";
																//otable.width = "500px";
																otable.style.backgroundColor = "#FFFFFF";
																otable.style.marginTop = "7px";
																//border: 1px solid #D2E0F0;" border="0"
																otable.style.border = "1px solid #B11015";
																otable.border = "0";
																var otr = document.createElement("tr");

                                               //////////////////////
																//var otd = document.createElement("td");
																//otd.className = "result";
																//otd.colSpan = "4";
																//otd.style.height = "19px";
																//otd.style.backgroundColor = "#D2E0F0";
																//otd.style.textAlign = "left";
																//otd.innerHTML = '<span style="padding-left: 2px;"><b>'+node1.getAttribute("id")+' - '+node2.getAttribute("id")+'</b></span>';
																//otr.appendChild(otd);
																//otd = document.createElement("td");
																//otd.style.backgroundColor = "#D2E0F0";
																//otd.style.paddingRight = "5px";
																//otd.align="right";
																//otd.innerHTML = '<img src="http://img1.live2sms.gr/flags/'+node1.getAttribute("flag")+'" height="14" width="22"/>';
                                               //////////////////////
                                               var otd = document.createElement("td");
                                               otd.className = "result";
                                               otd.colSpan = "4";
                                               otd.style.height = "19px";
                                               otd.style.backgroundColor = "#B11015";
                                               otd.style.textAlign = "left";
                                               otd.innerHTML = '<span style="padding-left: 2px;"><b>'+node1.getAttribute("id")+' - '+node2.getAttribute("id")+'</b></span>';
																otr.appendChild(otd);

                                               otd = document.createElement("td");
                                               otd.style.backgroundColor = "#B11015";
                                               otd.align="right";
                                               otd.style.paddingRight = "5px";

                                     					var ostandt = document.createElement("table");
                          								var ostandtb = document.createElement("tbody");
                          								ostandt.setAttribute("cellPadding","0");
                          								ostandt.setAttribute("cellSpacing","0");
                          								ostandt.style.border = "0px";
                          								var ostandtr = document.createElement("tr");
																	var ostandtd = document.createElement("td");
                          								ostandtd.align = "center";
                          								if(lid){ostandtd.innerHTML = "<img id=\"lid_"+lid+"\" onclick=\"showstand(\'"+lid+"\',event);return false;\" style=\"cursor: pointer;\" src=\"http://img.live2sms.gr/standings1-red.gif\" title=\"Updated in Real Time\" style=\"margin: 0px 5px 0px 0px;\"/>";}
                          								ostandtr.appendChild(ostandtd);
												  					ostandtd = document.createElement("td");
                          								ostandtd.innerHTML = "<img width=\"13\" height=\"14\" src=\"http://img4.live2sms.gr/spacer.gif\" />";
                          								ostandtr.appendChild(ostandtd);
                          								ostandtd = document.createElement("td");
                          								ostandtd.align = "right";
                          								ostandtd.innerHTML = '<img src="http://img1.live2sms.gr/flags/'+node1.getAttribute("flag")+'" height="14" width="22"/>';
                          								ostandtr.appendChild(ostandtd);
																	ostandtb.appendChild(ostandtr);
																	ostandt.appendChild(ostandtb);
																otd.appendChild(ostandt);
                                               //////////////////////
																otr.appendChild(otd);
																//otable.appendChild(otr);
																otableb.appendChild(otr);
																if(!flodddate)
																{
																	otr1 = document.createElement("tr");
																	var otd1 = document.createElement("td");
																	otd1.style.backgroundColor = "#D1D3D4";
																	otd1.style.height = "19px";
																	otd1.style.width = "70px";
																	otd1.innerHTML = '<img src="http://img4.live2sms.gr/spacer.gif" height="19" width="70"/>';
																	otr1.appendChild(otd1);
																	otd1 = document.createElement("td");
																	otd1.style.width = "280px";
																	otd1.className = "result";
																	otd1.colSpan = "3";
																	otd1.style.backgroundColor = "#D1D3D4";
																	otd1.style.fontSize = "11px";
																	otd1.style.textAlign = "center";
																	otd1.innerHTML = '<b>'+node3.getAttribute("id")+'</b>';
																	otr1.appendChild(otd1);
																	otd1 = document.createElement("td");
																	otd1.className = "result";
																	otd1.style.backgroundColor = "#D1D3D4";
																	otd1.style.textAlign = "center";
																	otd1.style.width = "150px";
																	switch(type)
																	{
																		case "1":
																			var otable1 = document.createElement("table");
                                                        var otableb1 = document.createElement("tbody");
																			otable1.setAttribute("cellPadding","0");
																			otable1.setAttribute("cellSpacing","0");
																			otable1.border="0";
     																	otable1.width = "150px";
     																	var otr2 = document.createElement("tr");
     																	var otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>1</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>X</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>2</b>';
     																	otr2.appendChild(otd2)
     																	//otable1.appendChild(otr2);
                                                        otableb1.appendChild(otr2);
                                                        otable1.appendChild(otableb1);
     																	otd1.appendChild(otable1);
																		break;
																		case "2":
																			var otable1 = document.createElement("table");
                                                        var otableb1 = document.createElement("tbody");
																			otable1.setAttribute("cellPadding","0");
																			otable1.setAttribute("cellSpacing","0");
																			otable1.border="0";
     																	otable1.width = "150px";
     																	var otr2 = document.createElement("tr");
     																	var otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>AH</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>Home</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>Away</b>';
     																	otr2.appendChild(otd2)
     																	//otable1.appendChild(otr2);
                                                        otableb1.appendChild(otr2);
                                                        otable1.appendChild(otableb1);
     																	otd1.appendChild(otable1);
																		break;
																		case "3":
																			var otable1 = document.createElement("table");
                                                        var otableb1 = document.createElement("tbody");
																			otable1.setAttribute("cellPadding","0");
																			otable1.setAttribute("cellSpacing","0");
																			otable1.border="0";
     																	otable1.width = "150px";
     																	var otr2 = document.createElement("tr");
     																	var otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>Over</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>Under</b>';
     																	otr2.appendChild(otd2)
     																	//otable1.appendChild(otr2);
                                                        otableb1.appendChild(otr2);
                                                        otable1.appendChild(otableb1);
     																	otd1.appendChild(otable1);
																		break;
																	}
																	otr1.appendChild(otd1);
																	//otable.appendChild(otr1);
                                                  otableb.appendChild(otr1);
																}
                                      		}
                                            var odd1 = '';var odd2 = '';var odd3 = '';
              										if(node5.childNodes.item(0).nodeName == '#text') //FI
              										{
	            											//odd1 =  node5.childNodes.item(1).childNodes.item(0).data;
	            											if(node5.childNodes.item(1).hasChildNodes() && typeof node5.childNodes.item(1).childNodes.item(0)==='object'){odd1 =  node5.childNodes.item(1).childNodes.item(0).data;}
	            											odd2 =  node5.childNodes.item(5).childNodes.item(0).data;
	            											odd3 = node5.childNodes.item(9).childNodes.item(0).data;
              										}
              										else //IE
              										{
              											//odd1 = node5.childNodes.item(0).childNodes.item(0).data;
              											if(node5.childNodes.item(0).hasChildNodes() && typeof node5.childNodes.item(0).childNodes.item(0)==='object'){odd1 = node5.childNodes.item(0).childNodes.item(0).data;}
																odd2 = node5.childNodes.item(2).childNodes.item(0).data;
																odd3 = node5.childNodes.item(4).childNodes.item(0).data;
              										}
              										//alert(odd1+":"+odd2+":"+odd3);
															var otr = document.createElement("tr");
															otr.id="odd_"+mid;
															otr.title="Click to compare odds";
															//otr.className="resultd";
                                            //alert(ocnt);
                                            //alert(ocnt+":"+cl);
															otr.className = (ocnt%2)?'resultd':'resultl';
															//otr.setAttribute("onmouseover","this.className='resulthover';");
															//otr.setAttribute("onmouseout","this.className='resultd';");
															//otr.setAttribute("onclick","alert('Not implemented');return false;");
															otr.onmouseover=function(){this.className='resulthover';return false;};
                                            //alert("0:"+mid);
															//otr.onclick=function(event){showodd(mid,event,oddtype);return false;};//alert('Not implemented');
															//otr["onclick"]=new Function("showodd("+mid+",event,oddtype)");
															//otr.onclick=new Function("showodd("+mid+",event,oddtype)");
                                            if(otr.attachEvent){otr.attachEvent('onclick',new Function("showodd("+mid+",event,oddtype)"));}
															else{otr.setAttribute('onclick', "showodd("+mid+",event,oddtype)");}
                                            //var fcnt = showodd(mid,event,oddtype);
															//otr.onclick=fcnt;//alert('Not implemented');
                                            if(ocnt%2)
                                            {
                                            	otr.onmouseout=function(){this.className='resultd';return false;};
                                            }
                                            else
                                            {
                                            	otr.onmouseout=function(){this.className='resultl';return false;};
                                            }
															var otd = document.createElement("td");
															otd.id="odat_"+mid;
															//otd.title=mdate;
															otd.style.height="19px";
															otd.style.width="70px";
															otd.style.align="left";
															otd.innerHTML=FixLTime(mdate,timezone+DST*60-(60+DST*60),mytime);//mdate;
															otr.appendChild(otd);
															otd = document.createElement("td");
															otd.style.height="19px";
															otd.style.width="135px";
															otd.align="right";
															otd.innerHTML=mdom;
															otr.appendChild(otd);
															otd = document.createElement("td");
															otd.style.height="19px";
															otd.style.width="10px";
															otd.align="center";
															otd.innerHTML="-";
															otr.appendChild(otd);
															otd = document.createElement("td");
															otd.style.height="19px";
															otd.style.width="135px";
															otd.style.textAlign="left";
															otd.innerHTML=mgost;
															otr.appendChild(otd);
															otd = document.createElement("td");
															otd.style.height="19px";
															otd.style.width="150px";
															otd.align="right";
															var otable1 = document.createElement("table");
                                            var otableb1 = document.createElement("tbody");
															otable1.setAttribute("cellPadding","0");
															otable1.setAttribute("cellSpacing","0");
															otable1.border = "0";
															otable1.style.width = "150px";
															otr1 = document.createElement("tr");
															otd1 = document.createElement("td");
															otd1.className="betting-cell";
                                            otd1.title=odd1;
															otd1.innerHTML=FtoFr(odd1);
															otr1.appendChild(otd1);
															otd1 = document.createElement("td");
															otd1.className="betting-cell";
                                            otd1.title=odd2;
															otd1.innerHTML=FtoFr(odd2);
															otr1.appendChild(otd1);
															otd1 = document.createElement("td");
															otd1.className="betting-cell";
                                            otd1.title=odd3;
															otd1.innerHTML=FtoFr(odd3);
															otr1.appendChild(otd1);
                                            otableb1.appendChild(otr1);
															otable1.appendChild(otableb1);
															otd.appendChild(otable1);
															otr.appendChild(otd);
															//otable.appendChild(otr);
                                            otableb.appendChild(otr);
                                      	break;
                                      }
                                   }
                 						//-----------------------------------------
                                   tcnt++;
                 						var matrow = document.createElement("tr");
                 						matrow.id = "mat_"+mid;
                       				var matdata1 = document.createElement("td");
                       				matdata1.align = "left";
					   						matdata1.setAttribute("align","left");
                       				matdata1.style.height = "19px";
                       				matdata1.style.width = "65px";
                       				//matdata1.className = "result";
                                   matdata1.className = (tcnt%2)?'resultd':'resultl';
                       				//matdata1.style.backgroundColor = "#FFFFFF";
												matdata1.id = "dat_"+mid;
                   						//matdata1.title = mdate;
                       				//alert("MDATE:"+mdate+" ZONE:"+timezone+" MYTIME:"+mytime.value);
                   						matdata1.innerHTML = FixLTime(mdate,timezone+DST*60-(60+DST*60),mytime)

                       				var matdata2 = document.createElement("td");
                   	 					matdata2.align = "right";
					   						matdata2.setAttribute("align","right");
                       				matdata2.style.height = "19px";
                       				matdata2.style.width = "163px";
                       				//matdata2.className = "result";
                       				matdata2.className = (tcnt%2)?'resultd':'resultl';
                       				//matdata2.style.backgroundColor = "#FFFFFF";
                       				matdata2.innerHTML = mdom;
                       				var matdata3 = document.createElement("td");
              	 						matdata3.align = "center";
					   						matdata3.setAttribute("align","center");
                       				matdata3.style.height = "19px";
                       				matdata3.style.width = "50px";
                       				//matdata3.className = "result";
                       				matdata3.className = (tcnt%2)?'resultd':'resultl';
                       				//matdata3.style.backgroundColor = "#FFFFFF";
                       				matdata3.id = "res_"+mid;
                       				if(mevent == 0) //mres.match(/\?\s*-\s*\?/)
												{
													matdata3.innerHTML = mres;
												}
												else
												{
													//matdata3.innerHTML = "<a href=\"javascript:showres("+node3.getAttribute("id")+")\">" + mres + "</a>";
                          				matdata3.innerHTML = "<font id=\"wres_"+mid+"\" color=\"#0000FF\" onmouseout=\"this.style.textDecoration=''\" onmouseover=\"this.style.cursor='pointer';this.style.textDecoration='underline'\" onClick=\"showres("+mid+",event"+")\">" + mres + "</font>";
												}
                       				var matdata4 = document.createElement("td");
              	 						matdata4.align = "left";
					   						matdata4.setAttribute("align","left");
                       				matdata4.style.height = "19px";
                       				matdata4.style.width = "163px";
                       				//matdata4.className = "result";
                       				matdata4.className = (tcnt%2)?'resultd':'resultl';
                       				//matdata4.style.backgroundColor = "#FFFFFF";
                       				matdata4.innerHTML = mgost;
                       				var matdata5 = document.createElement("td");
              	 						matdata5.align = "right";
					   						matdata5.setAttribute("align","right");
                       				matdata5.style.height = "19px";
                       				matdata5.style.width = "57px";
                       				matdata5.style.valign = "middle";
                       				//matdata5.className = "result";
                       				matdata5.className = (tcnt%2)?'resultd':'resultl';
                       				//matdata5.style.backgroundColor = "#FFFFFF";
                       				//matdata5.innerHTML = "<img onmouseover=\"this.style.cursor='pointer'\" onclick=\"CheckAddMat('"+mid+"',1,event);return false;\" src=\"http://img2.live2sms.gr/add.gif\" width=\"32\" height=\"17\" border=\"0\">";
                                   if(h2h == 1)
                                   {
                                   	matdata5.innerHTML = "<img src=\"http://img3.live2sms.gr/f.gif\" width=\"17\" height=\"17\" border=\"0\" onmouseover=\"this.style.cursor='pointer'\" alt=\"Τελευταίοι αγώνες και Φόρμα\" title=\"Τελευταίοι αγώνες και Φόρμα\" onClick=\"window.open('http://www.live2sms.gr/h2h.php?mid="+mid+"','_blank','width=530,height=600,scrollbars=yes,left=100,top=100,screenX=0,screenY=100')\"><img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"3\" height=\"17\" border=\"0\"><img onmouseover=\"this.style.cursor='pointer'\" onclick=\"CheckAddMat('"+mid+"',1,event);return false;\" src=\"http://img2.live2sms.gr/add.gif\" width=\"32\" height=\"17\" border=\"0\">";
                                   }
                                   else
                                   {
                                   	matdata5.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"3\" height=\"17\" border=\"0\"><img onmouseover=\"this.style.cursor='pointer'\" onclick=\"CheckAddMat('"+mid+"',1,event);return false;\" src=\"http://img2.live2sms.gr/add.gif\" width=\"32\" height=\"17\" border=\"0\">";
                                   }


                       				matrow.appendChild(matdata1);
                       				matrow.appendChild(matdata2);
                       				matrow.appendChild(matdata3);
                       				matrow.appendChild(matdata4);
                       				matrow.appendChild(matdata5);

                       				countrytablebody.appendChild(matrow);
                       				countrytable.appendChild(countrytablebody);
                              	}
                              	//if(flodddate){otable.appendChild(otr1);}
                           	}
                       	}
                       	countrytable.appendChild(countrytablebody);
                    		cfmat.appendChild(countrytable);
                    		if(floddliga){otable.appendChild(otableb);cfodd1.appendChild(otable);}
                    	}
                 	}
                 }
 					}
				}
           if(flhasmat==0){cfmat.innerHTML='<br><br><br><div style="display:block; text-align: center; width: 380px; background: #F1F5FA;border: thin solid #666666; padding: 10px 10px 10px 10px;font: 12px verdana;color: #555555;">Δεν υπάρχουν στοιχεία για τη συγκεκριμένη ημερομηνία</div>';}
           if(flhasodd==0){cfodd1.innerHTML='<br><br><div style="display:block; text-align: center; width: 380px; background: #F1F5FA;border: thin solid #666666; padding: 10px 10px 10px 10px;font: 12px verdana;color: #555555;">Δεν υπάρχουν στοιχεία για τη συγκεκριμένη ημερομηνία</div>';}
				cftabres.appendChild(cfmat);
				cfodd.appendChild(cfodd1);
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
	    	hload();
		}
  }
  function oddload(url,date,sport,country,liga,oddtype)
  {
     sload();
		cfhttp_request = false;
	  	if (window.XMLHttpRequest) //Mozilla
	  	{
	     	cfhttp_request = new XMLHttpRequest();
	     	if (cfhttp_request.overrideMimeType)
	     	{
	        	cfhttp_request.overrideMimeType('text/xml');
	     	}
	  	}
	  	else if (window.ActiveXObject)// IE
	  	{
	     	try{cfhttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     	catch (e){try{cfhttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  	}
	  	if (!cfhttp_request)
	  	{
	     	ErrWin(1,'Cannot create XMLHTTP instance');
	     	return false;
	  	}
	 	cfhttp_request.onreadystatechange = oddhload;
		cfhttp_request.open('GET', url + "?load&showodds&oddtype="+oddtype+"&date="+date+"&sport="+sport+"&country="+country+"&liga="+liga+"&rand="+Math.floor(Math.random()*1000000), true);
	  	cfhttp_request.send(null);
  }
  function oddhload()
  {
	  if (cfhttp_request.readyState == 4)
		{
	     	if (cfhttp_request.status == 200)
			{
           var cfodd = document.getElementById("cfodd");
           var cfodd1 = document.getElementById("cfodd1");
           cfodd.removeChild(cfodd1);
           cfodd1 = document.createElement("span");
           cfodd1.setAttribute("id","cfodd1");
           if(cfsel != 2 || lfsel == 2){cfodd.style.display = "none";}

        	var xmldoc = cfhttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
           var flhasodd=0;
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
 					for(var n1=0;n1<node.childNodes.length;n1++)
 					{
              	var node1 = node.childNodes.item(n1);
                 //if(node1.nodeName == '#text'){continue;}
                 //alert(node1.getAttribute("id"));
                 if(node1.nodeName == 'country')
                 {
                 	//alert(node1.nodeName+":"+node1.getAttribute("id")+":"+node1.getAttribute("flag"));
                   	for(var n2=0;n2<node1.childNodes.length;n2++)
                   	{
                 		var node2 = node1.childNodes.item(n2);
                 		//if(node2.nodeName == '#text'){continue;}
                  		if(node2.nodeName == 'liga')
                    	{
                          var floddliga = 0;
                    		var otable = null;
                 			var lid=node2.getAttribute("lid");
                 			//alert(lid);
                        	//alert(node2.nodeName+":"+node2.getAttribute("id"));
                       	for(var n3=0;n3<node2.childNodes.length;n3++)
                       	{
                          	var node3 = node2.childNodes.item(n3);
                 				//if(node3.nodeName == '#text'){continue;}
                           	if(node3.nodeName == 'date')
                            	{
                                var flodddate = 0;
                                var ocnt = 0;
                                var otr1 = null;
                            		//alert(node3.nodeName+":"+node3.getAttribute("id"));
                              	for(var n4=0;n4<node3.childNodes.length;n4++)
                               	{
                              		var node4 = node3.childNodes.item(n4);
                                	if(node4.nodeName == '#text'){continue;}
                                 	//alert(node4.nodeName+":"+node4.getAttribute("id"));
	      									var mid = node4.getAttribute("id");
                                   //alert(mid);
	      									var mdate,mdom,mgost,mevent = '';
                                   for(var n5=0;n5<node4.childNodes.length;n5++)
                                   {
                                   	var node5 = node4.childNodes.item(n5);
                                		if(node5.nodeName == '#text'){continue;}
                                		//if(node5.nodeName == 'odd'){alert("ODD");}
                                      switch(node5.nodeName)
                                      {
                                      	case 'dom':
                                         	mdom =  node5.firstChild.nodeValue;
                                      	break;
                                      	case 'gost':
                                            mgost =  node5.firstChild.nodeValue;
                                      	break;
                                      	case 'finish':
                                      		mdate =  node5.firstChild.nodeValue;
                                      	break;
                                      	case 'odd':
                                            flhasodd=1;
                                            var type = node5.getAttribute("type");
                                            ocnt++;
                                            //alert(ocnt);
                                      		if(!floddliga)
                                      		{
                                            	floddliga =1;
                                            	otable = document.createElement("table");
                                            	otableb = document.createElement("tbody");
                                               //otable.id=node1.getAttribute("id")+" - "+node2.getAttribute("id");
																otable.setAttribute("cellPadding","0");
																otable.setAttribute("cellSpacing","0");
																otable.style.width = "500px";
																//otable.width = "500px";
																otable.style.backgroundColor = "#FFFFFF";
																otable.style.marginTop = "7px";
																//border: 1px solid #D2E0F0;" border="0"
																otable.style.border = "1px solid #B11015";
																otable.border = "0";
																var otr = document.createElement("tr");
																var otd = document.createElement("td");
																otd.className = "result";
																otd.colSpan = "4";
																otd.style.height = "19px";
																otd.style.backgroundColor = "#B11015";
																otd.style.textAlign = "left";
																otd.innerHTML = '<span style="padding-left: 2px;"><b>'+node1.getAttribute("id")+' - '+node2.getAttribute("id")+'</b></span>';
																otr.appendChild(otd);
																//otd = document.createElement("td");
																//otd.style.backgroundColor = "#D2E0F0";
																//otd.style.paddingRight = "5px";
																//otd.align="right";
																//otd.innerHTML = '<img src="http://img1.live2sms.gr/flags/'+node1.getAttribute("flag")+'" height="14" width="22"/>';
                                               otd = document.createElement("td");
                                               otd.style.backgroundColor = "#B11015";
                                               otd.align="right";
                                               otd.style.paddingRight = "5px";

                                     					var ostandt = document.createElement("table");
                          								var ostandtb = document.createElement("tbody");
                          								ostandt.setAttribute("cellPadding","0");
                          								ostandt.setAttribute("cellSpacing","0");
                          								ostandt.style.border = "0px";
                          								var ostandtr = document.createElement("tr");
																	var ostandtd = document.createElement("td");
                          								ostandtd.align = "center";
                          								if(lid){ostandtd.innerHTML = "<img id=\"lid_"+lid+"\" onclick=\"showstand(\'"+lid+"\',event);return false;\" style=\"cursor: pointer;\" src=\"http://img.live2sms.gr/standings1-red.gif\" title=\"Updated in Real Time\" style=\"margin: 0px 5px 0px 0px;\"/>";}
                          								ostandtr.appendChild(ostandtd);
												  					ostandtd = document.createElement("td");
                          								ostandtd.innerHTML = "<img width=\"13\" height=\"14\" src=\"http://img4.live2sms.gr/spacer.gif\" />";
                          								ostandtr.appendChild(ostandtd);
                          								ostandtd = document.createElement("td");
                          								ostandtd.align = "right";
                          								ostandtd.innerHTML = '<img src="http://img1.live2sms.gr/flags/'+node1.getAttribute("flag")+'" height="14" width="22"/>';
                          								ostandtr.appendChild(ostandtd);
																	ostandtb.appendChild(ostandtr);
																	ostandt.appendChild(ostandtb);
                                                  otd.appendChild(ostandt);
																otr.appendChild(otd);
																//otable.appendChild(otr);
																otableb.appendChild(otr);
																if(!flodddate)
																{
																	otr1 = document.createElement("tr");
																	var otd1 = document.createElement("td");
																	otd1.style.backgroundColor = "#F1F5FA";
																	otd1.style.height = "19px";
																	otd1.style.width = "70px";
																	otd1.innerHTML = '<img src="http://img4.live2sms.gr/spacer.gif" height="19" width="70"/>';
																	otr1.appendChild(otd1);
																	otd1 = document.createElement("td");
																	otd1.style.width = "280px";
																	otd1.className = "result";
																	otd1.colSpan = "3";
																	otd1.style.backgroundColor = "#F1F5FA";
																	otd1.style.fontSize = "11px";
																	otd1.style.textAlign = "center";
																	otd1.innerHTML = '<b>'+node3.getAttribute("id")+'</b>';
																	otr1.appendChild(otd1);
																	otd1 = document.createElement("td");
																	otd1.className = "result";
																	otd1.style.backgroundColor = "#F1F5FA";
																	otd1.style.textAlign = "center";
																	otd1.style.width = "150px";
																	switch(type)
																	{
																		case "1":
																			var otable1 = document.createElement("table");
                                                        var otableb1 = document.createElement("tbody");
																			otable1.setAttribute("cellPadding","0");
																			otable1.setAttribute("cellSpacing","0");
																			otable1.border="0";
     																	otable1.width = "150px";
     																	var otr2 = document.createElement("tr");
     																	var otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>1</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>X</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>2</b>';
     																	otr2.appendChild(otd2)
     																	//otable1.appendChild(otr2);
                                                        otableb1.appendChild(otr2);
                                                        otable1.appendChild(otableb1);
     																	otd1.appendChild(otable1);
																		break;
																		case "2":
																			var otable1 = document.createElement("table");
                                                        var otableb1 = document.createElement("tbody");
																			otable1.setAttribute("cellPadding","0");
																			otable1.setAttribute("cellSpacing","0");
																			otable1.border="0";
     																	otable1.width = "150px";
     																	var otr2 = document.createElement("tr");
     																	var otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>AH</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>Home</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>Away</b>';
     																	otr2.appendChild(otd2)
     																	//otable1.appendChild(otr2);
                                                        otableb1.appendChild(otr2);
                                                        otable1.appendChild(otableb1);
     																	otd1.appendChild(otable1);
																		break;
																		case "3":
																			var otable1 = document.createElement("table");
                                                        var otableb1 = document.createElement("tbody");
																			otable1.setAttribute("cellPadding","0");
																			otable1.setAttribute("cellSpacing","0");
																			otable1.border="0";
     																	otable1.width = "150px";
     																	var otr2 = document.createElement("tr");
     																	var otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>Over</b>';
     																	otr2.appendChild(otd2)
																			otd2 = document.createElement("td");
     																	otd2.className = "betting-cell";
     																	otd2.innerHTML = '<b>Under</b>';
     																	otr2.appendChild(otd2)
     																	//otable1.appendChild(otr2);
                                                        otableb1.appendChild(otr2);
                                                        otable1.appendChild(otableb1);
     																	otd1.appendChild(otable1);
																		break;
																	}
																	otr1.appendChild(otd1);
																	//otable.appendChild(otr1);
                                                  otableb.appendChild(otr1);
																}
                                      		}
                                            var odd1 = '';var odd2 = '';var odd3 = '';
              										if(node5.childNodes.item(0).nodeName == '#text') //FI
              										{
                                               if(node5.childNodes.item(1).hasChildNodes() && typeof node5.childNodes.item(1).childNodes.item(0)==='object'){odd1 =  node5.childNodes.item(1).childNodes.item(0).data;}
	            											odd2 =  node5.childNodes.item(5).childNodes.item(0).data;
	            											odd3 = node5.childNodes.item(9).childNodes.item(0).data;
              										}
              										else //IE
              										{
              											if(node5.childNodes.item(0).hasChildNodes() && typeof node5.childNodes.item(0).childNodes.item(0)==='object'){odd1 = node5.childNodes.item(0).childNodes.item(0).data;}
																odd2 = node5.childNodes.item(2).childNodes.item(0).data;
																odd3 = node5.childNodes.item(4).childNodes.item(0).data;
              										}
															var otr = document.createElement("tr");
															otr.id="odd_"+mid;
															otr.title="Click to compare odds";
															otr.className = (ocnt%2)?'resultd':'resultl';
															otr.onmouseover=function(){this.className='resulthover';return false;};
                                            //var fcnt = showodd(mid,event,oddtype);
															//otr.onclick=function(event){alert("1:"+mid);showodd(mid,event,oddtype);return false;};
															//otr["onclick"]="showodd("+mid+",event,oddtype)";

                                            //+//otr.onclick = new Function("showodd("+mid+",window.event,oddtype)");//function(e){_self.onClick(e);}
                                            if(otr.attachEvent){otr.attachEvent('onclick',new Function("showodd("+mid+",event,oddtype)"));}
															else{otr.setAttribute('onclick', "showodd("+mid+",event,oddtype)");}
                                            //otr.onclick = function(e){setXY(mid,e,this.parentNode.parentNode)};


															//otr.onclick=new Function("showodd("+mid+",event,oddtype)");
                                            //
															//otr.onclick=fcnt;//alert('Not implemented');
                                            if(ocnt%2)
                                            {
                                            	otr.onmouseout=function(){this.className='resultd';return false;};
                                            }
                                            else
                                            {
                                            	otr.onmouseout=function(){this.className='resultl';return false;};
                                            }
															var otd = document.createElement("td");
															otd.id="odat_"+mid;
                                            //otd.title=mdate;
															otd.style.height="19px";
															otd.style.width="70px";
															otd.style.align="left";
															otd.innerHTML=FixLTime(mdate,timezone+DST*60-(60+DST*60),mytime);//mdate;
															otr.appendChild(otd);
															otd = document.createElement("td");
															otd.style.height="19px";
															otd.style.width="135px";
															otd.align="right";
															otd.innerHTML=mdom;
															otr.appendChild(otd);
															otd = document.createElement("td");
															otd.style.height="19px";
															otd.style.width="10px";
															otd.align="center";
															otd.innerHTML="-";
															otr.appendChild(otd);
															otd = document.createElement("td");
															otd.style.height="19px";
															otd.style.width="135px";
															otd.style.textAlign="left";
															otd.innerHTML= mgost;//'<span height="19" width="135" onclick="showodd(\''+mid+'\',event,oddtype)">'+mgost+'</span>';//;
															otr.appendChild(otd);
															otd = document.createElement("td");
															otd.style.height="19px";
															otd.style.width="150px";
															otd.align="right";
															var otable1 = document.createElement("table");
                                            var otableb1 = document.createElement("tbody");
															otable1.setAttribute("cellPadding","0");
															otable1.setAttribute("cellSpacing","0");
															otable1.border = "0";
															otable1.style.width = "150px";
															otr1 = document.createElement("tr");
															otd1 = document.createElement("td");
															otd1.className="betting-cell";
                                            otd1.title=odd1;
															otd1.innerHTML=FtoFr(odd1);
															otr1.appendChild(otd1);
															otd1 = document.createElement("td");
															otd1.className="betting-cell";
                                            otd1.title=odd2;
															otd1.innerHTML=FtoFr(odd2);
															otr1.appendChild(otd1);
															otd1 = document.createElement("td");
															otd1.className="betting-cell";
                                            otd1.title=odd3;
															otd1.innerHTML=FtoFr(odd3);
															otr1.appendChild(otd1);
                                            otableb1.appendChild(otr1);
															otable1.appendChild(otableb1);
															otd.appendChild(otable1);
															otr.appendChild(otd);
															//otable.appendChild(otr);
                                            otableb.appendChild(otr);
                                      	break;
                                      }
                                   }
                              	}
                              	//if(flodddate){otable.appendChild(otr1);}
                           	}
                       	}
                    		if(floddliga){otable.appendChild(otableb);cfodd1.appendChild(otable);}
                    	}
                 	}
                 }
 					}
				}
				if(flhasodd==0){cfodd1.innerHTML='<br><br><div style="display:block; text-align: center; width: 380px; background: #F1F5FA;border: thin solid #666666; padding: 10px 10px 10px 10px;font: 12px verdana;color: #555555;">Δεν υπάρχουν στοιχεία για τη συγκεκριμένη ημερομηνία</div>';}
				cfodd.appendChild(cfodd1);
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
	    	hload();
		}
  }
  //------------------------------------------------------------
  function cfreload(url)
  {
	  rhttp_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     rhttp_request = new XMLHttpRequest();
	     if (rhttp_request.overrideMimeType)
	     {
	        rhttp_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{rhttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{rhttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!rhttp_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  rhttp_request.onreadystatechange = cfhreload;
    var listc = ReloadCF();
    var listr = ReloadRF();
	  //rhttp_request.open('GET', url + "?reload&idc="+listc+"&idl="+listl+"&rand="+Math.floor(Math.random()*1000000), true);
    //alert("LF:"+listr);
	  rhttp_request.open('GET', url + "?reload&idc="+listc+"&idr="+listr+"&rand="+Math.floor(Math.random()*1000000), true);
	  rhttp_request.send(null);
  }
	function cfhreload()
  {
	  if (rhttp_request.readyState == 4)
		{
	     	if (rhttp_request.status == 200)
			{
  			var DST = isDST();
  			//alert(timezone+":"+DST*60);
           //var res =  document.getElementById("res_10");
           //alert("DONE:"+res.innerHTML);
        	var xmldoc = rhttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              //alert(node.nodeName);
              if(node.nodeName == 'idc')
              {
	              for(var n1=0;n1<node.childNodes.length;n1++)
	              {
	                 var node1 = node.childNodes.item(n1);
	                 if(node1.nodeName == '#text'){continue;}
	                 var mid = node1.getAttribute("id");
	                 var mdate,mres,mevent = '';
	                 if(node1.childNodes.item(0).nodeName == '#text') //FI
	                 {
	                    mdate = node1.childNodes.item(1).childNodes.item(0).data;
	                    mres =  node1.childNodes.item(3).childNodes.item(0).data;
	                    mevent = node1.childNodes.item(3).getAttribute("events");
	                 }
	                 else //IE
	                 {
	                    mdate = node1.childNodes.item(0).childNodes.item(0).data;
	                    mres = node1.childNodes.item(1).childNodes.item(0).data;
	                    mevent = node1.childNodes.item(1).getAttribute("events");
	                 }
                   var res =  document.getElementById("res_"+mid);
                   var time = document.getElementById("dat_"+mid);

                   //alert("res_"+mid + ":"+res.innerHTML);
                   //res.innerHTML = mres;
                   if(mevent == 0) //res.innerHTML.match(/\?\s*-\s*\?/)
						  {
								res.innerHTML = mres;
						  }
						  else
						  {
						  		//res.innerHTML = "<a href=\"javascript:showres("+mid+")\">" + mres + "</a>";
						  		res.innerHTML = "<font id=\"wres_"+mid+"\" color=\"#0000FF\" onmouseout=\"this.style.textDecoration=''\" onmouseover=\"this.style.cursor='pointer';this.style.textDecoration='underline'\" onClick=\"showres("+mid+",event"+")\">" + mres + "</font>";
						  }

                   //time.innerHTML = mdate;
                   //alert("MDATE:"+mdate)
                   time.title = mdate;
                   time.innerHTML = FixLTime(mdate,timezone+DST*60-(60+DST*60),mytime);
	                 //alert("CAT:"+node.nodeName+" MID:"+mid+" RES:"+ mres + " DATE:"+mdate);
	              }
              }
              if(node.nodeName == 'idr')
              {
              	//alert("IDR NOT IMPLEMENTED YET");
	            	for(var n1=0;n1<node.childNodes.length;n1++)
	              	{
	                 	var node1 = node.childNodes.item(n1);
	                 	if(node1.nodeName == '#text'){continue;}
	                 	var mid = node1.getAttribute("id");
	                 	var mdate,mres,mcat,mevent = '';
	                 	if(node1.childNodes.item(0).nodeName == '#text') //FI
	                 	{
                       mcat = node1.childNodes.item(1).childNodes.item(0).data;
	                    	mdate = node1.childNodes.item(3).childNodes.item(0).data;
	                    	mres =  node1.childNodes.item(5).childNodes.item(0).data;
	                    	mevent = node1.childNodes.item(5).getAttribute("events");
	                 	}
	                 	else //IE
	                 	{
                       mcat = node1.childNodes.item(0).childNodes.item(0).data;
	                    	mdate = node1.childNodes.item(1).childNodes.item(0).data;
	                    	mres = node1.childNodes.item(2).childNodes.item(0).data;
	                    	mevent = node1.childNodes.item(2).getAttribute("events");
	                 	}
                   var res =  document.getElementById("rfres_"+mcat+"_"+mid);
                   var rftime = document.getElementById("rftime_"+mcat+"_"+mid);
                   //rftime.innerHTML = "&nbsp;"+mdate.replace(/\s?GMT/,"");
                   rftime.title = mdate;
                   mdate = FixLTime(mdate,timezone+DST*60-(60+DST*60),mytime);
                   rftime.innerHTML = "&nbsp;"+mdate.replace(" GMT","");
                   //res.innerHTML = mres;
                   	if(mevent == 0)  //mres.match(/\?\s*-\s*\?/)
							{
								res.innerHTML = mres;
							}
							else
							{
								//matdata3.innerHTML = "<a href=\"javascript:showres("+node3.getAttribute("id")+")\">" + mres + "</a>";
                    	res.innerHTML = "<font id=\"wres_"+mid+"\" color=\"#0000FF\" onmouseout=\"this.style.textDecoration=''\" onmouseover=\"this.style.cursor='pointer';this.style.textDecoration='underline'\" onClick=\"showres("+mid+",event"+")\">" + mres + "</font>";
							}
	                 //alert("CAT:"+mcat+" MID:"+mid+" RES:"+ mres + " DATE:"+mdate);
	              	}
              }
              if(node.nodeName == 'bal')
              {
                 //alert("BALANCE"+node.firstChild.nodeValue);
                 var bal1 =  document.getElementById("balance1");
                 var bal2 =  document.getElementById("balance2");
                 bal1.innerHTML = node.firstChild.nodeValue+"&nbsp;&#128;";
                 bal2.innerHTML = node.firstChild.nodeValue+"&nbsp;&#128;";
              }
           	//alert("DONE:"+res.innerHTML);
				}
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
		}
  }
  function cfchcat(url,layer,cat)
  {
	  chcathttp_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     chcathttp_request = new XMLHttpRequest();
	     if (chcathttp_request.overrideMimeType)
	     {
	        chcathttp_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{chcathttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{chcathttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!chcathttp_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  chcathttp_request.onreadystatechange = cfhchcat;
    if(layer == 1)
    {
    		chcathttp_request.open('GET', url + "?setcfc&cfc="+cat+"&rand="+Math.floor(Math.random()*1000000), true);
    }
    else
    {
    		chcathttp_request.open('GET', url + "?set1cfc&cfc="+cat+"&rand="+Math.floor(Math.random()*1000000), true);
    }

	  chcathttp_request.send(null);
  }
	function cfhchcat()
  {
	  if (chcathttp_request.readyState == 4)
		{
	     	if (chcathttp_request.status == 200)
			{
           //alert("DONE:"+res.innerHTML);
        	var xmldoc = chcathttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              //alert(node.nodeName);
					var tcfselcat = '';
					if(root.childNodes.item(0).nodeName == '#text')//FI
					{
              	//alert(root.childNodes.item(1).childNodes.item(0));
           		if (root.childNodes.item(1).childNodes.item(0) != null)
           		{
              		tcfselcat = root.childNodes.item(1).childNodes.item(0).data;
           		}
						//alert("FI:"+login);
					}
					else //IE
					{
              	//alert(root.childNodes.item(0).childNodes.item(0));
              	if (root.childNodes.item(0).childNodes.item(0) != null)
              	{
              		tcfselcat = root.childNodes.item(0).childNodes.item(0).data
              	}
						//alert("IE:"+login);
					}
           	//alert("CFSEL DONE:"+tcfselcat);
				}
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
		}
  }
  //------------------------------------------------------------
  function rfunload(url,sport,country)
  {
	  unhttp_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     unhttp_request = new XMLHttpRequest();
	     if (unhttp_request.overrideMimeType)
	     {
	        unhttp_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{unhttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{unhttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!unhttp_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  unhttp_request.onreadystatechange = rfhunload;
	  unhttp_request.open('GET',url + "?unload&sport="+sport+"&country="+country+"&rand="+Math.floor(Math.random()*1000000), true);
	  unhttp_request.send(null);
  }
  function rfhunload()
  {
		if (unhttp_request.readyState == 4)
		{
	     	if (unhttp_request.status == 200)
			{
           alert("UNLOAD DONE!");
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
		}
  }
  //------------------------------------------------------------
  function rfload(url,date,sport)
  {
	  lhttp_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     lhttp_request = new XMLHttpRequest();
	     if (lhttp_request.overrideMimeType)
	     {
	        lhttp_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{lhttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{lhttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!lhttp_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  lhttp_request.onreadystatechange = rfhload;
    //if(sport == '' && date == '')
    //{
    		//lhttp_request.open('GET',url + "?load&rand="+Math.floor(Math.random()*1000000), true);
    //}
    //else if(sport == '' && date != '')
    //{
	  		//lhttp_request.open('GET',url + "?load&date="+date+"&rand="+Math.floor(Math.random()*1000000), true);
	  //}
	  //else if(sport != '' && date == '')
	  //{
     	//lhttp_request.open('GET',url + "?load&sport="+sport+"&rand="+Math.floor(Math.random()*1000000), true)
	  //}
    //else
	  //{
        lhttp_request.open('GET',url + "?load&date="+date+"&sport="+sport+"&rand="+Math.floor(Math.random()*1000000), true);
	  //}
	  lhttp_request.send(null);
  }
  function rfhload()
  {
	  if (lhttp_request.readyState == 4)
		{
	     	if (lhttp_request.status == 200)
			{
				//alert("XMLDONE");
           var rftd =  document.getElementById("rflig");
           var rfctr =  document.getElementById("rfctr");
				rftd.removeChild(rfctr);
          	rfctr = document.createElement("span");
           rfctr.setAttribute("id","rfctr");
           //rfctr.innerHTML = "UUUUUUUU";
        	var xmldoc = lhttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
				//<table cellspacing="0" cellpadding="0" border="0" width="156">

				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
        		//alert("SPORT:"+node.getAttribute("id"));
              var rfsport = node.getAttribute("id");
              var rfdate = node.getAttribute("date");
              var rffdate = node.getAttribute("fdate");
              sport = rfsport;
              date = rfdate;

              //Create Calendar
               //var caldate = document.getElementById("date");
               //caldate.innerHTML = "<FORM name=\"calendar\" style=\"margin:0 0 0 0\"><SCRIPT LANGUAGE=\"JavaScript\" ID=\"js18\">var cal1 = new CalendarPopup(\"testdiv1\");cal1.setCssPrefix(\"TEST\");</SCRIPT><INPUT class=\"imp\" TYPE=\"text\" NAME=\"date1\" VALUE=\""+rffdate+"\" SIZE=\"7,5\"><A onClick=\"cal1.select(document.forms[1].date1,'anchor1','dd NNN yyyy'); return false;\" TITLE=\"cal1.select(document.forms[1].date1,'anchor1x','MM/dd/yyyy'); return false;\" NAME=\"anchor1\" ID=\"anchor1\"><img src=\"http://img3.live2sms.gr/calendar.gif\" width=\"16\" height=\"15\" border=\"0\"></A></FORM>";
               //caldate.value = rffdate;
              //Create dropdown-a sas posrtowete
              //////var sptsel = document.getElementById("sptsel");
              //sptsel.removeChild(rfctr);
              //////switch(sport)
              //////{
              	//////case "baseball":
              	//////sptsel.innerHTML = "<select style=\"width:156px;\" id='dayselect' class='select-left' onmouseover=\"this.style.cursor='pointer'\" onchange=\"ChangeSport(curdate,this.value);\"><option value='soccer'>Football</option><option selected value='baseball'>Baseball</option><option value='hourse'>Hourse</option></select>";
              	//////break;

              	//////case "horse":
              	//////sptsel.innerHTML = "<select style=\"width:156px;\" id='dayselect' class='select-left' onmouseover=\"this.style.cursor='pointer'\" onchange=\"ChangeSport(curdate,this.value);\"><option value='soccer'>Football</option><option value='baseball'>Baseball</option><option selected value='hourse'>Hourse</option></select>";
              	//////break;

              	//////default:sptsel.innerHTML = "<select style=\"width:156px;\" id='dayselect' class='select-left' onmouseover=\"this.style.cursor='pointer'\" onchange=\"ChangeSport(curdate,this.value);\"><option selected value='soccer'>Football</option><option value='baseball'>Baseball</option><option value='hourse'>Hourse</option></select>";
              //////}

              var ligatable = document.createElement("table");
              //<table cellspacing="0" cellpadding="0" border="0" width="156">
			  		ligatable.setAttribute("cellSpacing","0");
			  		ligatable.setAttribute("cellPadding","0");
              ligatable.style.border = "0px";
              ligatable.style.width = "156px";
              ligatable.style.height = "20px";
              var ligatablebody = document.createElement("tbody");
              var cnt = 0;
 					for(var n1=0;n1<node.childNodes.length;n1++)
 					{
              	var node1 = node.childNodes.item(n1);
                 if(node1.nodeName == '#text'){continue;}
                 //alert("COUNTRY:"+node1.getAttribute("id"));// +":"+node1.data
                 var rfcountry = node1.getAttribute("id");
                 //alert(rfcountry);
                 //var country = node1.getAttribute("id");
                 var fold =  node1.getAttribute("fold");
                 var select = node1.getAttribute("select");
                 var ligatablerow = document.createElement("tr");
                 var ligatabledata = document.createElement("td");
                 cnt++;
              	//<td valign="middle" class="contry" id="nh_1"><img id="img_1" src="http://img3.live2sms.gr/plus.gif" alt="[+]" border=0 />&nbsp;<a onclick='processMenu(1);return false;' class="leftdex">Argentina</a></td>
                 ligatabledata.style.valign = "middle";
                 if(select == 1)
                 {
                 	ligatabledata.className = "contry_on";
                 	country = rfcountry;
                 	rfprevselcountry = cnt;
                 }
                 else
                 {
                 	ligatabledata.className = "contry";
                 }

                 ligatabledata.id = "nh_"+cnt;
                 if(fold == 1)
                 {
                 	//ligatabledata.innerHTML = "<img id=\"img_"+cnt+"\" onclick='SlideRF("+cnt+",\""+rfsport+"\",\""+rfcountry+"\");return false;' src=\"http://img.live2sms.gr/minus.gif\" alt=\"[-]\" border=0 />&nbsp;<a onclick='SlideRF("+cnt+",\""+rfsport+"\",\""+rfcountry+"\");return false;' class=\"leftdex\">"+rfcountry+"</a>"
							ligatabledata.innerHTML = "<img id=\"img_"+cnt+"\" onclick='SlideRF1("+cnt+",\""+rfsport+"\",\""+rfcountry+"\");return false;' src=\"http://img.live2sms.gr/minus.gif\" alt=\"[-]\" border=0 />&nbsp;<a onclick='SlideRF("+cnt+",\""+rfsport+"\",\""+rfcountry+"\");return false;' class=\"leftdex\">"+rfcountry+"</a>"
                 }
                 else
                 {
                 	//ligatabledata.innerHTML = "<img id=\"img_"+cnt+"\" onclick='SlideRF("+cnt+",\""+rfsport+"\",\""+rfcountry+"\");return false;' src=\"http://img3.live2sms.gr/plus.gif\" alt=\"[+]\" border=0 />&nbsp;<a onclick='SlideRF("+cnt+",\""+rfsport+"\",\""+rfcountry+"\");return false;' class=\"leftdex\">"+rfcountry+"</a>"
                 	ligatabledata.innerHTML = "<img id=\"img_"+cnt+"\" onclick='SlideRF1("+cnt+",\""+rfsport+"\",\""+rfcountry+"\");return false;' src=\"http://img3.live2sms.gr/plus.gif\" alt=\"[+]\" border=0 />&nbsp;<a onclick='SlideRF("+cnt+",\""+rfsport+"\",\""+rfcountry+"\");return false;' class=\"leftdex\">"+rfcountry+"</a>"
                 }

                 ligatablerow.appendChild(ligatabledata);
                 ligatablebody.appendChild(ligatablerow);


                 var ligatablerow1 = document.createElement("tr");
                 var ligatabledata1 = document.createElement("td");
                	//ligatabledata1.id = "test"+cnt;
                	var ligtab1 = document.createElement("table");


                 //id="an_1" cellpadding=0 cellspacing=0 class='devisionhide'
                 ligtab1.id = "an_"+cnt;
			  	 		ligtab1.setAttribute("cellSpacing","0");
			  	 		ligtab1.setAttribute("cellPadding","0");
              	ligtab1.style.width = "150px";
			  	 		ligtab1.style.height = "17px";
			  	 		if(fold == 1)
			  	 		{
                 	ligtab1.className = "devisionshow";
			  	 		}
			  	 		else
			  	 		{
                 	ligtab1.className = "devisionhide";
                 }
                 var ligtabbody1 = document.createElement("tbody");
                 var cnt1 = 0;
                 for(var n2=0;n2<node1.childNodes.length;n2++)
                 {
                 	var node2 = node1.childNodes.item(n2);
                 	if(node2.nodeName == '#text'){continue;}
                    var select = node2.getAttribute("select");
                    cnt1++;
                    //alert(node2.childNodes.item(0).data);
                    var rliga = node2.childNodes.item(0).data;
              		//alert("SPORT:"+node.getAttribute("id")+" COUNTRY:"+ country + " LIGA:"+rliga);
                    ligatablerow2 = document.createElement("tr");
                    var ligatabledata2 = document.createElement("td");
                    //<a href="#" class="dvnoff"><span style="padding-left:12px">Apertura</span></a>
                    //ligatabledata2.innerHTML = "<span class=\"dvnoff\" style=\"padding-left:12px\" onmouseover=\"this.style.cursor='pointer'\" onclick='alert(\"NOT IMPLEMENTED\");return false;'>"+rliga+"</span>"
							//ligatabledata2.innerHTML = "<span class=\"dvnoff\" style=\"padding-left:2px\" onmouseover=\"this.className='devisionoffhover';this.style.cursor='pointer'\" onmouseout=\"this.className='dvnoff'\" onclick='fixactive();alert(\"NOT IMPLEMENTED\");return false;'>"+rliga+"</span>"
                    if(select == 1)
                    {
                    	ligatabledata2.innerHTML = "<span id=\"rflid_"+cnt+"_"+cnt1+"\" class=\"devisionoffhover\" style=\"padding-left:2px\" onmouseover='MarkElRF(\"rflid_"+cnt+"_"+cnt1+"\");' onmouseout='UnMarkElRF(\"rflid_"+cnt+"_"+cnt1+"\");' onclick='SellectElRF(\""+"rflid_"+cnt+"_"+cnt1+"\",\""+rfsport+"\",\""+rfcountry+"\",\""+rliga+"\");return false;'>"+rliga+"</span>"
                    	rfprevsel = "rflid_"+cnt+"_"+cnt1;
                    	liga = rliga;
                    }
                    else
                    {
                    	ligatabledata2.innerHTML = "<span id=\"rflid_"+cnt+"_"+cnt1+"\" class=\"dvnoff\" style=\"padding-left:2px\" onmouseover='MarkElRF(\"rflid_"+cnt+"_"+cnt1+"\");' onmouseout='UnMarkElRF(\"rflid_"+cnt+"_"+cnt1+"\");' onclick='SellectElRF(\""+"rflid_"+cnt+"_"+cnt1+"\",\""+rfsport+"\",\""+rfcountry+"\",\""+rliga+"\");return false;'>"+rliga+"</span>"
                    }

                    ligatablerow2.appendChild(ligatabledata2);
                    ligtabbody1.appendChild(ligatablerow2);
                 }
                 ligtab1.appendChild(ligtabbody1);
                 ligatabledata1.appendChild(ligtab1);

                 ligatablerow1.appendChild(ligatabledata1);
                 ligatablebody.appendChild(ligatablerow1);

              }
              ligatable.appendChild(ligatablebody);
              rfctr.appendChild(ligatable);
				}
           //alert("DATE:"+curdate+" SPORT:"+sport+" COUNTRY:"+country+" LIGA:"+liga);
           if(country != "" || liga != "")
           {
					var adisplay =  document.getElementById("alldisplay");
					adisplay.innerHTML = "<img src=\"http://img.live2sms.gr/display-all.jpg\" width=\"157\" height=\"18\" border=\"0\" onmouseover=\"this.style.cursor='pointer'\" onclick=\"AllDisplay();sload();CollapseAll();lfob.cfload('http://www.live2sms.gr/xcf/',curdate,sport,'all','',oddtype);\">";
				}

           lfob.cfload('http://www.live2sms.gr/xcf/',curdate,sport,country,liga,oddtype);
           //alert(cfsel);
           //HideCF(cfsel);
           rftd.appendChild(rfctr);
	    	}
	    	//HTTPERRHANDLER//else{ErrWin(1,'There was a problem with the request.');}
		}
  }
  //LOGIN------------------------------------------------------------
  function logload(url)
  {
	  loghttp_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     loghttp_request = new XMLHttpRequest();
	     if (loghttp_request.overrideMimeType)
	     {
	        loghttp_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{loghttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{loghttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!loghttp_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  loghttp_request.onreadystatechange = loghload;
	  loghttp_request.open('GET',url + "?rand="+Math.floor(Math.random()*1000000), true);
	  loghttp_request.send(null);
  }
  function loghload()
  {
	  if (loghttp_request.readyState == 4)
		{
	     	if (loghttp_request.status == 200)
			{
				//alert("XMLDONE");
           var logspan =  document.getElementById("login");
           while(logspan.firstChild){logspan.removeChild(logspan.firstChild);};
           var form = document.createElement("form");
           form.name = "joinform";
           var logtable = document.createElement("table");
			  	logtable.setAttribute("cellSpacing","0");
			  	logtable.setAttribute("cellPadding","0");
           logtable.style.border = "0px";
           logtable.style.width = "172px";

           logtablebody = document.createElement("tbody");

           var xmldoc = loghttp_request.responseXML;
           var root = xmldoc.getElementsByTagName('root').item(0);

	      	var login = '';
				if(root.childNodes.item(0).nodeName == '#text')//FI
				{
              //alert(root.childNodes.item(1).childNodes.item(0));
           	if (root.childNodes.item(1).childNodes.item(0) != null)
           	{
              	login = root.childNodes.item(1).childNodes.item(0).data;
           	}
					//alert("FI:"+login);
				}
				else //IE
				{
              //alert(root.childNodes.item(0).childNodes.item(0));
              if (root.childNodes.item(0).childNodes.item(0) != null)
              {
              	login = root.childNodes.item(0).childNodes.item(0).data
              }
					//alert("IE:"+login);
				}
           if(login)
           {
           	//alert("USER:"+login);
					var lrow1 = document.createElement("tr");
 	 				var lcell1 = document.createElement("td");
 	 				//align="right" width="172" height="17" collspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "17px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<font class=\"log\">Welcome</font>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="172" height="17" collspan="2
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.style.height = "17px";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<font class=\"log\"><u>"+login+"</u></font>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" colspan="2"
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a class=\"log1\" onclick='Logout();return false;' onmouseover=\"this.style.cursor='pointer'\"><img src=\"http://img.live2sms.gr/logout.jpg\" width=\"100\" height=\"18\" border=\"0\"></a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);
           }
           else
           {
            	//alert("NOT LOGIN");
            	var lrow1 = document.createElement("tr");
 	 				var lcell1 = document.createElement("td");
 	 				//align="right" width="74"
 	 				lcell1.style.width = "72px";
  				lcell1.align = "right";
              lcell1.innerHTML = "<font class=\"log\">Όνομα:&nbsp;</font>";
              lrow1.appendChild(lcell1);
              var lcell2 = document.createElement("td");
              //align="left" width="100"
 	 				lcell2.style.width = "100px";
  				lcell2.style.align = "left";
              lcell2.innerHTML = "<input id=\"username\" name=\"username\" type=\"text\" style=\"width:100px;height:17px;\">";
              lrow1.appendChild(lcell2);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="74"
 	 				lcell1.style.width = "72px";
  				lcell1.align = "right";
              lcell1.innerHTML = "<font class=\"log\">Κωδικός: &nbsp;</font>";
              lrow1.appendChild(lcell1);
              var lcell2 = document.createElement("td");
              //align="left" width="100"
 	 				lcell2.style.width = "100px";
  				lcell2.style.align = "left";
              lcell2.innerHTML = "<input id=\"password\" type=\"password\" name=\"password\" type=\"text\" style=\"width:100px;height:17px;\">";
              lrow1.appendChild(lcell2);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" colspan="2"
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a class=\"log1\" onclick='SubmitForm();return false;' onmouseover=\"this.style.cursor='pointer'\"><img src=\"http://img2.live2sms.gr/login.jpg\" width=\"100\" height=\"18\" border=\"0\"></a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="172" colspan="2"
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<font class=\"log\">Remember me&nbsp;&nbsp;</font><input type=\"checkbox\" id=\"permanent\" value=\"0\" />";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a href=\"forgot\" class=\"regis\">Ξεχάσατε τον κωδικό σας</a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a href=\"/register.php\" class=\"regis\">Register HERE</a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);
           }
           logtable.appendChild(logtablebody);
				form.appendChild(logtable);
           logspan.appendChild(form);
			}
		}
  }
  function logpost(url,parameters)
  {
	  	posthttp_request = false;
	  	if (window.XMLHttpRequest) //Mozilla
	  	{
	     	posthttp_request = new XMLHttpRequest();
	     	if (posthttp_request.overrideMimeType)
	     	{
	        	posthttp_request.overrideMimeType('text/xml');
	     	}
	  	}
	  	else if (window.ActiveXObject)// IE
	  	{
	     	try{posthttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     	catch (e){try{posthttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  	}
	  	if (!posthttp_request)
	  	{
	     	ErrWin(1,'Cannot create XMLHTTP instance');
	     	return false;
	  	}

		posthttp_request.onreadystatechange = loghpost;
		posthttp_request.open('POST', url, true);
		posthttp_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		posthttp_request.setRequestHeader("Content-length", parameters.length);
		posthttp_request.setRequestHeader("Connection", "close");
		posthttp_request.send(parameters);
  }
  function loghpost()
  {
	  if (posthttp_request.readyState == 4)
		{
	     	if (posthttp_request.status == 200)
			{
				//alert("XMLDONE");
           var logspan =  document.getElementById("login");
           while(logspan.firstChild){logspan.removeChild(logspan.firstChild);};
           var form = document.createElement("form");
           form.name = "joinform";
           var logtable = document.createElement("table");
			  	logtable.setAttribute("cellSpacing","0");
			  	logtable.setAttribute("cellPadding","0");
           logtable.style.border = "0px";
           logtable.style.width = "172px";

           logtablebody = document.createElement("tbody");

           var xmldoc = posthttp_request.responseXML; //responseText
           //alert("TEXT"+xmldoc.statusText);
           var root = xmldoc.getElementsByTagName('root').item(0);
	      	var login = '';
				if(root.childNodes.item(0).nodeName == '#text')//FI
				{
              //alert(root.childNodes.item(1).childNodes.item(0));
           	if (root.childNodes.item(1).childNodes.item(0) != null)
           	{
              	login = root.childNodes.item(1).childNodes.item(0).data;
           	}
					//alert("FI:"+login);
				}
				else //IE
				{
              //alert(root.childNodes.item(0).childNodes.item(0));
              if (root.childNodes.item(0).childNodes.item(0) != null)
              {
              	login = root.childNodes.item(0).childNodes.item(0).data
              }
					//alert("IE:"+login);
				}

           if(login)//Login OK
           {
           	//alert("USER:"+login);
					var lrow1 = document.createElement("tr");
 	 				var lcell1 = document.createElement("td");
 	 				//align="right" width="172" height="17" collspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "17px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<font class=\"log\">Welcome</font>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="172" height="17" collspan="2
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.style.height = "17px";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<font class=\"log\"><u>"+login+"</u></font>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" colspan="2"
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a class=\"log1\" onclick='Logout();return false;' onmouseover=\"this.style.cursor='pointer'\"><img src=\"http://img.live2sms.gr/logout.jpg\" width=\"100\" height=\"18\" border=\"0\"></a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);


    				var array = GetCatList();
					for(var i=0;i<array.length;i++)
					{
		  				ClearCat(array[i]);
					}
	            cntcat = 0;
	            hastd = 0;
	            hastd1 = 0;
	            t_rfc = false;
	            sel_cat = 1;
	            prev_sel = 1;
	            selected = 0;
	            lfsel = 1;
              lfob.lfload('http://www.live2sms.gr/xlf/');
           }
           else //Login failed
           {
           	var error = '';
              //alert("OPA:"+root.childNodes.item(3).nodeName);
					//if(root.childNodes.item(2).nodeName == '#text')//FI
					//{
              	//alert(root.childNodes.item(2).childNodes.item(0));
           		//if (root.childNodes.item(2).childNodes.item(0) != null)
           		//{
              		//error = root.childNodes.item(2).childNodes.item(0).data;
           		//}
						////alert("FI:"+login);
					//}
					//else //IE
					//{
              	//alert(root.childNodes.item(0).childNodes.item(0));
              	//if (root.childNodes.item(0).childNodes.item(0) != null)
              	//{
              	  //	error = root.childNodes.item(0).childNodes.item(0).data
              	//}
						////alert("IE:"+login);
					//}
              //alert("NOT LOGIN:"+error);
            	ErrWin(1,"NOT LOGIN");
            	var lrow1 = document.createElement("tr");
 	 				var lcell1 = document.createElement("td");
 	 				//align="right" width="74"
 	 				lcell1.style.width = "72px";
  				lcell1.align = "right";
              lcell1.innerHTML = "<font class=\"log\">Όνομα:&nbsp;</font>";
              lrow1.appendChild(lcell1);
              var lcell2 = document.createElement("td");
              //align="left" width="100"
 	 				lcell2.style.width = "100px";
  				lcell2.style.align = "left";
              lcell2.innerHTML = "<input id=\"username\" name=\"username\" type=\"text\" style=\"width:100px;height:17px;\">";
              lrow1.appendChild(lcell2);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="74"
 	 				lcell1.style.width = "72px";
  				lcell1.align = "right";
              lcell1.innerHTML = "<font class=\"log\">Κωδικός: &nbsp;</font>";
              lrow1.appendChild(lcell1);
              var lcell2 = document.createElement("td");
              //align="left" width="100"
 	 				lcell2.style.width = "100px";
  				lcell2.style.align = "left";
              lcell2.innerHTML = "<input id=\"password\" type=\"password\" name=\"password\" type=\"text\" style=\"width:100px;height:17px;\">";
              lrow1.appendChild(lcell2);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" colspan="2"
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a class=\"log1\" onclick='SubmitForm();return false;' onmouseover=\"this.style.cursor='pointer'\"><img src=\"http://img2.live2sms.gr/login.jpg\" width=\"100\" height=\"18\" border=\"0\"></a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="172" colspan="2"
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<font class=\"log\">Remember me&nbsp;&nbsp;</font><input type=\"checkbox\" id=\"permanent\" value=\"0\" />";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a href=\"forgot\" class=\"regis\">Ξεχάσατε τον κωδικό σας</a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a href=\"/register.php\" class=\"regis\">Register HERE</a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);
           }
           logtable.appendChild(logtablebody);
				form.appendChild(logtable);
           logspan.appendChild(form);
			}
		}
  }
  function logout(url)
  {
	  loghttp_request = false;
	  if (window.XMLHttpRequest) //Mozilla
	  {
	     loghttp_request = new XMLHttpRequest();
	     if (loghttp_request.overrideMimeType)
	     {
	        loghttp_request.overrideMimeType('text/xml');
	     }
	  }
	  else if (window.ActiveXObject)// IE
	  {
	     try{loghttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     catch (e){try{loghttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  }
	  if (!loghttp_request)
	  {
	     ErrWin(1,'Cannot create XMLHTTP instance');
	     return false;
	  }
	  loghttp_request.onreadystatechange = loghout;
	  loghttp_request.open('GET',url + "?logout=&rand="+Math.floor(Math.random()*1000000), true);
	  loghttp_request.send(null);
  }
  function loghout()
  {
	  if (loghttp_request.readyState == 4)
		{
	     	if (loghttp_request.status == 200)
			{
				//alert("XMLDONE");
           var xmldoc = loghttp_request.responseXML;
           var root = xmldoc.getElementsByTagName('root').item(0);

	      	var logout = '';
				if(root.childNodes.item(0).nodeName == '#text')//FI
				{
              //alert(root.childNodes.item(1).childNodes.item(0));
           	if (root.childNodes.item(1).childNodes.item(0) != null)
           	{
              	logout = root.childNodes.item(1).childNodes.item(0).data;
           	}
					//alert("FI:"+login);
				}
				else //IE
				{
              //alert(root.childNodes.item(0).childNodes.item(0));
              if (root.childNodes.item(0).childNodes.item(0) != null)
              {
              	logout = root.childNodes.item(0).childNodes.item(0).data
              }
					//alert("IE:"+login);
				}
           if(logout)
           {
           	//alert("LOGOUT:"+logout);
           	var logspan =  document.getElementById("login");
           	while(logspan.firstChild){logspan.removeChild(logspan.firstChild);};
           	var form = document.createElement("form");
           	form.name = "joinform";
           	var logtable = document.createElement("table");
			  		logtable.setAttribute("cellSpacing","0");
			  		logtable.setAttribute("cellPadding","0");
           	logtable.style.border = "0px";
           	logtable.style.width = "172px";

           	logtablebody = document.createElement("tbody");

            	var lrow1 = document.createElement("tr");
 	 				var lcell1 = document.createElement("td");
 	 				//align="right" width="74"
 	 				lcell1.style.width = "72px";
  				lcell1.align = "right";
              lcell1.innerHTML = "<font class=\"log\">Όνομα:&nbsp;</font>";
              lrow1.appendChild(lcell1);
              var lcell2 = document.createElement("td");
              //align="left" width="100"
 	 				lcell2.style.width = "100px";
  				lcell2.style.align = "left";
              lcell2.innerHTML = "<input id=\"username\" name=\"username\" type=\"text\" style=\"width:100px;height:17px;\">";
              lrow1.appendChild(lcell2);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="74"
 	 				lcell1.style.width = "72px";
  				lcell1.align = "right";
              lcell1.innerHTML = "<font class=\"log\">Κωδικός: &nbsp;</font>";
              lrow1.appendChild(lcell1);
              var lcell2 = document.createElement("td");
              //align="left" width="100"
 	 				lcell2.style.width = "100px";
  				lcell2.style.align = "left";
              lcell2.innerHTML = "<input id=\"password\" type=\"password\" name=\"password\" type=\"text\" style=\"width:100px;height:17px;\">";
              lrow1.appendChild(lcell2);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" colspan="2"
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a class=\"log1\" onclick='SubmitForm();return false;' onmouseover=\"this.style.cursor='pointer'\"><img src=\"http://img2.live2sms.gr/login.jpg\" width=\"100\" height=\"18\" border=\"0\"></a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="172" colspan="2"
 	 				lcell1.style.width = "172px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<font class=\"log\">Remember me&nbsp;&nbsp;</font><input type=\"checkbox\" id=\"permanent\" value=\"0\" />";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a href=\"forgot\" class=\"regis\">Ξεχάσατε τον κωδικό σας</a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="4" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "4px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<img src=\"http://img4.live2sms.gr/spacer.gif\" width=\"1\" height=\"4\" border=\"0\">";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

            	lrow1 = document.createElement("tr");
 	 				lcell1 = document.createElement("td");
 	 				//align="right" width="174" height="5" colspan="2"
 	 				lcell1.style.width = "172px";
              lcell1.style.height = "5px";
  				lcell1.align = "right";
  				lcell1.setAttribute("colspan","2");
  				lcell1.colSpan="2";
              lcell1.innerHTML = "<a href=\"/register.php\" class=\"regis\">Register HERE</a>";
              lrow1.appendChild(lcell1);
              logtablebody.appendChild(lrow1);

           	logtable.appendChild(logtablebody);
					form.appendChild(logtable);
           	logspan.appendChild(form);

    				var array = GetCatList();
					for(var i=0;i<array.length;i++)
					{
		  				ClearCat(array[i]);
					}
	            cntcat = 0;
	            hastd = 0;
	            hastd1 = 0;
	            t_rfc = false;
	            sel_cat = 1;
	            prev_sel = 1;
	            selected = 0;
	            lfsel = 1;
              lfob.lfload('http://www.live2sms.gr/xlf/');
           }
			}
		}
  }
  //GAME RESULTS------------------------------------------------------------
  function cfshowres(url,mid,cX,cY)
  {
  	//alert(url+":"+mid);
		reshttp_request = false;
	  	if (window.XMLHttpRequest) //Mozilla
	  	{
	     	reshttp_request = new XMLHttpRequest();
	     	if (reshttp_request.overrideMimeType)
	     	{
	        	reshttp_request.overrideMimeType('text/xml');
	     	}
	  	}
	  	else if (window.ActiveXObject)// IE
	  	{
	     	try{reshttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     	catch (e){try{reshttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  	}
	  	if (!reshttp_request)
	  	{
	     	ErrWin(1,'Cannot create XMLHTTP instance');
	     	return false;
	  	}
     //function pCfhshowres(cX,cY){this.cfhshowres = cfhshowres(cX,cY)}new pCfhshowres().cfhshowres;//
     //alert(cX+":"+cY);
	  	reshttp_request.onreadystatechange = function(){cfhshowres(cX,cY);}//alert(cX+":::"+cY);cfhshowres;//cfhshowres;
	  	reshttp_request.open('GET',url + "?game&mid="+mid+"&rand="+Math.floor(Math.random()*1000000), true);
	  	reshttp_request.send(null);
	}
  function cfhshowres(cX,cY)
  {
	  if (reshttp_request.readyState == 4)
		{
	     	if (reshttp_request.status == 200)
			{
        	//var xmldoc = reshttp_request.responseText;
           //alert(cX+":"+cY);
        	var xmldoc = reshttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
           var sctable = '';
           var cnt = 0;
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              //alert("1:"+ node.nodeName);
              var mid = node.getAttribute("id");
 					for(var n1=0;n1<node.childNodes.length;n1++)
 					{
              	var node1 = node.childNodes.item(n1);
                 if(node1.nodeName == '#text'){continue;}
                 //alert("2:"+ node1.nodeName);
                 var mdom,mres,mgost,mtime = '';
						switch(node1.nodeName)
						{
                 	case 'dom':
                    	mdom = node1.childNodes[0].nodeValue;
                 	break;
                 	case 'res':
                 		mres = node1.childNodes[0].nodeValue;
                 	break;
                 	case 'gost':
                 		mgost = node1.childNodes[0].nodeValue;
                 	break;
                 	case 'time':
                 		mtime = node1.childNodes[0].nodeValue;
                 		if(sctable == '')
                 		{
									//+sctable = '<table bgcolor="#254A70" width="345" cellspacing="0" cellpadding="0" border="0" style="border-color: #254A70;border-width: 2px 2px 2px 2px; border-style: solid;"><tr class="restitle"><td colspan="1" width="40"><font size="-1" face="verdana">'+mtime+'</font></td><td colspan="6" width="280" align="center">'+mdom+' ['+mres+'] '+mgost+'</td> <td width="20" align="right" onClick="ResWin(\'reswin\',0,'+cX+','+cY+');" onmouseover="this.style.cursor=\'pointer\'"><img src="http://img.live2sms.gr/close2.png" width="20" height="20" border="0" style="margin: 0px 0px 0px 0px"></td></tr><tr><td><img src="http://img4.live2sms.gr/spacer.gif" width="1" height="1" border="0"></td><td><img src="http://img4.live2sms.gr/spacer.gif" width="1" height="1" border="0"></td><td><img src="http://img4.live2sms.gr/spacer.gif" width="1" height="1" border="0"></td><td><img src="http://img4.live2sms.gr/spacer.gif" width="1" height="1" border="0"></td><td><img src="http://img4.live2sms.gr/spacer.gif" width="1" height="1" border="0"></td><td><img src="http://img4.live2sms.gr/spacer.gif" width="1" height="1" border="0"></td><td><img src="http://img4.live2sms.gr/spacer.gif" width="1" height="1" border="0"></td><td><img src="http://img4.live2sms.gr/spacer.gif" width="1" height="1" border="0"></td></tr>';
                          //+sctable = '<table width="345" cellspacing="0" cellpadding="0" border="0" bgcolor="#66FFFF" style="border: 2px solid rgb(37, 74, 112);"><tbody><tr class="restitle"><td width="30" align="center"><font size="-1" face="verdana">'+mtime+'</font></td><td width="290" align="center">'+mdom+' ['+mres+'] '+mgost+'</td><td width="20" align="right"><img width="20" height="20" border="0" style="margin: 0px;" src="http://img.live2sms.gr/close2.png"/ onmouseover="this.style.cursor=\'pointer\'" onclick="ResWin(\'reswin\',0,'+cX+','+cY+');;" style="cursor: pointer;"></td></tr><tr><td width="340" colspan="3"><img width="1" height="1" border="0" src="http://img4.live2sms.gr/spacer.gif"/></td></tr>';
                          sctable = '<table  cellSpacing="0" cellPadding="0" width="345" bgColor="#254a70" border="0" bordercolor="red" style="BORDER-RIGHT: #254a70 2px solid; BORDER-TOP: #254a70 2px solid; BORDER-LEFT: #254a70 2px solid; BORDER-BOTTOM: #254a70 2px solid"><tbody><tr class="restitle"><td width="40"><FONT face="verdana" size="-1">'+mtime+'</FONT></td><td align="center" width="280" colSpan="6">'+mdom+' ['+mres+'] '+mgost+'</td><td align="right" width="20"><img width="20" height="20" border="0" style="margin: 0px;" src="http://img.live2sms.gr/close2.png" onmouseover="this.style.cursor=\'pointer\'" onclick="ResWin(\'reswin\',0,'+cX+','+cY+',0);" style="cursor: pointer;"></td></tr><tr><td width="40"><IMG height="1" src="http://img4.live2sms.gr/spacer.gif" width="1" border="0" /></td><td width="45"><IMG height="1" src="http://img4.live2sms.gr/spacer.gif" width="1" border="0" /></td><td width="46"><IMG height="1" src="http://img4.live2sms.gr/spacer.gif" width="1" border="0" /></td><td width="46"><IMG height="1" src="http://img4.live2sms.gr/spacer.gif" width="1" border="0" /></td><td width="48"><IMG height="1" src="http://img4.live2sms.gr/spacer.gif" width="1" border="0" /></td><td width="60"><IMG height="1" src="http://img4.live2sms.gr/spacer.gif" width="1" border="0" /></td><td width="60"><IMG height="1" src="http://img4.live2sms.gr/spacer.gif" width="1" border="0" /></td><td width="20"><IMG height="1" src="http://img4.live2sms.gr/spacer.gif" width="1" border="0" /></td></tr>';
                 		}
                 	break;
                 	case 'score':
								//var stime,sres,steam,sname,sdtl = '';
								//var stime,sres,slname,srname,slflag,srflag,sdtl='';
								var stime='';var sres='';var slname='';var srname='';var slflag='';var srflag='';var sdtl='';
                       //alert(" LFLAG:"+slflag+" RFLAG:"+srflag);
              			if(node1.childNodes.item(0).nodeName == '#text') //FI
              			{
	            				if(node1.childNodes.item(1).childNodes.item(0) !== 'undefined' && node1.childNodes.item(1).childNodes.item(0) !== null)
	            				{
                          	stime =  node1.childNodes.item(1).childNodes.item(0).data+'\'';
	            				}
	            				else
	            				{
                          	stime =  '';
	            				}
                          if(node1.childNodes.item(3).childNodes.item(0) !== 'undefined' && node1.childNodes.item(3).childNodes.item(0)!== null)
                          {
	            					sres =  '['+node1.childNodes.item(3).childNodes.item(0).data+']';
                          }
                          else
                          {
										sres = '';
                          }
                          if(node1.childNodes.item(5).childNodes.item(0) !== 'undefined' && node1.childNodes.item(5).childNodes.item(0)!== null)
                          {
	            					slname =  node1.childNodes.item(5).childNodes.item(0).data;
	            					//slflag = node1.childNodes.item(5).childNodes.item(0).getAttribute("flag");
	            					slflag = node1.childNodes.item(5).getAttribute("flag");
                    			if(slflag != null){slflag='<img src="http://img.live2sms.gr/'+slflag+'" border="0" style="margin: 0px 3px 0px 3px">';}
                    			else{slflag= '';}
                    			sdtl = node1.childNodes.item(5).getAttribute("dtl");
                             if(sdtl == null){sdtl='';}
                    			//sdtl =  node1.childNodes.item(7).getAttribute("dtl");
                          }
                          else
                          {
										slname = '';
                          }
                        	if(node1.childNodes.item(7).childNodes.item(0) !== 'undefined' && node1.childNodes.item(7).childNodes.item(0)!== null)
                          {
	            					srname =  node1.childNodes.item(7).childNodes.item(0).data;
	            					//srflag = node1.childNodes.item(7).childNodes.item(0).getAttribute("flag");
                             srflag = node1.childNodes.item(7).getAttribute("flag");
                    			if(srflag != null){srflag='<img src="http://img.live2sms.gr/'+srflag+'" border="0" style="margin: 0px 3px 0px 3px">';}
                    			else{srflag= '';}
                    			//sdtl =  node1.childNodes.item(7).getAttribute("dtl");
                          }
                          else
                          {
										srname = '';
                          }
              			}
              			else //IE
              			{
                          //alert("UUUUU");
                          //alert(node1.childNodes.item(0).childNodes.item(0).data);
	            				if(node1.childNodes.item(0).childNodes.item(0) !== 'undefined' && node1.childNodes.item(0).childNodes.item(0) !== null)
	            				{
                          	stime = node1.childNodes.item(0).childNodes.item(0).data+'\'';
	            				}
	            				else
	            				{
                          	stime =  '';
	            				}
                          //alert(node1.childNodes.item(1).childNodes.item(0);
                          if(node1.childNodes.item(1).childNodes.item(0) !== 'undefined' && node1.childNodes.item(1).childNodes.item(0)!== null)
                          {
	            					sres = '['+node1.childNodes.item(1).childNodes.item(0).data+']';
                          }
                          else
                          {
										sres = '';
                          }
                          //alert("UUUUU:"+node1.childNodes.item(0).childNodes.item(0).data+":"+stime);
                          //alert(node1.childNodes.item(4).childNodes);
                          //alert(node1.childNodes.item(2).childNodes.item(0);
                          //alert("UUUUU:"+sres+":"+stime);//node1.childNodes.item(5).childNodes.item(0));
                          if(node1.childNodes.item(2).childNodes.item(0) !== 'undefined' && node1.childNodes.item(2).childNodes.item(0)!== null)
                          {
	            					slname =  node1.childNodes.item(2).childNodes.item(0).data;
	            					//slflag = node1.childNodes.item(2).childNodes.item(0).getAttribute("flag");
                             slflag = node1.childNodes.item(2).getAttribute("flag");
                    			if(slflag != null){slflag='<img src="http://img.live2sms.gr/'+slflag+'" border="0" style="margin: 0px 3px 0px 3px">';}
                    			else{slflag= '';}
                    			sdtl = node1.childNodes.item(2).getAttribute("dtl");
                             if(sdtl == null){sdtl='';}
                    			//sdtl =  node1.childNodes.item(7).getAttribute("dtl");
                          }
                          else
                          {
										slname = '';
                          }
                          //alert(node1.childNodes.item(3).childNodes.item(0);
                        	if(node1.childNodes.item(3).childNodes.item(0) !== 'undefined' && node1.childNodes.item(3).childNodes.item(0)!== null)
                          {
	            					srname =  node1.childNodes.item(3).childNodes.item(0).data;
	            					//srflag = node1.childNodes.item(3).childNodes.item(0).getAttribute("flag");
                             srflag = node1.childNodes.item(3).getAttribute("flag");
                    			if(srflag != null){srflag='<img src="http://img.live2sms.gr/'+srflag+'" border="0" style="margin: 0px 3px 0px 3px">';}
                    			else{srflag= '';}
                    			//sdtl =  node1.childNodes.item(7).getAttribute("dtl");
                          }
                          else
                          {
										srname = '';
                          }
              			}
              			//alert("LNAME:"+slname+" LFLAG:"+slflag+" RNAME:"+srname+" RFLAG:"+srflag);
              			cnt++;
              			if(sdtl == 1)
              			{
                          //sctable += '<tr class="respen"><td colspan="3" width="140" align="center">'+slname+' '+slflag+'</td></tr><tr><td colspan="3" width="340" height="1"></td></tr>';
                          //+sctable += '<tr class="respen"><td colspan="3" width="140" align="center">'+slname+' '+slflag+'</td></tr><tr><td colspan="3" width="340" height="1"></td></tr>';
                          sctable += '<tr class="respen"><td colspan="8" width="340" align="center">'+slname+' '+slflag+'</td></tr><tr><td colspan="8" width="340" height="1"></td></tr>';
                       	break;
              			}
                       if(cnt % 2)
                       {
									//sctable += '<tr class="reslight"><td width="20" align="center">'+stime+'</td><td width="40" align="center"><b>'+sres+'</b></td><td colspan="3" width="140" align="left">'+slname+sdtl+' '+slflag+'</td><td colspan="3" width="140" align="right">'+srname+sdtl+' '+srflag+'</td></tr><tr><td colspan="8" width="340" height="1"></td></tr>';
                       	//+sctable += '<tr><td colspan="3"><table width="340" cellspacing="0" cellpadding="0" border="0"><tr class="reslight"><td width="30" align="center">'+stime+'</td><td width="40" align="center"><b>'+sres+'</b></td><td width="135" align="left">'+slname+sdtl+' '+slflag+'</td><td width="135" align="right">'+srname+sdtl+' '+srflag+'</td></tr></table></td></tr>';
                       	sctable += '<tr class="reslight"><td align="center" width="40">'+stime+'</td><td align="center" width="45"><b>'+sres+'</b></td><td align="left" width="140" colSpan="3">'+slname+sdtl+' '+slflag+'</td><td align="right" width="140" colSpan="3">'+srname+sdtl+' '+srflag+'</td></tr><tr><td width="340" colSpan="8" height="1"></td></tr>';
                       }
                       else
                       {
                         //	sctable += '<tr class="resdark"><td width="20" align="center">'+stime+'</td><td width="40" align="center"><b>'+sres+'</b></td><td colspan="3" width="140" align="left">'+slname+sdtl+' '+slflag+'</td><td colspan="3" width="140" align="right">'+srname+sdtl+' '+srflag+'</td></tr><tr><td colspan="8" width="340" height="1"></td></tr>';
                          //+sctable += '<tr><td colspan="3"><table width="340" cellspacing="0" cellpadding="0" border="0"><tr class="resdark"><td width="30" align="center">'+stime+'</td><td width="40" align="center"><b>'+sres+'</b></td><td width="135" align="right">'+slname+sdtl+' '+slflag+'</td><td width="135" align="right">'+srname+sdtl+' '+srflag+'</td></tr></table></td></tr>';
                          sctable += '<tr class="resdark"><td align="center" width="40">'+stime+'</td><td align="center" width="45"><b>'+sres+'</b></td><td align="left" width="140" colSpan="3">'+slname+sdtl+' '+slflag+'</td><td align="right" width="140" colSpan="3">'+srname+sdtl+' '+srflag+'</td></tr><tr><td width="340" colSpan="8" height="1"></td></tr>';
                       }
								break;
						}
              }
              var res =  document.getElementById("res_"+mid);
              if(res)
              {
              	res.innerHTML = "<font id=\"wres_"+mid+"\" color=\"#0000FF\" onmouseout=\"this.style.textDecoration=''\" onmouseover=\"this.style.cursor='pointer';this.style.textDecoration='underline'\" onClick=\"showres("+mid+",event"+")\">" + mres + "</font>";
              }
              if(mtime && !mtime.match(/\sGMT$/))
              {
              	var time = document.getElementById("dat_"+mid);
              	if(time)
              	{
                 	time.title = mtime;
                 	time.innerHTML = mtime;
                 }
              }
				}
           //+//sctable += '<tr class="rescr"><td colspan="8" height="6"></td></tr></table>';
           //sctable += '</tbody></table></div>';
           sctable += '<tr class="rescr"><td colSpan="8" height="6"></td></tr></tbody></table> ';

           //alert(sctable);
           //alert(sctable + '<tr class="cr"><td colspan="5" height="6"></td></tr><tr><td colspan="4" width="400" height="1"></td></tr></table>');
           //Tip(sctable);
           //alert(cX+"::"+cY);

           var reswin =  document.getElementById("reswin");
           reswin.innerHTML = sctable;
           hload();
           ResWin('reswin',1,cX,cY,0);

				//return sctable + '<tr class="cr"><td colspan="5" height="6"></td></tr><tr><td colspan="4" width="400" height="1"></td></tr></table>';
				return;
			}
		}
  }
  function cfshowodd(url,mid,cX,cY,oddtype)
  {
		reshttp_request = false;
	  	if (window.XMLHttpRequest) //Mozilla
	  	{
	     	reshttp_request = new XMLHttpRequest();
	     	if (reshttp_request.overrideMimeType)
	     	{
	        	reshttp_request.overrideMimeType('text/xml');
	     	}
	  	}
	  	else if (window.ActiveXObject)// IE
	  	{
	     	try{reshttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     	catch (e){try{reshttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  	}
	  	if (!reshttp_request)
	  	{
	     	ErrWin(1,'Cannot create XMLHTTP instance');
	     	return false;
	  	}
     //function pCfhshowres(cX,cY){this.cfhshowres = cfhshowres(cX,cY)}new pCfhshowres().cfhshowres;//
     //alert(cX+":"+cY);
	  	reshttp_request.onreadystatechange = function(){cfhshowodd(cX,cY);}//alert(cX+":::"+cY);cfhshowres;//cfhshowres;
	  	reshttp_request.open('GET',url + "?odd&oddtype="+oddtype+"&mid="+mid+"&rand="+Math.floor(Math.random()*1000000), true);
	  	reshttp_request.send(null);
  }
  function cfhshowodd(cX,cY)
  {
	  if (reshttp_request.readyState == 4)
		{
	     	if (reshttp_request.status == 200)
			{
        	var xmldoc = reshttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
           var sctable = '';
           var cnt = 0;
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              //alert("1:"+ node.nodeName);
              var mid = node.getAttribute("id");
              var aver=new Array(3);var high=new Array(3);var low= new Array(3);
              aver[0]=aver[1]=aver[2]="";
              high[0]=high[1]=high[2]="";
              low[0]=low[1]=low[2]="";
              var fll = 0;
 					for(var n1=0;n1<node.childNodes.length;n1++)
 					{
              	var node1 = node.childNodes.item(n1);
                 if(node1.nodeName == '#text'){continue;}
                 //alert("2:"+ node1.nodeName);
                 var mdom,mgost,mtime = '';
						switch(node1.nodeName)
						{
                 	case 'dom':
                    	mdom = node1.childNodes[0].nodeValue;
                 	break;
                 	case 'gost':
                 		mgost = node1.childNodes[0].nodeValue;
                 	break;
                 	case 'time':
                 		mtime = node1.childNodes[0].nodeValue;
                 		if(sctable == '')
                 		{
                          sctable = '<table  cellSpacing="0" cellPadding="0" width="340" bgColor="#254a70" border="0" bordercolor="red" style="border-top: 2px solid #254A70; border-left: 2px solid #254A70; border-right: 2px solid #254A70;"><tbody><tr class="restitle"><td width="75" height="22"><font style="font-size:11px" face="verdana">'+mtime+'</font></td><td width="245" height="22" align="center">'+mdom+' - '+mgost+'</td><td width="20" height="22" align="right"><img width="20" height="20" border="0" style="margin: 0px;" src="http://img.live2sms.gr/close2.png" onmouseover="this.style.cursor=\'pointer\'" onclick="ResWin(\'reswin\',0,'+cX+','+cY+',1);"></td></tr></tbody></table>';
                 		}
                 	break;
                 	case 'odds':
                       var type=node1.getAttribute("type");
                       sctable += '<table width="340" cellspacing="0" cellpadding="0" bgcolor="#254a70" style="border-left: 2px solid #254A70; border-right: 2px solid #254A70; border-bottom: 2px solid #254A70;"> <tbody><tr class="resdark"><td width="40" height="18" align="center"></td><td width="150" height="18" align="left" style="padding-left:10px;"><b>Bookmaker</b></td><td width="150" height="18">';
                       //alert("ODDS_TYPE:"+type);
                       switch(type)
                       {
                       	case '1':
                          	sctable += '<table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell"><b>1</b></td><td class="betting-cell"><b>X</b></td><td class="betting-cell"><b>2</b></td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';
                       	break;
                       	case '2':
                       		sctable += '<table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell"><b>AH</b></td><td class="betting-cell"><b>Home</b></td><td class="betting-cell"><b>Away</b></td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';
                       	break;
                       	case '3':
                       		sctable += '<table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell"><b></b></td><td class="betting-cell"><b>Over</b></td><td class="betting-cell"><b>Under</b></td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';
                       	break;
                       }
 								for(var n2=0;n2<node1.childNodes.length;n2++)
 								{
                          //fll = 1;
                        	var node2 = node1.childNodes.item(n2);
                          if(node2.nodeName == '#text'){continue;}
                       	var name = node2.getAttribute("name");
                       	var flag = node2.getAttribute("flag");
                       	var promo = node2.getAttribute("promo");
                       	//alert(node2.nodeName+":"+name+":"+flag);
                          cnt++;
                          var coef1='';
                          var coef2,coef3,clink1,clink2,clink3;
                          for(var n3=0;n3<node2.childNodes.length;n3++)
                          {
                          	var node3 = node2.childNodes.item(n3);
                          	if(node3.nodeName == '#text'){continue;}

                             //cnt++;
                             //alert("1:"+node3.nodeName);
                    			//if(cnt % 2)
                          	switch(node3.nodeName)
                          	{
                          		case 'coef1':
                                   //alert(node3.hasChildNodes() +":"+node3.childNodes[0].nodeValue+":"+FtoFr(node3.childNodes[0].nodeValue));
                                   if(node3.hasChildNodes())
                                   {
                                		if(type==1){coef1 = FtoFr(node3.childNodes[0].nodeValue);}
                                		else{coef1 = node3.childNodes[0].nodeValue;}
                                		//alert(coef1+":"+FtoFr(node3.childNodes[0].nodeValue));
                                	}
                          		break;
                          		case 'clink1':
                                   //if(node3.childNodes.item(0).hasChildNodes() && typeof node3.childNodes.item(1).childNodes.item(0)==='object'){clink1 =  node5.childNodes.item(1).childNodes.item(0).data;}
                          			if(node3.hasChildNodes())//if(node3.childNodes[0] !== 'undefined')
                          			{
                          				clink1 = node3.childNodes[0].nodeValue;
                          			}
                          		break;
                          		case 'coef2':
                          			coef2 = FtoFr(node3.childNodes[0].nodeValue);
                          		break;
                          		case 'clink2':
                          			clink2 = node3.childNodes[0].nodeValue;
                          		break;
                          		case 'coef3':
                          			coef3 = FtoFr(node3.childNodes[0].nodeValue);
                          		break;
                          		case 'clink3':
                          			clink3 = node3.childNodes[0].nodeValue;
                          		break;
                          	}
                          }
                          //alert(coef1+":"+coef2+":"+coef3);
                     		if(cnt%2)
                     		{
										//if(promo){sctable += '<tr class="reslight"><td width="40" height="22" align="center" title="'+promo+'"><img src="http://img.live2sms.gr/info1.gif" width="15" height="15" border="0"></td><td width="150" height="22" align="left" style="padding-left:5px;"><img src="http://img.live2sms.gr/logos/'+flag+'" alt="'+name+'" width="75" height="16" border="0"></td><td width="150" height="22"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell-links" height="22" onclick=window.open("'+clink1+'")>'+coef1+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink2+'")>'+coef2+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink3+'")>'+coef3+'</td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';}
                       		//else{sctable += '<tr class="reslight"><td width="40" height="22" align="center"></td><td width="150" height="22" align="left" style="padding-left:5px;"><img src="http://img.live2sms.gr/logos/'+flag+'" alt="'+name+'" width="75" height="16" border="0"></td><td width="150" height="22"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell-links" height="22" onclick=window.open("'+clink1+'")>'+coef1+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink2+'")>'+coef2+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink3+'")>'+coef3+'</td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';}
                             if(promo){sctable += '<tr class="reslight"><td width="40" height="22" align="center" title="'+promo+'"><img src="http://img.live2sms.gr/info1.gif" width="15" height="15" border="0"></td>';}
                             else{sctable += '<tr class="reslight"><td width="40" height="22" align="center"></td>';}
                             if(clink1){sctable += '<td width="150" height="22" align="left" style="padding-left:5px;"><img src="http://img.live2sms.gr/logos/'+flag+'" alt="'+name+'" width="75" height="16" border="0"></td><td width="150" height="22"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell-links" height="22" onclick=window.open("'+clink1+'")>'+coef1+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink2+'")>'+coef2+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink3+'")>'+coef3+'</td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';}
                             else{sctable += '<td width="150" height="22" align="left" style="padding-left:5px;"><img src="http://img.live2sms.gr/logos/'+flag+'" alt="'+name+'" width="75" height="16" border="0"></td><td width="150" height="22"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell" height="22">'+coef1+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink2+'")>'+coef2+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink3+'")>'+coef3+'</td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';}
                        	}
                      		else
                      		{
                       		//if(promo){sctable += '<tr class="resdark"><td width="40" height="22" align="center" title="'+promo+'"><img src="http://img.live2sms.gr/info.gif" width="15" height="15" border="0"></td><td width="150" height="22" align="left" style="padding-left:5px;"><img src="http://img.live2sms.gr/logos/'+flag+'" alt="'+name+'" width="75" height="16" border="0"></td><td width="150" height="22"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell-links" height="22" onclick=window.open("'+clink1+'")>'+coef1+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink2+'")>'+coef2+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink3+'")>'+coef3+'</td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';}
                        		//else{sctable += '<tr class="resdark"><td width="40" height="22" align="center"></td><td width="150" height="22" align="left" style="padding-left:5px;"><img src="http://img.live2sms.gr/logos/'+flag+'" alt="'+name+'" width="75" height="16" border="0"></td><td width="150" height="22"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell-links" height="22" onclick=window.open("'+clink1+'")>'+coef1+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink2+'")>'+coef2+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink3+'")>'+coef3+'</td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';}
                             if(promo){sctable += '<tr class="resdark"><td width="40" height="22" align="center" title="'+promo+'"><img src="http://img.live2sms.gr/info.gif" width="15" height="15" border="0"></td>';}
                             else{sctable += '<tr class="resdark"><td width="40" height="22" align="center"></td>';}
                             if(clink1){sctable += '<td width="150" height="22" align="left" style="padding-left:5px;"><img src="http://img.live2sms.gr/logos/'+flag+'" alt="'+name+'" width="75" height="16" border="0"></td><td width="150" height="22"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell-links" height="22" onclick=window.open("'+clink1+'")>'+coef1+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink2+'")>'+coef2+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink3+'")>'+coef3+'</td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';}
                             else{sctable += '<td width="150" height="22" align="left" style="padding-left:5px;"><img src="http://img.live2sms.gr/logos/'+flag+'" alt="'+name+'" width="75" height="16" border="0"></td><td width="150" height="22"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell" height="22">'+coef1+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink2+'")>'+coef2+'</td><td class="betting-cell-links" height="22" onclick=window.open("'+clink3+'")>'+coef3+'</td></tr></table></td></tr><tr><td width="340" height="1" colspan="3"></td></tr>';}
                    		}
 								}
                    break;
 							case 'aver1':
 								aver[0]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
 							case 'aver2':
 								aver[1]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
 							case 'aver3':
 								aver[2]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
 							case 'high1':
 								high[0]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
 							case 'high2':
 								high[1]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
 							case 'high3':
 								high[2]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
 							case 'low1':
 								low[0]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
 							case 'low2':
 								low[1]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
 							case 'low3':
 								low[2]=FtoFr(node1.childNodes[0].nodeValue);
 								fll = 1;
 							break;
						}
              }
              if(fll)
              {
              	sctable += '<tr class="rescr1"><td width="40" height="18" align="center"></td><td width="150" height="18" align="left" style="padding-left:5px;">Average</td><td width="150" height="18"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell" height="18">'+aver[0]+'</td><td class="betting-cell" height="18">'+aver[1]+'</td><td class="betting-cell" height="18">'+aver[2]+'</td></tr></table></td></tr>';//average
              	sctable += '<tr class="rescr1"><td width="40" height="18" align="center"></td><td width="150" height="18" align="left" style="padding-left:5px;">High</td><td width="150" height="18"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell" height="18">'+high[0]+'</td><td class="betting-cell" height="18">'+high[1]+'</td><td class="betting-cell" height="18">'+high[2]+'</td></tr></table></td></tr>';//average
                 sctable += '<tr class="rescr1"><td width="40" height="18" align="center"></td><td width="150" height="18" align="left" style="padding-left:5px;">Low</td><td width="150" height="18"><table cellspacing="0" cellpadding="0" border="0" width="150"><tr><td class="betting-cell" height="18">'+low[0]+'</td><td class="betting-cell" height="18">'+low[1]+'</td><td class="betting-cell" height="18">'+low[2]+'</td></tr></table></td></tr>';//average
           	}
				}
           sctable += '<tr class="rescr"><td height="6" colspan="3"></td></tr></tbody></table>';

           var reswin =  document.getElementById("reswin");
           reswin.innerHTML = sctable;
           hload();
           ResWin('reswin',1,cX,cY,1);
				return;
			}
		}
  }
  function cfshowstand(url,lid,cX,cY)
  {
  	//alert(url+":"+mid);
		reshttp_request = false;
	  	if (window.XMLHttpRequest) //Mozilla
	  	{
	     	reshttp_request = new XMLHttpRequest();
	     	if (reshttp_request.overrideMimeType)
	     	{
	        	reshttp_request.overrideMimeType('text/xml');
	     	}
	  	}
	  	else if (window.ActiveXObject)// IE
	  	{
	     	try{reshttp_request = new ActiveXObject("Msxml2.XMLHTTP");}
	     	catch (e){try{reshttp_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e) {}}
	  	}
	  	if (!reshttp_request)
	  	{
	     	ErrWin(1,'Cannot create XMLHTTP instance');
	     	return false;
	  	}
     //function pCfhshowres(cX,cY){this.cfhshowres = cfhshowres(cX,cY)}new pCfhshowres().cfhshowres;//
     //alert(cX+":"+cY);
	  	reshttp_request.onreadystatechange = function(){cfshowhstand(cX,cY);}//alert(cX+":::"+cY);cfhshowres;//cfhshowres;
	  	reshttp_request.open('GET',url + "?standings&lid="+lid+"&rand="+Math.floor(Math.random()*1000000), true);
	  	reshttp_request.send(null);
	}
  function cfshowhstand(cX,cY)
  {
	  if (reshttp_request.readyState == 4)
		{
	     	if (reshttp_request.status == 200)
			{
        	//var xmldoc = reshttp_request.responseText;
           //alert(cX+":"+cY);
        	var xmldoc = reshttp_request.responseXML;
				var root = xmldoc.getElementsByTagName('root').item(0);
           var sctable = '';
           var cnt = 0;
				for (var iNode = 0; iNode < root.childNodes.length; iNode++)//root
				{
	   			var node = root.childNodes.item(iNode);
        		if(node.nodeName == '#text'){continue;}
              var country = node.getAttribute("country");
              var league = node.getAttribute("league");
              var season = node.getAttribute("season");
              sctable = '<table  cellspacing="1" cellpadding="0" bgcolor="#254a70" class="textstandings" style="border: 1px solid rgb(37, 74, 112);"><tbody><tr class="restitle"><td align="center" colspan="8"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr class="restitle"><td align="center" width="90%">'+country+' - '+league+' '+season+'</td><td align="right" width="10%"><img width="20" height="20" border="0" style="margin: 0px; cursor: pointer;" onclick="ResWin1(\'reswin\',0,473,1527);" onmouseover="this.style.cursor=\'pointer\'" src="http://img.live2sms.gr/close2.png"/></td></tr></table></td></tr><tr align="center" bgcolor="#A6C3E1"><td align="center" rowspan="2" colspan="2"><b>Ομάδες</td><td align="center" colspan="4"><b>Αγώνες</td><td align="center" colspan="1"><b>Γκόλ</td><td rowspan="2"><b>Pt</td></tr><tr bgcolor="#A6C3E1"><td align="center">P</td><td align="center">W</td><td align="center">D</td><td align="center">L</td><td align="center">F A</td></tr>';
 					for(var n1=0;n1<node.childNodes.length;n1++)
 					{
              	var node1 = node.childNodes.item(n1);
                 if(node1.nodeName == '#text'){continue;}
                 var pl = node1.getAttribute("pl");
                 var team = node1.getAttribute("name");
                 var P = node1.getAttribute("P");
                 var W = node1.getAttribute("W");
                 var D = node1.getAttribute("D");
                 var L = node1.getAttribute("L");
                 var FA = node1.getAttribute("FA");
                 var Pts = node1.getAttribute("Pts");
                 var color = node1.getAttribute("clr");
                 sctable += '<tr align="center" bgcolor="'+color+'"><td class="tdstandings">'+pl+'</td><td class="tdstandings">'+team+'</td><td class="tdstandings">'+P+'</td><td class="tdstandings">'+W+'</td><td class="tdstandings">'+D+'</td><td class="tdstandings">'+L+'</td><td class="tdstandings">'+FA+'</td><td class="tdstandings">'+Pts+'</td></tr>';
              }
              sctable += '<tr align="center" bgcolor="#FFFFFF"><td colspan="8" align="right"><table class="textstandings" border="0" cellspacing="2" cellpadding="2" width="95%"><tr><td width="55%" valign="top"><b>Αγώνες</b><br>Α - Αγώνες<br>Ν - Νίκες<br>Ι - Ισοπαλίες<br>Η - Ήττες</td><td width="45%" valign="top"><b>Γκόλ</b><br>ΓΥ - Γκόλ Υπέρ<br>ΓΚ - Γκόλ Κατά<br><br>Β - Βαθμοί</td></tr><tr><td height="1" colspan="2"></tr></tbody></table>';
				}
           var reswin =  document.getElementById("reswin");
           reswin.innerHTML = sctable;
           hload();
           ResWin1('reswin',1,cX,cY);
				return;
			}
		}
  }
}
