//links_1.js
var strURL ="";
var SqlStr = "";
var objCur=null;
function  GetSql(DivCurId, SqlStr)
{

var IdCounter=1;
var DivShow = document.getElementById("DivLink"+IdCounter);
var DivCur = document.getElementById("DivLink"+DivCurId);


while (document.getElementById("DivLink"+IdCounter)!=null)
{
document.getElementById("DivLink"+IdCounter).className ="l_12_blu_r";
IdCounter++;
}
DivCur.className ="l_12_blu_r_click";



    GetDataSql(SqlStr);
 }
 //---------------------------
 function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
	function GetDataSql(SqlStr)
	 {		
		var strURL='links_1.php?Cat=' + SqlStr;
		var req = getXMLHTTP();
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('DivShow').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
