

function vote_up(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 = 'http://www.travelagents.com.sg/vote_up.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 vote_down(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 = 'http://www.travelagents.com.sg/vote_down.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 flip_up(up,down) {
     var imgup = document.getElementById(up);
     var imgdown = document.getElementById(down);
     
     if (imgup.src.indexOf('aupgray.png') > -1) {
		 image2 = new Image();
		 image2.src = "http://www.travelagents.com.sg/images/aupmod.png";     
         imgup.src = 'http://www.travelagents.com.sg/images/aupmod.png';
         
         if (imgdown.src.indexOf('adownmod.png') > -1) {
         	imgdown.src = 'http://www.travelagents.com.sg/images/adowngray.png';	
         }
     } else {
         imgup.src = 'http://www.travelagents.com.sg/images/aupgray.png'
     }
}
 
function flip_down(up,down) {
     var imgdown = document.getElementById(down);
     var imgup = document.getElementById(up);
     
     if (imgdown.src.indexOf('adowngray.png') > -1) {
		 image4 = new Image();
		 image4.src = "http://www.travelagents.com.sg/images/adownmod.png";     
         imgdown.src = 'http://www.travelagents.com.sg/images/adownmod.png';

         if (imgup.src.indexOf('aupmod.png') > -1) {
         	imgup.src = 'http://www.travelagents.com.sg/images/aupgray.png';	
         }         
     } else {
         imgdown.src = 'http://www.travelagents.com.sg/images/adowngray.png'
     }
}


image1 = new Image();
image1.src = "http://www.travelagents.com.sg/images/aupgray.png";

image2 = new Image();
image2.src = "http://www.travelagents.com.sg/images/aupmod.png";

image3 = new Image();
image3.src = "http://www.travelagents.com.sg/images/adowngray.png";

image4 = new Image();
image4.src = "http://www.travelagents.com.sg/images/adownmod.png";


function sd(u) { document.write(u); }