<!--

function Clear(theText) {
	if (theText.value == theText.defaultValue) {
	theText.value = ""
	}
}	

function isBlank() {
	value=document.searchform.elements['SearchString'].value;
	if ( value == "" ){
        	alert("Please enter a Business Name, Product, Service or Brand.");
        	return false;
    	}
	else if ( value == "Search for..." ){
        	alert("Please enter a Business Name, Product, Service or Brand.");
        	return false;
    	}
    	else {
    		return true;
    	}
}

function isNone() {
	value=document.Search.elements['q'].value;
	if ( value == "" ){
        	alert("Please enter a Business Name, Product, Service or Brand.");
        	return false;
    	}
    	else {
    		return true;
    	}
}



function openWindow(URL,name,features) {
	window.open(URL,name,features);
}

function closeWindow() {
	window.close();
}

function checkForm(EnquiryForm)
	{

	if (EnquiryForm.Name.value == '')
	{
		alert('Please enter your Name.');
		EnquiryForm.Name.style.background = '#FFF4C9';
		EnquiryForm.Name.focus();
		return false;
	}
	else {
		EnquiryForm.Name.style.background = '#FFFFFF';
	}

	if (EnquiryForm.Email.value == '')
	{
		alert('Please enter your Email Address.');
		EnquiryForm.Email.style.background = '#FFF4C9';
		EnquiryForm.Email.focus();
		return false;
	}
	else {
		EnquiryForm.Email.style.background = '#FFFFFF';
	}
			
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(EnquiryForm.Email.value)))
	{
		alert('Please enter a valid Email Address.');
		EnquiryForm.Email.style.background = '#FFF4C9';
		EnquiryForm.Email.focus();
		return false;
	}
	else {
		EnquiryForm.Email.style.background = '#FFFFFF';
	}
	
	alert('Thank you. Your Email will now be sent.');
	return true;
}

function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}

function checkNumber(val) {
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);

  /* Check if the keyed in character is a number
     do you want alphabetic UPPERCASE only ?
     or lower case only just check their respective
     codes and replace the 48 and 57 */

  if (cCode < 48 || cCode > 57 ) {
    var myNumber = val.value.substring(0, (strLength) - 1);
    val.value = myNumber;
  }
  return false;
}

var date = new Date();
var year = date.getFullYear();

function lastModified() {
	var date = new Date(document.lastModified);
	var day = date.getDate();
	var month = [date.getMonth() + 1];
	var year = date.getYear();
	if (day < 10) day = "0" + day;
	if (month < 10) month = "0" + month;
	if (year < 2000) year += 1900;
	document.write(day + "-" + month + "-" + year);
}

function credit() {
	document.write('<a href="http://www.gocreative.com" class="credit" target="_blank">Site powered by Gocreative<img src="/assets/images/powered_by.gif" alt="Site powered by Gocreative ContentContributor" height="11" width="135" border="0" align="texttop"></a>&nbsp;');
}

//-->
