<!--
// Set the default text for the status bar
window.defaultStatus = "CSComp.co.uk";

// Identify the browser DOM
var ie=document.all;
var ns6=document.getElementById;
var ns4=document.layers;

// Disable right mouse click
if (window.Event)
  document.captureEvents(Event.MOUSEUP);

function nocontextmenu() {
  event.cancelBubble = true, event.returnValue = false;

  return false;
} 

function norightclick(e) {
  if (window.Event) {
    if (e.which == 2 || e.which == 3) return false;
  }
  else if (event.button == 2 || event.button == 3) {
    event.cancelBubble = true, event.returnValue = false;
    return false;
  }
}

if (document.layers)
  document.captureEvents(Event.MOUSEDOWN);

document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
document.onmouseup = norightclick;

// Code to insert smiles at the cursor position
function insertAtCursor(myField, myValue) {
	//IE support
	if (document.selection) {
		myField.focus();
		sel = document.selection.createRange();
		sel.text = myValue;
	}
	//MOZILLA/NETSCAPE support
	else if (myField.selectionStart || myField.selectionStart == '0') {
		var startPos = myField.selectionStart;
		var endPos = myField.selectionEnd;
		myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
	} else {
		myField.value += myValue;
	}
}

// Update the broadband countdown
function update_countdown() {
		if(ns6) {
			o = document.getElementById("countdown_content");
			
			var now = new Date(); 
			var then = new Date("June 29, 2005"); 
			var gap = then.getTime() - now.getTime(); 
	
			if(gap > 0) {
				var days = Math.floor(gap / (1000 * 60 * 60 * 24));
				gap = gap - (days * 24 * 60 * 60 * 1000); 
				var hours = Math.floor(gap / (1000 * 60 * 60));
				gap = gap - (hours * 60 * 60 * 1000);
				var mins = Math.floor(gap / (1000 * 60));
				gap = gap - (mins * 60 * 1000);
				var secs = Math.floor(gap / 1000);

				var dur = "<b>" + days + " Days " + hours + " Hours " + mins + " Minutes " + secs + " Seconds</b> untill work starts on ADSL enabling my exchange";
			}
			else {
				var dur = "My exchange should now be ADSL enabled - I'd best get my connection upgraded!";
			}
			
			o.innerHTML = dur;
			
			setTimeout("update_countdown()",1000)
		}
	}

// Alternative to the mailto tag in HTML
function SendMail(Login, Server) {
	window.location.href = ("MailTo: " + Login + "@" + Server + "?Subject=Email Via WebSite (CSComp)&body=");
}
//-->