// JavaScript Document
function ShowHigh(bannerID) {
	
	var url = "inc/ajax/highlight.php";
	var params = "show=current&bannerID="+bannerID;
	http.open("GET", url+"?"+params, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-Type", "text/html; charset=windows-1250");
    http.onreadystatechange = handleResponseShowHigh;
    http.send(null);
}


function handleResponseShowHigh() {
	
    if(http.readyState == 4){
        if(http.status == 200 && http.responseText != '') {
            var response = http.responseText;
            var update = new Array();

            if(response.indexOf('|' != -1)) {
                update = response.split('|');
				
				document.getElementById('highlightdiv').innerHTML = update[1];
				
				if(update[2]=='run') {
				
					PlayShowcase('');
				}

                eval(update[3]);
            }
        }
    }
}




function waitForShowHigh() {
  if(!document.getElementById('highlightdiv').complete) {
    setTimeout('waitForShowHigh()',10);
  }
}



function PlayShowcase(first) {

	setTimeout('NextBanner("run","'+first+'")',2000);
}



function NextBanner(action,first) {

	var url = "inc/ajax/highlight.php";
	var params = "show=next&action="+action+"&first="+first;
	http.open("GET", url+"?"+params, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-Type", "text/html; charset=windows-1250");
    http.onreadystatechange = handleResponseShowHigh;
    http.send(null);
}

