	var showAttrib = [];
	showAttrib["BOKS"] = "brad/kickstartProfile.jpg,#fefefe";
	showAttrib["T20"] = "brad/top20Profile.jpg,#fef1cf";
	showAttrib["ST"] = "Shanon/streettalkProfile.jpg,#d2d3d6";
	showAttrib["WTTM"] = "TC/wiredProfile.jpg,#dff2f6";
	showAttrib["WU"] = "TC/ZoneProfile.jpg,#cbbf8a";
	showAttrib["QA"] = "Sandile/QandAProfile.jpg,#ffffff";
	showAttrib["_1AFR"] = "1Africa/PinnaclenewsProfile.jpg,#cad079";
	showAttrib["PS"] = "PinnSport/PinnacleSportProfile.jpg,#ffffff";
	showAttrib["SPE"] = "1Africa/PinnaclenewsProfile.jpg,#cad079";
	showAttrib["UE"] = "G/UrbanEProfile.jpg,#f1f1f1";
	showAttrib["SO"] = "G/soldOutProfile.jpg,#ffed97";
	showAttrib["TF"] = "Lee/FarmProfile.jpg,#e4d1b6";
	showAttrib["BIO"] = "Lee/BringItOnProfile.jpg,#d6d6d3";
	showAttrib["IT"] = "terence/satSportShowProfile.jpg,#cac0a1";
	showAttrib["PLS"] = "Tshego/PulseProfile.jpg,#d5d0cd";
	showAttrib["CB"] = "Tshego/continentalBProfile.jpg,#e4e1dc";
	showAttrib["EP"] = "linde/exclusiveProfile.jpg,#acbfcd";
	showAttrib["UPS"] = "Xena/UpsideProfile.jpg,#f9cbef";
	showAttrib["ACT"] = "Xena/ActivateProfile.jpg,#e1af82";
	showAttrib["1LF"] = "jonathan/1LifeProfile.jpg,#ded0b0";
	
	function encode(txt)
	{
		var output = txt.replace(/\&/g, '%26');
		output = output.replace(/\+/g, '%2B');
		output = output.replace(/\?/g,'%3F');
		output = output.replace(/\=/g,'%3D');
		output = output.replace(/\;/g,'%3B');
		output = output.replace(/\:/g,'%3A');
		output = output.replace(/\#/g,'%23');
		output = output.replace(/\$/g,'%24');
		output = output.replace(/\,/g,'%2C');
		output = output.replace(/\%/g,'%25');
		output = output.replace(/\</g,'%3C');
		output = output.replace(/\>/g,'%3E');
		output = output.replace(/\~/g,'%7E');
		
		return output;
	}
	
	function podcast(fn,sh)
	{	
		var xmlHttp = GetXmlHttpObject();
		
		if (xmlHttp == null)
		{
			alert("Your browser does not support AJAX!");	
			return
		}
		
		var url = "readPod.php";
		var params = "fn=" + fn + "&sh=" + sh;
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange = function()
		{
			if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			{
				if (xmlHttp.responseText == "FAIL") 
					window.location = "booking.php";
				else {
					//window.top.frames['podframe'].document.write(xmlHttp.responseText);
					//window.top.frames['podframe'].document.close();
					document.getElementById('podcontainer').innerHTML = xmlHttp.responseText;
				}
				
				//alert(xmlHttp.responseText);
			}	
		}

		xmlHttp.send(params);		
	}
	
	function addShout(name,message)
	{	
		var n = '';
		var m = '';
		
		if (name != '' && message != '')
		{
			n = document.getElementById(name).value;
			m = document.getElementById(message).value;
			
			document.getElementById(message).value = '';
		}
		
		var xmlHttp = GetXmlHttpObject();
		
		if (xmlHttp == null)
		{
			alert("Your browser does not support AJAX!");	
			return
		}
		
		var url = "shoutbox.php";
		var params = "n=" + encode(n) + "&m=" + encode(m);
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange = function()
		{
			if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			{
				if (xmlHttp.status == 500)
				{
					window.location = window.location;
					return;
				}
				
				if (xmlHttp.responseText != "") 
					document.getElementById('MESSAGES').innerHTML = xmlHttp.responseText;
			}
		}

		xmlHttp.send(params);
	}
	
	function addComment(id,name,message)
	{	
		var xmlHttp = GetXmlHttpObject();
		
		if (xmlHttp == null)
		{
			alert("Your browser does not support AJAX!");	
			return
		}
		
		var url = "addcomment.php";
		var params = "id=" + id + "&cn=" + encode(name) + "&ct=" + encode(message);
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange = function()
		{
			if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			{
				if (xmlHttp.responseText == "OK") 
					window.location = window.location;
				else
					document.getElementById("response").innerHTML = xmlHttp.responseText;
				
				//alert(xmlHttp.responseText);
			}	
		}
		
		xmlHttp.send(params);
	}
	
	function load()
	{	
		cycleAds();
		setInterval("addShout('','')",5000);
	}
	
	function getAnswer(array)
	{
		for (i = 0; i < array.length; i++)
		{
			if (array[i].checked == true)
				return array[i].value; 
		}
		
		return "";
	}
	
	function addHookVote(pid,idx)
	{	
		//alert(document.getElementsByName('h1').length);
		
		var val = getAnswer(document.getElementsByName('h'+idx));
		
		//alert(pid + " " + val + " ");
		
		if (pid == '' || val == '')
			return;
		
		var xmlHttp = GetXmlHttpObject();
		
		if (xmlHttp == null)
		{
			alert("Your browser does not support AJAX!");	
			return
		}
		
		var url = "addHookVote.php";
		var params = "p=" + pid + "&v=" + val;
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange = function()
		{
			if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			{
				if (xmlHttp.responseText == "FAIL") 
					window.location = "top20.php";
				else {
					document.getElementById("hook"+idx).innerHTML = xmlHttp.responseText;
				}
			}	
		}

		xmlHttp.send(params);		
	}
	
	function addBlogVote(uid)
	{	
		var val = getAnswer(document.getElementsByName('v'));
		
		if (uid == '' || val == '')
			return;
		
		var xmlHttp = GetXmlHttpObject();
		
		if (xmlHttp == null)
		{
			alert("Your browser does not support AJAX!");	
			return
		}
		
		var url = "addBlogVote.php";
		var params = "u=" + uid + "&v=" + val;
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange = function()
		{
			if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
			{
				if (xmlHttp.responseText == "OK") 
					document.getElementById("rsltBlogPoll").innerHTML = "Thank you for voting!";
				else if (xmlHttp.responseText == "FAIL") {
					document.getElementById("rsltBlogPoll").innerHTML = "ERROR: Please vote again.";
				}
				else {
					document.getElementById("rsltBlogPoll").innerHTML = xmlHttp.responseText;
				}
			}	
		}

		xmlHttp.send(params);		
	}
	
	function playVideo(fn,id)
	{
		document.getElementById("videoloader").style.display = "block";
		
		var title = "";
		
		if (fn == "video1")
			title = document.getElementById("vid1").innerHTML;
		else if (fn == "video2")
			title = document.getElementById("vid2").innerHTML;
		else if (fn == "video3")
			title = document.getElementById("vid3").innerHTML;
		else {}
		
		window.frames['videoframe'].document.location = "playVideo.php?fn=" + fn + "&t=" + escape(title);		
	}
	
	function GetXmlHttpObject()
	{
		var xmlHttp = null;
		
		try
		{
			// Firefox, Opera 8.0+, Safari
			xmlHttp = new XMLHttpRequest();
		}
		catch (e)
		{
			try
			{
				// Internet Explorer
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
			}	
			catch (e)
			{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");		
			}
		}
		
		return xmlHttp;
	}
	
	function podView(id) 
	{
		var divlist = document.getElementById('PODLIST').getElementsByTagName('div');
		
		for(var i=0;i<divlist.length;i++) {
			divlist[i].style.display = 'none';
		}
	
		document.getElementById(id).style.display = 'block';
		
		var attrib = showAttrib[id].split(',');
		
		document.getElementById('podpic').src = 'images/' + attrib[0];
		document.getElementById('podcontainer').style.backgroundColor = attrib[1];
	}

	function podClick(folder,code)
	{
		document.getElementById('podcontainer').innerHTML = "<div align=\"center\"><img style=\"margin:115px 0 0 0\" src=\"images/loading.gif\" alt=\"\" /></div>";
		
		podcast(folder,code);
		
		if (code == '') {
			switch (folder) {
				case 'Brad': code = 'BOKS'; break;
				case 'Shanon': code = 'ST'; break;
				case 'TC': code = 'WTTM'; break;
				case 'Sandile': code = 'QA'; break;
				case '1Africa': code = '_1AFR'; break;
				case 'Gerald': code = 'UE'; break;
				case 'Lee': code = 'TF'; break;
				case 'Terence': code = 'PS'; break;
				case 'Tshego': code = 'PLS'; break;
				case 'Linde': code = 'PS'; break;
				case 'Xena': code = 'UPS'; break;
				case 'Jonathan': code = '1LF'; break;
			}
		}
		
		var attrib = showAttrib[code].split(',');
		
		document.getElementById('podpic').src = 'images/' + attrib[0];
		document.getElementById('podcontainer').style.backgroundColor = attrib[1];
	}
	
	function mouseover(obj)
	{
		obj.style.opacity = 0.9;
		obj.style.filter = 'alpha(opacity=90)';
	}

	function mouseout(obj)
	{
		obj.style.opacity = 1;
		obj.style.filter = 'alpha(opacity=100)';
	}
	
	function processComment(id)
	{
		if (document.form1.cn.value != '' && document.form1.ct.value != '') 
		{
			document.getElementById('response').innerHTML = 'Processing...';
			addComment(id,escape(document.form1.cn.value),escape(document.form1.ct.value));
		}
		else
			document.getElementById('response').innerHTML = 'You must fill in all the fields before submitting.';
	}