﻿var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
	{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
	}
	
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose;

function QuestionAnswerClear()
{
		var ClearQandA = document.getElementById("QuestionDisplay");

		document.getElementById("QuestionDisplay").innerHTML = "";
	//	ClearQandA.style.visibility="hidden";
	}

function QuestionAnswerDisplay(QandA)
{
	var Question = new Array;
	
        Question[0]="How long does it take to design a web site ?&nbsp&nbsp&nbsp&nbsp";
        Question[1]="What about hosting and a domain name ?                    ";
		Question[2]="How much will a design cost ?&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp";
		Question[3]="What information will you need from me ?                  ";
		Question[4]="Do we have to have a meeting first ?                      ";
		Question[5]="What is search engine optermisation ?                     ";
		Question[6]="Will you add my site to Google ?   &nbsp&nbsp&nbsp&nbsp   ";
		Question[7]="What is a data base and will I need one for my site ?     ";
		Question[8]="Do you use Flash animation in your website designs ?      ";
		Question[9]="Can I have a contact form and what information can I get ?";
		Question[10]="Can I have professional email addresses ?                ";
		Question[11]="Can you redesign my existing web site ?                  ";
		Question[12]="How do I update my web site or make any changes         ?";
		Question[13]="Who Owns the Web site once it has been signed off ?      ";
		Question[14]="Can you provide statistics once my site is up and running ?    ";
		Question[15]="What are the benifits of having a web site ?             ";
		
		
		               
	var Answer = new Array;

		Answer[0]="As each web design is different and planning is an important part of our designs, it is not easy to give you an exact time scale until the full extent of what is required is known.&nbsp&nbsp To give you some idea, a single page design could take 1 - 3 days while a 5 - 6 page design could 5 to 10 days. If you have important deadlines, we will do our utmost to meet your time scales where possible.";
		Answer[1]="Web hosting is your presence on the Internet.&nbsp&nbsp It is where your unique domain name is located and where your site it hosted, allowing access to your site 24/7.";
		Answer[2]="The costs of websites vary, depending on their type. We advise you to contact us first to let us know what kind of a site you want, so we can explain you what it has to contain.";
		Answer[3]="The more information you can provide the better.  Any pictures or photographs you would like to use on the web and as much text as possible.  You need to be as descriptive about the services or products you are offering, the benefits, specialities, uniqueness, etc.  We can optimise the text you provide to work with the search engines.";
		Answer[4]="This depends on what is more convenient. We could contact and disscus all the aspects of a project through emails and over the phone, but a meeting could be arranged, if nesessary.";
		Answer[5]="It is about increasing the web page ranking, building a website in a search engine-friendly way. All web pages should be 'optimised'. The use of Keywords (these are words that people type into a earch engin when looking for a site - they are words specific to your business) are essential.  There are many other methods used by webmasters in order scoring higher page rank.";
		Answer[6]="Yes once the web site has been completed we will register it will all the major search engins.";
		Answer[7]="This will depend upon the amount of information you wish to be displayed on your website. If you have many products/services, then it may be advantageous to have a database incorporated into your website design. We will discuss this in detail with you and if a database is advised we will explain in detail exactly how this will work. We can tailor your website design to suit your specific requirements.";
		Answer[8]="Yes we do use flash as and when required. It is important to note that there are times when flash animations can be an asset. However it is not always wise to flash for an entire website or pages as search engines are not able to read the content of flash and therefore any words used in animations will not be indexed by the search engines. Consequently animations are generally uased as part of a web page";
		Answer[9]="Yes we can incorporate a contact form into your web  site, and it can ask and gather any information you want to.  This information can be sent to you in a email and/or added to a data base.";
		Answer[10]="Yes you can have as many personalised email addresses as you wish.  Some of the more common ones are as follows :<br /> <br />sale@your-domain.com <br />info@your-domain.com <br />john.smith@your-domain.com ";
		Answer[11]="Yes, we can. We would be happy to hear about your new ideas and also advise you on what other additions or changes you may need.";
		Answer[12]="We can either design your web site using a Content Management System, this will allow you access to your administration areas and make updates instantly as frequently as you wish. If your website is a smaller website and designed without CMS then we can update your web site for you, our charges for this service are very reasonable.";
		Answer[13]="The website belongs to you - we give you all the access information to the server so you can view/download your web site at any time, or we can provide you with all the code/image files. Then should you wish to use another web design or web hosting company - you are completely at liberty to take this copy to them for them to use.";
		Answer[14]="yes";
		Answer[15]="24 hour marketing to an international audience. Your web site will put you heads above your competitors, even if you are starting out small, one of our professionally designed sites will give visitors the impression that you are as big, if not bigger than market leaders in your field.";

		var QuestionAnswer = document.getElementById("QuestionDisplay");
	 
		document.getElementById("QuestionDisplay").innerHTML = (Question[QandA] + "<br /><br /><br />" + Answer[QandA]) ;

		QuestionAnswer.style.visibility="visible";
}

