// JavaScript Document
function toggleLHN(headerid,linksid) {
	if (document.getElementById(linksid).style.display == 'none') {
		document.getElementById(linksid).style.display = 'block';
		document.getElementById(headerid+'_t').innerHTML = '-';
	}
	else {
		document.getElementById(linksid).style.display = 'none';
		document.getElementById(headerid+'_t').innerHTML = '+';
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//****** INSERT GOOGLEMAP API KEY ******
function IncludeJavaScript(jsFile) {
document.write('<script type="text/javascript" src="' + jsFile + '"></scr' + 'ipt>');
}

//*** STORE LOCATOR POSTCODE FORM VALIDATION *****
function checkInput(x) {
	var zip = x.zipcode.value; 
	if(isNaN(zip) == true) {
		alert('Please enter a valid Postcode');
		return false;
	}
	if(zip.length < 4) {
		alert('Please enter a valid Postcode');
		return false;	
	}
	return true;
}

function disableEnterKey(e) {
	var key;
	if(window.event)
    key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
		return false;
     else
          return true;
}

function more(id,type) {
	if(type == 'on') {
		element = eval('document.getElementById("learnmore_'+id+'")');
		if(element) {
			element.style.textDecoration = 'underline';		
		}
	} else if(type == 'off') {
		element = eval('document.getElementById("learnmore_'+id+'")');
		if(element) {
			element.style.textDecoration = 'none';		
		}
	}
}
