function addBookmark(title,url) {
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	} 
}

function timedad728(){
	Parent = document.getElementById("topad");
	nset = document.getElementById("728set").value;
	xmlHttp = GetXmlHttpObject();
	
	var url="top728.php";
	url += "?set=" + nset;
	url += "&sid=" + Math.random();
	xmlHttp.onreadystatechange = stateChanged;
	nset.value++;

	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

	t = setTimeout( "timedad()", 25000);
}


function timedad() {
	Parent300 = document.getElementById("rtop");
	nset = document.getElementById("rtopset").value;
	xmlHttp = GetXmlHttpObject();

	var url = "toprad.php";
	url += "?set=" + nset;
	url += "&sid=" + Math.random();
	xmlHttp.onreadystatechange = stateChanged300;
	nset.value++;

	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

	t2 = setTimeout( "timedad728()", 25000);

}


function nextvids() {
	Parent = document.getElementById("showcase");
	nset = document.getElementById("vset").value;
	xmlHttp = GetXmlHttpObject();
	var url=site+"showcase2.php";
	url+="?set=" + nset;
	url+="&sid=" + Math.random();
	xmlHttp.onreadystatechange = stateChanged;
	nset.value++;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}



 function showvid(fgh){
	Parent = document.getElementById("vidc");
	xmlHttp=GetXmlHttpObject();
	var url="video.php";
	url += "?id=" + fgh;
	url += "&sid=" + Math.random();
	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}




function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	}
	
	catch (e){
		// Internet Explorer
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	    }
		
		catch (e){
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	}
	
	if (xmlHttp == null){
		alert ("Your browser does not support AJAX!");
	}
	return xmlHttp;
}

function stateChanged() {
	if (xmlHttp.readyState==4){
		tid = xmlHttp.responseText;
		Parent.innerHTML = tid;
	}
}

function stateChanged300() {
	if (xmlHttp.readyState==4){
		tid = xmlHttp.responseText;
		Parent300.innerHTML = tid;
	}
}

function nextvidsc(fdg){
	Parent = document.getElementById("showcase");
	nset = document.getElementById("vset").value;
	xmlHttp = GetXmlHttpObject();

	if (xmlHttp==null) return;
	
	var url= site + "showcase2cat.php";
	url += "?set=" + nset;
	url += "&cat=" + fdg;
	url += "&sid=" + Math.random();
	xmlHttp.onreadystatechange = stateChanged;
	nset.value++;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