function checkform() 
	
	{
	var ErrorLine = document.getElementById("ErrorLine");
	var ErrorMsg = document.getElementById("ErrorMsg");
	var EmailAddress = document.getElementById("EmailAddress");
	var EmailString = document.getElementById("EmailAddress").value;
	var TeleNumber = document.getElementById("TeleNumber");	
	var TelString = document.getElementById("TeleNumber").value;

		
	var Ecount = 0;
	var Ecount2 = 0;
	var ErrorString = "Sorry - can you please provide a valid";

		document.getElementById("ErrorMsg").innerHTML = "";
			
	if(document.getElementById("ContactName").value=="") {
		document.ErrorLine.src = "DottedLine-1.png";
		document.getElementById("ErrorMsg").innerHTML =  ErrorString + "<br>" + "Contact Name.";
		return false;
	}
	if(document.getElementById("CompanyName").value=="") {
		document.ErrorLine.src = "DottedLine-2.png";
		document.getElementById("ErrorMsg").innerHTML = ErrorString + "<br>" + "Company Name.";
		return false;
	}
		if (EmailAddress.value=="") {
		
			document.ErrorLine.src = "DottedLine-3.png";
			document.getElementById("ErrorMsg").innerHTML = ErrorString + "<br>" + "Email Address.";
			return false;
			}

		for (i=0;i<EmailString.length;i++) {

			if (EmailString.substr(i,1)=="@") {
			Ecount = Ecount + 1;
			}
			if (EmailString.substr(i,1)==".") {
			Ecount2 = Ecount2 + 1;
			}

		}
		
		if (Ecount != 1) {
			document.ErrorLine.src = "DottedLine-3.png";
			document.getElementById("ErrorMsg").innerHTML = ErrorString + "<br>" + "Email Address with a @.";
			return false;
			}
		if (Ecount2 < 1) {
			document.ErrorLine.src = "DottedLine-3.png";
			document.getElementById("ErrorMsg").innerHTML = ErrorString + "<br>" + "Email Address with a period.";
			return false;
			}
		if (document.getElementById("TeleNumber").value=="") {
			document.ErrorLine.src = "DottedLine-4.png";
			document.getElementById("ErrorMsg").innerHTML = ErrorString + "<br>" + "Telephone Number.";
			return false;
			}

			var y = 0;
			for (i=0; i<=TelString.length; i++) 
				{
				var x = TelString.substr(i,1);
				for (j=0; j<10; j++) {
					if (x == j) {
						y = y + 1;
					}
				}
				}
		if (y-1 != TelString.length) {
			document.ErrorLine.src = "DottedLine-4.png";
			document.getElementById("ErrorMsg").innerHTML = ErrorString + "<br>" + "Telephone Number.";
			return false;
			}

		
	else {
		document.ErrorLine.src = "DottedLine.png";
		return true;
	}
	}
	
function pause_timer(millis) 
	{
	var date = new Date();
	var curDate = null;

	do { curDate = new Date(); } 
	while(curDate-date < millis);
	} 

function ClearForm()

	{
	var ErrorLine = document.getElementById("ErrorLine");
	var ErrorMsg = document.getElementById("ErrorMsg");
	
		document.getElementById("ErrorMsg").innerHTML = "";
		document.ErrorLine.src = "DottedLine.png";
	}
	
function checklogin()				// Checks the login form to see if email correct and password has more than 8 characters
									// Email address is checked for no characters and "." and "@"
									// Password is checked for no characters and 8 or more. 
									// Returns true if all conditions OK, if email fails changes form value (text) and returns false.  If password fails returns false
	{	
		var EmailLogin = document.getElementById("EmailLogin");
		var EmailLoginstring = document.getElementById("EmailLogin").value;
		var Password = document.getElementById("Password");
		var PasswordString = document.getElementById("Password").value;

		var logincount = 0;
		var logincount2 = 0;

			if (document.getElementById("EmailLogin").value=="")
			{
			document.getElementById("EmailLogin").value = "Incorrect Email";
			return false;
			}
// Check for a '.' and '@' in email address		
			for (i=0;i<EmailLoginstring.length;i++) {

			if (EmailLoginstring.substr(i,1)=="@") {
			logincount = logincount + 1;
			}
			if (EmailLoginstring.substr(i,1)==".") {
			logincount2 = logincount2 + 1;
			}

		}
		
		if (logincount != 1) {
			document.getElementById("EmailLogin").value = "Incorrect Email";
			return false;
			}
		if (logincount2 < 1) {
			document.getElementById("EmailLogin").value = "Incorrect Email";
			return false;
			}

			if (document.getElementById("Password").value=="") 
				{
				return false;
				}
				if (PasswordString.length < 8)							// check to see if Passwword string is longer than 8 characters	
				{
				document.getElementById("Password").value = "";			// clear enetered password in form box
				return false;
				}
				return true;
		}
		
		
		
		
		
		
		
		
		
		
		
		