function vote(id){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'vote.php?id='; //This is the path to the file we just finished making
    xmlhttp.open('GET', file + id, true); //Open the file through GET, and add the id we want to retrieve as a GET variable
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved
                if( content != 'n' ){ //If the response was not "n" (meaning it worked)
                      //content = content.replace('y', ''); //Get rid of the y infront of our result *
                                document.getElementById('option_' + id).innerHTML = content; //Set the inner HTML of the div with the old value in it to the new value **
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function vote2(id){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'vote2.php?id='; //This is the path to the file we just finished making
    xmlhttp.open('GET', file + id, true); //Open the file through GET, and add the id we want to retrieve as a GET variable
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved
                if( content != 'n' ){ //If the response was not "n" (meaning it worked)
                      //content = content.replace('y', ''); //Get rid of the y infront of our result *
                                document.getElementById('option_' + id).innerHTML = content; //Set the inner HTML of the div with the old value in it to the new value **
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function val(vid)
{
	if (vid > 0)
	{
		var arrOptions = document.getElementById('s_' + vid).options;
		for (var i=0; i < arrOptions.length; i++)
		{
			if (arrOptions[i].selected)
			{
				var myid = arrOptions[i].value;
			}
		}
		return myid;
	}
	else
	{
		return 0;
	}
}

function show(par_id, parLink)
{
var par_id;
var parLink;
var i =  parLink;



//choice(par_id, parLink);

document.getElementById('l_' + parLink).style.display = 'none';
document.getElementById('c_' + parLink).style.display = 'block';


while (i < 4)
{
	i++;
	document.getElementById('l_' + i).style.display = 'none';
	document.getElementById('c_' + i).style.display = 'none';
	
}

//document.getElementById('c_' + nid).style.display = 'block';
//document.getElementById('l_' + id).style.display = 'none';
//document.getElementById('l_' + nid).style.display = 'none';
}

function choice(id, sid){
var par_id ;
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'category.php?id='; //This is the path to the file we just finished making
    xmlhttp.open('GET', file + id + '&sid=' + sid, true); //Open the file through GET, and add the id we want to retrieve as a GET variable
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved
                if( content != 'n' ){ //If the response was not "n" (meaning it worked)
                      //content = content.replace('y', ''); //Get rid of the y infront of our result *
                                document.getElementById('c_' + sid).innerHTML = content; //Set the inner HTML of the div with the old value in it to the new value **
								var cat = document.getElementById('o_' + id).text;
								var parLink = sid - 1;
								var parLink2 = sid;
								switch (parLink)
								{
									case 0 : par_id = 0;
									break;
									case 1 : par_id = document.ADD_GAD.s_1.options[document.ADD_GAD.s_1.selectedIndex].value;
									break;
									case 2 : par_id = document.ADD_GAD.s_2.options[document.ADD_GAD.s_2.selectedIndex].value;
									break;
									case 3 : par_id = document.ADD_GAD.s_3.options[document.ADD_GAD.s_3.selectedIndex].value;
									break;
								}
								document.getElementById('c_' + parLink2).style.display = 'block';
								document.getElementById('l_' + parLink).style.display = 'block';
								document.getElementById('c_' + parLink).style.display = 'none';
								var mylink = '<a href=javascript:show(' + par_id + ',' + parLink + ');>' + cat + '</a>';
								
								document.getElementById('l_' + parLink).innerHTML = mylink;

                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest

return;
}