        	var http = getXMLHTTPRequest();
        	var counter;

              function getXMLHTTPRequest() {
              try {
              req = new XMLHttpRequest();
              } catch(err1) {
                try {
                req = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (err2) {
                  try {
                  req = new ActiveXObject("Microsoft.XMLHTTP");
                  } catch (err3) {
                    req = false;
                  }
                }
              }
              return req;
              }



              function getServerText() {
                var myurl = 'http://www.i7radio.com/request/aj_TimeRemain.php'; // enter the full path to the aj_TimeRemain.php path
                myRand = parseInt(Math.random()*999999999999999);
                var modurl = myurl+"?rand="+myRand;
                http.open("GET", modurl, true);
                http.onreadystatechange = useHttpResponse;
                http.send(null);
              }

              function useHttpResponse() {
                       if (http.readyState == 4) {
                  if(http.status == 200) {
                  	// parse data returned from aj_TimeRemain.php
                  	var aj_results = http.responseText.split("|");

                  	var aj_duration = aj_results[0];
                  	var aj_secsremaining = aj_results[1];
                  	var aj_title = aj_results[2];
                  	var aj_artist = aj_results[3];
        			var aj_picture = aj_results[4];

                  	// update title and artist divs

                  	document.getElementById('title').innerHTML =  aj_title;
                  	document.getElementById('artist').innerHTML =  aj_artist;
        			document.getElementById('picture').innerHTML = "<img src=http://www.i7radio.com/request/pictures/" + aj_results[4] +" width='90' height='90'>";


                    //set seconds remaining to the countdown car - adding '-0' to convert to number

                    countDownInterval = aj_secsremaining - 0;
                    countDownTime = countDownInterval + 1;
                    countDown()
                  }
                } else {
                //document. getElementById('actual').innerHTML = "";
                }
              }




            function countDown() {
              countDownTime--;
              if (countDownTime == 0) {
                countDownTime = countDownInterval;
                getServerText()
              }
              else if (countDownTime < 0)
                countDownTime = 30;
              if (document.all)
                document.all.countDownText.innerText = secsToMins(countDownTime);
              else if (document.getElementById)
                document.getElementById("countDownText").innerHTML = secsToMins(countDownTime);
              stopCountDown();
              counter = setTimeout("countDown()", 1000);
            }

            function secsToMins(theValue) {
              var theMin = Math.floor(theValue / 60);
              var theSec = (theValue % 60);
              if (theSec < 10)
                theSec = "0" + theSec;
              return(theMin + ":" + theSec);
            }

        	function stopCountDown()
        		{
        		clearTimeout(counter)
        		}
     
