//----------------------------------------------------------------------------------------------------//
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
//----------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function goToURL(url) { window.location = url; }
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
//----------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//----------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//----------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//----------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
function clearBox(box) {
   if(box.value==box.defaultValue) {
	   box.value = "";
   }
 }
//----------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
/* Simple AJAX Code-Kit (SACK) v1.6.1 */
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence,
   see documentation or authors website for more details */

function sack(file) {
	this.xmlhttp = null;

	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};

	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};

	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		// prevents caching of URLString
		this.setVar("rndval", new Date().getTime());

		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}

			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}

				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;
						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}

							self.URLString = "";
							break;
					}
				};

				this.xmlhttp.send(this.URLString);
			}
		}
	};

	this.reset();
	this.createAJAX();
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
var ajax = new sack();
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function getAreaList(sel,type)
{
	var searchQuery = sel.options[sel.selectedIndex].value;
	//alert(searchQuery + ' - ' + type);	
	if(type == 'service'){
		document.getElementById('searchbox_tradesman').disabled=true;
	}else if(type == 'tradesman'){
		document.getElementById('searchbox_services').disabled=true;
	}
	if(searchQuery.length>0){
		ajax.requestFile = 'resources/searchbox_area.inc.php?search_q='+searchQuery+'&search_t='+type;	// Specifying which file to get
		ajax.onCompletion = createAreas;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function createAreas()
{
	document.getElementById('searchbox_area').options.length = 0;	// Empty area select box
	var obj = document.getElementById('searchbox_area');
	document.getElementById('searchbox_area').disabled=false;
	obj.options[obj.options.length] = new Option('Choose area...','x');
	//alert(ajax.response);	
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function doSearch(sel)
{
	var selected_area = sel.options[sel.selectedIndex].value;
	sel.options[sel.options.length] = new Option('Find a trader...','x');
	//alert(selected_area + ' - ' + type);	
	if(document.getElementById('searchbox_tradesman').disabled){
		var type = 'service';
		var classifaction_box = document.getElementById('searchbox_services');
		var selected_classifaction = classifaction_box.options[classifaction_box.selectedIndex].value;
	}else{
		var type = 'tradesman';
		var classifaction_box = document.getElementById('searchbox_tradesman');
		var selected_classifaction = classifaction_box.options[classifaction_box.selectedIndex].value;
	}
	if(selected_area.length>0 && type.length>0){
		ajax.requestFile = 'resources/ukcpa_search.inc.php?action=search&classification=' + selected_classifaction + '&area=' + selected_area + '&type=' + type;	// Specifying which file to get
		ajax.onCompletion = showSearchResults;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
		//alert('resources/ukcpa_search.inc.php?action=search&classification=' + selected_classifaction + '&area=' + selected_area + '&type=' + type);
	}
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function doPreFeedbackSearch(sel,type)
{
	if(type=='tradesman'){
		var searchQuery = sel.options[sel.selectedIndex].value;
		window.TradesmanType = type;
	}else if(type=='service'){
		var searchQuery = sel.options[sel.selectedIndex].value;
		window.TradesmanType = type;
	}
	if(searchQuery.length>0 && type.length>0){
		ajax.requestFile = 'resources/feedbacksearch_area.inc.php?search_q='+searchQuery+'&search_t='+type;	// Specifying which file to get
		ajax.onCompletion = ShowFeedbackAreas;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
		//alert('resources/ukcpa_search.inc.php?action=feedback_search&type=' + type + '&search_q=' + searchQuery);
	}
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function ShowFeedbackAreas()
{
	if(window.TradesmanType=='tradesman'){
		document.getElementById('searchfeedback_tradesman_area').options.length = 0;	// Empty area select box
		var obj = document.getElementById('searchfeedback_tradesman_area');
		document.getElementById('searchfeedback_tradesman_area').disabled=false;
		obj.options[obj.options.length] = new Option('Choose area...','x');
		//alert(ajax.response);	
		eval(ajax.response);	// Executing the response from Ajax as Javascript code	
	}else{
		document.getElementById('searchfeedback_service_area').options.length = 0;	// Empty area select box
		var obj = document.getElementById('searchfeedback_service_area');
		document.getElementById('searchfeedback_service_area').disabled=false;
		obj.options[obj.options.length] = new Option('Choose area...','x');
		//alert(ajax.response);	
		eval(ajax.response);	// Executing the response from Ajax as Javascript code	
	}
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function doFeedbackSearch(sel,type)
{
	if(type=='memnum'){
		var searchQuery = document.getElementById('member_num').value;
	}else if(type=='tradesman'){
		var obj = document.getElementById('searchfeedback_tradesman');
		var searchQuery = obj.options[obj.selectedIndex].value;

		var obj2 = document.getElementById('searchfeedback_tradesman_area');
		var area = obj2.options[obj2.selectedIndex].value;

	}else if(type=='service'){
		var obj = document.getElementById('searchfeedback_service');
		var searchQuery = obj.options[obj.selectedIndex].value;

		var obj2 = document.getElementById('searchfeedback_service_area');
		var area = obj2.options[obj2.selectedIndex].value;
	}
	if(searchQuery.length>0 && type.length>0){
		//alert(area);
		ajax.requestFile = 'resources/ukcpa_search.inc.php?action=feedback_search&type=' + type + '&search_q=' + searchQuery + '&area=' + area;	// Specifying which file to get
		ajax.onCompletion = showSearchResults;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
		//alert('resources/ukcpa_search.inc.php?action=feedback_search&type=' + type + '&search_q=' + searchQuery);
	}
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function showSearchResults()
{
	//alert(ajax.response);
	//document.getElementById('searchbox_tradesman').disabled=false;
	//document.getElementById('searchbox_tradesman').selectedIndex = 0;
	
	//document.getElementById('searchbox_services').disabled=false;
	//document.getElementById('searchbox_services').selectedIndex = 0;
	
	//document.getElementById('searchbox_area').disabled=true;
	//document.getElementById('searchbox_area').selectedIndex = 0;
	
	var ContentArea = document.getElementById('dynamic_content');
	ContentArea.innerHTML = '';
	//alert(ajax.response);
	ContentArea.innerHTML = ajax.response;	// Executing the response from Ajax as Javascript code	
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function searchmembernum()
{
	//var MemberNum = document.getElementById('business_search').value;
	//var url = 'index.php?module=trader_search&action=viewmembernum&id=' + MemberNum;
	//goToURL(url);

	var SearchQuery = document.getElementById('business_search').value;
	//alert(SearchQuery);
	if(SearchQuery.length>=3){
		ajax.requestFile = 'resources/ukcpa_search.inc.php?action=findAbusiness&search=' + SearchQuery;	// Specifying which file to get
		ajax.onCompletion = showSearchResults;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}else{
	
		alert('You must enter at least 3 characters to perform a search, please try again!');

	}

}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function ViewMemberFeedback(id,type)
{
	var url = 'resources/feedback_centre.inc.php?action=view&id=' + id + '&type=' + type;
	ajax.requestFile = url;	// Specifying which file to get
	ajax.onCompletion = DisplayMemberFeedback;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function DisplayMemberFeedback()
{
	var FeedbackContentArea = document.getElementById('feedback_content');
	FeedbackContentArea.innerHTML = '';
	//alert(ajax.response);
	FeedbackContentArea.innerHTML = ajax.response;	// Executing the response from Ajax as Javascript code	
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function GetLeaveFeedbackForm(id,type)
{
	var url = 'resources/feedback_centre.inc.php?action=leave_feedback&id=' + id + '&type=' + type;
	window.TradesmanType = type;
	ajax.requestFile = url;	// Specifying which file to get
	ajax.onCompletion = DisplayLeaveFeedbackForm;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function DisplayLeaveFeedbackForm()
{
	var FeedbackContentArea = document.getElementById('feedback_content');
	FeedbackContentArea.innerHTML = '';
	//alert(ajax.response);
	FeedbackContentArea.innerHTML = ajax.response;	// Executing the response from Ajax as Javascript code
	
	// retrieve the tradesman type
	if(window.TradesmanType=='service'){

		// is a service, init the service sliders
		initServicesSliders();

	}else{

		// is a tradesman, init the tradesman sliders
		initTradesmanSliders();

	}

}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function SendFeedbackData(id,type)
{
	// get the data user details
	var firstname_value = document.getElementById('firstname_value').value;
	var lastname_value = document.getElementById('lastname_value').value;
	var town_value = document.getElementById('town_value').value;
	var tel_value = document.getElementById('tel_value').value;
	var email_value = document.getElementById('email_value').value;
	var workdone_value = document.getElementById('workdone_value').value;
	var comments_value = document.getElementById('comments_value').value;
	
	// validate required fields
	var validated = 'yes';
	if(firstname_value == ''){
		alert('Please leave your first name!');
		validated = 'no';
	}
	if(town_value == ''){
		alert('Please state what town you are in!');
		validated = 'no';
	}
	if(email_value == ''){
		alert('Please leave your email address!');
		validated = 'no';
	}

	if(type=="service"){
		
		if(validated == 'yes'){
			// get data
			var SERVICE_value = document.getElementById('SERVICE_value').value;
			var CHOICE_value = document.getElementById('CHOICE_value').value;
			var VALUE_value = document.getElementById('VALUE_value').value;
			var STAFF_value = document.getElementById('STAFF_value').value;
	
			// set global var
			window.TradesmanType = type;
			window.TradesmanID = id;
	
			// send request to processor
			var url = 'resources/feedback_centre.inc.php?action=save_feedback&id=' + id + '&type=' + type + '&SERVICE=' + SERVICE_value + '&CHOICE=' + CHOICE_value + '&VALUE=' + VALUE_value + '&STAFF=' + STAFF_value + '&firstname_value=' + firstname_value + '&lastname_value=' + lastname_value + '&town_value=' + town_value + '&tel_value=' + tel_value + '&email_value=' + email_value + '&workdone_value=' + workdone_value + '&comments_value=' + comments_value;
			ajax.requestFile = url;	// Specifying which file to get
			ajax.onCompletion = SubmittedFeedback;	// Specify function that will be executed after file has been found
			//alert(url);
			ajax.runAJAX();		// Execute AJAX function
		}
		
	}else{

		if(validated == 'yes'){
			// get data
			var RELIABILITY_value = document.getElementById('RELIABILITY_value').value;
			var WORKMANSHIP_value = document.getElementById('WORKMANSHIP_value').value;
			var SAFETY_value = document.getElementById('SAFETY_value').value;
			var TIDYNESS_value = document.getElementById('TIDYNESS_value').value;
			var PRICES_value = document.getElementById('PRICES_value').value;
			var CUSTSERVICE_value = document.getElementById('CUSTOMERSERVICE_value').value;
	
			// set global var
			window.TradesmanType = type;
			window.TradesmanID = id;
	
			// send request to processor
			var url = 'resources/feedback_centre.inc.php?action=save_feedback&id=' + id + '&type=' + type + '&RELIABILITY=' + RELIABILITY_value + '&WORKMANSHIP=' + WORKMANSHIP_value + '&SAFETY=' + SAFETY_value + '&TIDYNESS=' + TIDYNESS_value + '&PRICES=' + PRICES_value + '&CUSTSERVICE=' + CUSTSERVICE_value + '&firstname_value=' + firstname_value + '&lastname_value=' + lastname_value + '&town_value=' + town_value + '&tel_value=' + tel_value + '&email_value=' + email_value + '&workdone_value=' + workdone_value + '&comments_value=' + comments_value;
			ajax.requestFile = url;	// Specifying which file to get
			ajax.onCompletion = SubmittedFeedback;	// Specify function that will be executed after file has been found
			//alert(url);
			ajax.runAJAX();		// Execute AJAX function
		}
		
	}
}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function SubmittedFeedback()
{
	var id = window.TradesmanID;
	var type = window.TradesmanType;

	// this will execute the alert
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	

	// now show the total feedback for this tradesman
	ViewMemberFeedback(id,type);

}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function SendEnquiry(id)
{
	var thisName = document.getElementById('EnquireYourName').value;
	var thisNumber = document.getElementById('EnquireContactNum').value;
	var thisEmail = document.getElementById('EnquireEmail').value;
	var thisComment = document.getElementById('EnquireComment').value;
	var thisWorkStart = document.getElementById('EnquireStartDate').value;
	var thisWorkEnd = document.getElementById('EnquireEndDate').value;

	if(thisNumber == '') {
		alert('Please leave a contact number!');
		document.getElementById('EnquireContactNum').focus();
		document.getElementById('EnquireContactNum').style.backgroundColor = '#FFB6C1';

	} else {

		// send request to processor
		var url = 'resources/AJAX_enquiry_sender.inc.php?action=send&id=' + id + '&name=' + thisName + '&number=' + thisNumber + '&email=' + thisEmail + '&comment=' + thisComment + '&workstart=' + thisWorkStart + '&workend=' + thisWorkEnd;
		ajax.requestFile = url;	// Specifying which file to get
		ajax.onCompletion = SubmittedEnquiry;	// Specify function that will be executed after file has been found
		//alert(url);
		ajax.runAJAX();		// Execute AJAX function

	}

}
//----------------------------------------------------------------------------------------------------//


//----------------------------------------------------------------------------------------------------//
function SubmittedEnquiry()
{
	var BigEnquiryForm = document.getElementById('BigEnquiryForm');
	BigEnquiryForm.innerHTML = '';
	//alert(ajax.response);
	BigEnquiryForm.innerHTML = ajax.response;	// Executing the response from Ajax as Javascript code
	
}
//----------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
var iframeids=["domainchecker"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

//------------------------------------------------------------------------------------------------------------//

//----------------------------------------------------------------------------------------------------//
function FindABusinessChecker()
{
	if(document.getElementById('customer_name').value == '') {
		alert('Please enter your name!');
		document.getElementById('customer_name').focus();
		document.getElementById('customer_name').style.backgroundColor = '#FFB6C1';
		return false;
	}
	if(document.getElementById('customer_email').value == '') {
		alert('Please enter your email address!');
		document.getElementById('customer_email').focus();
		document.getElementById('customer_email').style.backgroundColor = '#FFB6C1';
		return false;
	}
	if(document.getElementById('customer_contactnum').value == '') {
		alert('Please enter your contact number!');
		document.getElementById('customer_contactnum').focus();
		document.getElementById('customer_contactnum').style.backgroundColor = '#FFB6C1';
		return false;
	}
	if(document.getElementById('postcode_search').value == '') {
		alert('Please enter your postcode!');
		document.getElementById('postcode_search').focus();
		document.getElementById('postcode_search').style.backgroundColor = '#FFB6C1';
		return false;
	}
	if(document.getElementById('line1_5').value == '') {
		alert('Please type your address or search via postcode!');
		document.getElementById('line1_5').focus();
		document.getElementById('line1_5').style.backgroundColor = '#FFB6C1';
		return false;
	}
	if(document.getElementById('county').value == '') {
		alert('Please enter your county!');
		document.getElementById('county').focus();
		document.getElementById('county').style.backgroundColor = '#FFB6C1';
		return false;
	}

}
//----------------------------------------------------------------------------------------------------//
