/*function showyear(){
	var d = new Date();
	document.write(d.getYear());
}
*/

// Move an item up or down in a select list

function combo_Move(oCombo, Cursor) {

	var iCurrent = oCombo.selectedIndex;
	
	if (Cursor > 0) Cursor = 1;
	else if (Cursor < 0) Cursor = -1;
		else Cursor = 0;

	if (iCurrent >= 0) {
	
		switch (Cursor) {
		
			case -1:
				if (iCurrent > 0) {
					combo_Swap(oCombo, iCurrent, iCurrent - 1);
					oCombo.selectedIndex = iCurrent - 1;
				} else alert('You cannot move the topmost item upwards');
				break;
		
			case 1:
				if (iCurrent < (oCombo.length-1)) {
					combo_Swap(oCombo, iCurrent, iCurrent + 1);
					oCombo.selectedIndex = iCurrent + 1;
				} else alert('You cannot move the bottommost item downwards');
				break;
	
		}

	} else alert('Please select an item to move ' + ((Cursor > 0) ? 'downwards' : 'upwards'));
}

// Swap two items in a select list

function combo_Swap(oCombo, iCurrentPos, iNewPos) {

	var sValue = oCombo[iNewPos].value;
	var sText = oCombo[iNewPos].text;
	oCombo[iNewPos].value = oCombo[iCurrentPos].value;
	oCombo[iNewPos].text = oCombo[iCurrentPos].text;
	oCombo[iCurrentPos].value = sValue;
	oCombo[iCurrentPos].text = sText;
}

var clickmessage='Copyright 2009 Thatch Music. No use without permission. Contact gary@smudge.co.za'
 function disableclick(e) {
   if (document.all) {
     if (event.button==2||event.button==3) {
       if (event.srcElement.tagName=='IMG'){ alert(clickmessage); return false; }
     }
   } else if (document.layers) {
     if (e.which == 3) { alert(clickmessage); return false; }
   } else if (document.getElementById) {
     if (e.which==3&&e.target.tagName=='IMG'){ alert(clickmessage); return false; }
   }
 }

 <!--
 //disable right-click
 var message="";
 
 function clickIE() {if (document.all) {(message);return false;}}
 function clickNS(e) {if 
 (document.layers||(document.getElementById&&!document.all)) {
 if (e.which==2||e.which==3) {(message);return false;}}}
 if (document.layers) 
 {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
 else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
 // --> 
 

document.oncontextmenu = function () {
	return false;
};

function addLoadEvent(func) {   
	var oldonload = window.onload;   
	if (typeof window.onload != 'function') {   
		window.onload = func;   
	} else {   
		window.onload = function() {   
			if (oldonload) {   
				oldonload();   
			}   
			func();   
		}   
	}   
}

function setForm() {
	frmContact.fullname.value = 'name';
	frmContact.phone.value = 'phone';
	frmContact.emailaddress.value = 'email';
	frmContact.comments.value = 'enquiry';
}
function setComments(x) {
	frmContact.comments.value = x;
}
function resetFullname() {
	frmContact.fullname.value = '';
}
function resetPhone() {
	frmContact.phone.value = '';
}
function resetEmailaddress() {
	frmContact.emailaddress.value = '';
}
function resetComments() {
	frmContact.comments.value = '';
}
function onblurFullname() {
	if (frmContact.fullname.value == 'name' || frmContact.fullname.value == '') {
		frmContact.fullname.value = 'name';
	}
}
function onblurPhone() {
	if (frmContact.phone.value == 'phone' || frmContact.phone.value == '') {
		frmContact.phone.value = 'phone';
	}
}
function onblurEmailaddress() {
	if (frmContact.emailaddress.value == 'email' || frmContact.emailaddress.value == '') {
		frmContact.emailaddress.value = 'email';
	}
}
function onblurComments() {
	if (frmContact.comments.value == 'name' || frmContact.comments.value == '') {
		frmContact.comments.value = 'enquiry';
	}
}
function checkDomain(){
	fullURL = parent.document.URL;	
	if ((fullURL.indexOf('http://www.jaguardesigns.net/') == -1) && (fullURL.indexOf('http://www.jaguardesigns.net/index.php') == -1)) {
		dn		= fullURL.substring(fullURL.indexOf('?')+4,fullURL.length);
		document.getElementById("content").innerHTML = '<p class="center">This domain has been registered for</p><h2 class="center">' + dn.replace("p://","").replace("/","") + '</h2><p class="center">For more information please click the contact us link above and complete the form</p><br><br><br><br><br><br><br><br><br><br><br><br><div id="footer" class="ScreenOnly"><div id="footer-text" class="ScreenOnly">&copy; Jaguar Designs <?php echo date("Y")?>. <a href="index.php?fuseaction=admin.home" class="adminLink">All Rights Reserved.</a></div></div>';
	}
}
