// auto login for newsletter
//alert('cool');
$(document).ready(function(){
	$("#Newsletter").click(function(e) {
		//alert('cool');
		e.preventDefault();
		$("#phplist").submit();
	})
});


function dosubmit() {
     $("#phplist").submit();
}

function handleNewsletter(nDelay)
{
    //alert('submitting now...');
	$("#phplist").submit();
}

// http://james.padolsey.com/javascript/jquery-delay-plugin/
$.fn.delay = function(time, callback){
    // Empty function:
    jQuery.fx.step.delay = function(){};
    // Return meaningless animation, (will be added to queue)
    return this.animate({delay:1}, time, callback);
}

function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
		myimages[i]=new Image()
		myimages[i].src=preloadimages.arguments[i]
	}
}

//function submitBilkoForm(){
	//document.askBilkoForm.submit();
//}
function processBilkoForm(){
	//return true;
	if((((document.askBilkoForm.theName.value=="")||(document.askBilkoForm.theLocation.value=="")||(document.askBilkoForm.theEmail.value=="")||(document.askBilkoForm.theEnquiry.value=="")))){
		alert('Please fill in all required fields')
		return false;
	}
	else{
		if(document.askBilkoForm.theTel.value==""){document.askBilkoForm.theTel.value="none supplied"}
		if(document.askBilkoForm.theCompany.value==""){document.askBilkoForm.theCompany.value="none supplied"}
		return true;
	}
}

function toggle(targetId){
  if (document.getElementById){
  		target = document.getElementById(targetId);
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	}
}

// set the hidden action element in a form
function setCatThingForm(f, c, s) {
	f= document.forms[f];
	f.elements['theCat'].value= c;
	f.elements['theSub'].value= s;
	f.submit();
}

