// ##########################
// JavaScript Document
// Created by 101 Web Technology
// http://www.101webtech.com
// ##########################


// ###################################################################
// Global Variables, to be accessed by all the functions..
   var mydate = new Date();
   var newline = '\n';
//
//####################################################################
//
// The below function is used to write the current date on to each page.
//
//####################################################################
function date() {
	var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
	//document.write('today is ')
	document.write(mydate.getDate() + " ")
	document.write(monthname[mydate.getMonth()] + " ")
	document.write(mydate.getFullYear())
		
}

function showTxt(text) {
	if (document.getElementById) {
		showMe = document.getElementById(text);
		showMe.style.display = 'inline';
		return true
	
	}
}

function validateQuote(thisForm) {
  if (thisForm.Enquiry_Type[2].checked && thisForm.Quote_Number.value == "") {
    	alert("If you are following up an existing quote, please provide quote number if known, if not known please enter '000' into the quote number box");
		thisForm.Quote_Number.focus();
		return false;
  }
  
  if (thisForm.Contact_Phone.value == "" && thisForm.Contact_Email.value == "") {
	  	alert("Please provide us with atleast 1 point of contact, either email or phone. This enables us to contact you regarding the enquiry.");
  		thisForm.Contact_Phone.focus();
		return false;
  }	
  
  if (thisForm.Contact_Name.value == "") {
	  	alert("Please provide us with a contact name");
  		thisForm.Contact_Name.focus();
		return false;
  }	
  
  
  
return true;	
}

function popUp(theURL, name, w, h, t, l) {
	var windowName = name;
	var features = "status=yes,scrollbars=yes,resizable=yes,width="+w+",height="+h+",top="+t+",left="+l+"";
	var newWindow = window.open("", windowName, features);
	newWindow.focus();
	newWindow.location = theURL;
	
}

function buildEmail(user, form, formName, fieldName) {
	var at = "@";
	var domain = "unekefurniture.com";

	Email = user + at + domain;
	
	if (form == "n") {
		document.write('<a href=mailto:' + Email + '>' + Email + '</a>');
	} 
	
	if (form == "y") {
		getvalue=eval('document.'+formName+'.'+fieldName+'');
		getvalue.value = Email;
	}
		
}