// JavaScript Document
function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }


function update_song_xml(song_id)
{
	//alert(video_id);	alert(user_name);

		var strURL="ajax/music.php?song_id="+song_id;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('song_player').innerHTML=req.responseText;						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}
				
				else
				{
					document.getElementById('song_player').innerHTML="<div align=\"center\"><img src=\"images/loading.gif\" border=\"0\" /></div>";
				}
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
}


function update_images_xml(gal_id)
{
	//alert(video_id);	alert(user_name);

		var strURL="ajax/images.php?gal_id="+gal_id;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('img_gal').innerHTML=req.responseText;						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}
				
				else
				{
					document.getElementById('img_gal').innerHTML="<div align=\"center\"><img src=\"images/loading.gif\" border=\"0\" /></div>";
				}
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
}

function video_info(video_id)
{
	//alert(video_id);	alert(user_name);

		var strURL="ajax/videos_ajax.php?video_id="+video_id;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
						document.getElementById('katevdo').innerHTML=req.responseText;						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}
				
				else
				{
					document.getElementById('katevdo').innerHTML="<div align=\"center\"><img src=\"images/loading.gif\" border=\"0\" /></div>";
				}
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
}
		
	
	
	
function tour_info(tour_id)
{
	//alert(video_id);	alert(user_name);

		var strURL="ajax/tour.php?tour_id="+tour_id;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {	
						document.getElementById('tourdiv').innerHTML=req.responseText;						
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}
				
				else
				{
					document.getElementById('tourdiv').innerHTML="<div align=\"center\"><img src=\"images/loading.gif\" border=\"0\" /></div>";
				}
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
}