<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function open_centred( page, name, iwidth, iheight, options )
{
	itop = (screen.height - iheight) / 2;
	ileft = (screen.width - iwidth) / 2;
	window.open( page, name, 'height=' + iheight + ',width=' + iwidth + ',top=' + itop + ',left=' +  ileft + ',' + options );
}

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.0
  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 && document.getElementById) x=document.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 MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function TheFormCheck() { 
if (document.searchdefinition.word.value=="")
{
alert("Please complete this field with a word, phrase or abbreviation");
document.searchdefinition.word.focus();return false
}
	}


//checks payment
function CheckPayment() {
//checks price
//if (document.order.price.value=="")
//{
//alert("Please ensure that you complete all of your details correctly. Please complete your preferred price range.");document.order.price.focus();
//return false
//}

//checks title
//if (document.order.title.value=="")
//{
//alert("Please ensure that you complete all of your details correctly. Please select your title from the drop down menu.");document.order.title.focus();
//return false
//}

//checks firstname
//if (document.order.firstname.value=="")
//{
//alert("Please ensure that you complete all of your details correctly. You should enter your firstname.");document.order.firstname.focus();
//return false
//}

// checks surname
//if (document.order.surname.value=="")
//{
//alert("Please ensure that you complete all of your details correctly. Please enter your surname.");document.order.surname.focus();
//return false
//}

//checks that either the phone number or email address has been completed
if (document.order.telephone.value=="" && document.order.email.value=="")
{
alert("It would be helpful if you could enter either your phone number or email address in case we need to contact you.");
document.order.telephone.focus();
return false
}

//checks that the email address is in the correct format
if (document.order.email.value!="") 
{if (document.order.email.value.indexOf("@")==-1 || document.order.email.value.indexOf(".")==-1 || document.order.email.value.indexOf(" ")!=-1 || document.order.email.value.length<6) 
{alert("Please ensure that you complete all of your details correctly. Your email address is not correct. Please re-enter.");document.order.email.focus();
return false}
}

//checks card type
if (document.order.cardtype.value=="")
{
alert("Please ensure that you complete all of your details correctly. Please select the type of card you are using from the drop down menu.");document.order.cardtype.focus();
return false
}

//checks card number
if (document.order.cardno.value.length<16)
{
alert("Please ensure that you complete all of your details correctly. Your card number is not valid. Please re-enter.");document.order.cardno.focus();
return false
}

if (document.order.cardno.value.length>25)
{
alert("Please ensure that you complete all of your details correctly. Your card number is not valid. Please re-enter.");document.order.cardno.focus();
return false
}

//checks expiry date
if (document.order.expdate.value=="")
{
alert("Please ensure that you complete all of your details correctly. You have ommitted the expiry date of your card.");document.order.expdate.focus();
return false
}

if (document.order.expdate.value!="") 
{if (document.order.expdate.value.indexOf("/")==-1 || document.order.expdate.value.length<5 || document.order.expdate.value.length>5 ) 
{alert("Please ensure that you complete all of your details correctly. You have not entered the expiry date correctly. Please complete. eg 12/00.");document.order.expdate.focus();
return false}
}

//checks firstname for delivery
if (document.order.firstname2.value=="")
{
alert("Please ensure that you complete all of your details correctly. You should enter the firstname of the person to receive the flowers.");document.order.firstname2.focus();
return false
}

// checks surname for delivery
if (document.order.surname2.value=="")
{
alert("Please ensure that you complete all of your details correctly. Please enter the surname of the person to receive the flowers.");document.order.surname2.focus();
return false
}

// checks address for delivery
if (document.order.address2.value=="")
{
alert("Please ensure that you complete all of your details correctly. Please enter the address the flowers are to be delivered to.");document.order.address2.focus();
return false
}

//checks delivery date
if (document.order.deldate.value=="")
{
alert("Please ensure that you complete all of your details correctly. You have ommitted the delivery date.");document.order.deldate.focus();
return false
}

	}

//-->
