function validateIRCData() {
	Name = document.frmIRC.txtName.value;
	Channel = document.frmIRC.txtChannel.value;
	
	if(Name == "") {
		alert("Please enter a name in the text box!");
		document.frmIRC.txtName.focus();
		return;
	}
	else if(Channel == "") {
		alert("Please enter a channel in the text box!");	
		document.frmIRC.txtChannel.focus();
		return;
	}
	
	var OldName = document.frmIRC.txtChannel.value;
	OldName = OldName.replace("#","");
	OldName = OldName.replace(" ","");
	document.frmIRC.txtChannel.value = OldName;
	OldName = document.frmIRC.txtName.value;
	OldName = OldName.replace("#","");
	OldName = OldName.replace(" ","");
	document.frmIRC.txtName.value = OldName;

	// Hide the text boxes and button.
	document.frmIRC.txtName.style.display = "none";
	document.frmIRC.txtChannel.style.display = "none";
	document.frmIRC.btnJoin.style.display = "none";
	window.location = "/page.php?id=4&name=" + document.frmIRC.txtName.value +"&channel=" + document.frmIRC.txtChannel.value;
}

function selectBox(BoxID) {
	var Element = document.getElementById(BoxID);
	Element.focus();
	Element.select();
}

function displayRadioButton(Type) {
	var viewDiv = document.getElementById('radiopreview');
	var IP = document.getElementById('txtServerIP');
	var Port = document.getElementById('txtServerPort');
	viewDiv.innerHTML = "<img src=\"/image.php?IP=" + IP.value + "&Port=" + Port.value + "&type=" + Type + "\"></img><div style=\"text-align:left\"><br/>HTML Code: <textarea onClick=\"selectBox('txtHTML')\" id=\"txtHTML\"style=\"width:320px; height:46px; margin-left: 23px;\"><img src = \"http://www.vicecityonline.com/image.php?IP=" + IP.value + "&Port=" + Port.value + "&type=" + Type + "\"</img></textarea><br/>BB-Code:<input onClick=\"selectBox('txtBBOut')\" type=\"text\" size=\"50\" style=\"margin-left: 50px;\" maxlength=\"100\" id=\"txtBBOut\" value=\"[img]http://www.vicecityonline.com/image.php?IP=" + IP.value + "&Port=" + Port.value + "&type=" + Type + "[/img]\"/> <br/>Image Source:<input onClick=\"selectBox('txtSrcOut')\" type=\"text\" size=\"50\" style=\"margin-left: 8px;\" maxlength=\"100\" id=\"txtSrcOut\" value=\"http://www.vicecityonline.com/image.php?IP=" + IP.value + "&Port=" + Port.value + "&type=" + Type + "\"/> <br/></div>";
}

var dateform;
speed=1000;
len=28;
tid = 0;

var Pre;
var Post;

function dodate() {
  f.innerHTML= Pre + new Date() + Post;
  tid=window.setTimeout("dodate()",speed);
}

function start(x) {
  f=x
  tid=window.setTimeout("dodate()",speed);
}

function cleartid() {
  window.clearTimeout(tid);
}

function Clock(a,b) {
	document.write('<div id="dateform"></div>')
	start(document.getElementById("dateform"));
	Pre = a;
	Post = b;
}