function opacity(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } function shiftOpacity(id, millisec) { //if an element is invisible, make it visible, else make it ivisible if(document.getElementById(id).style.opacity == 0) { opacity(id, 0, 100, millisec); } else { opacity(id, 100, 0, millisec); } } function blendimage(divid, imageid, imagefile, millisec) { var speed = Math.round(millisec / 100); var timer = 0; //set the current image as background document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; //make image transparent changeOpac(0, imageid); //make new image document.getElementById(imageid).src = imagefile; //fade in image for(i = 0; i <= 100; i++) { setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); timer++; } } function blendHTML(divid, divHTML, millisec) { var speed = Math.round(millisec / 100); var timer = 0; //set the current image as background //make image transparent changeOpac(0, divid); //fade in image for(i = 100; i > 0; i--) { setTimeout("changeOpac(" + i + ",'" + divid + "')",(timer * speed)); timer++; } setTimeout("document.getElementById('" + divid + "').innerHTML = '" + divHTML + "'",(timer * speed)); //fade in image for(i = 0; i <= 100; i++) { setTimeout("changeOpac(" + i + ",'" + divid + "')",(timer * speed)); timer++; } } function currentOpac(id, opacEnd, millisec) { //standard opacity is 100 var currentOpac = 100; //if the element has an opacity set, get it if(document.getElementById(id).style.opacity < 100) { currentOpac = document.getElementById(id).style.opacity * 100; } //call for the function that changes the opacity opacity(id, currentOpac, opacEnd, millisec) } function pleaseWait(thisString, thisImage) { document.getElementById('PleaseWaitText').innerHTML = thisString; document.getElementById('PleaseWaitImage').src = thisImage; var speed = Math.round(200 / 100); var timer = 0; //set the current image as background changeOpac(100, 'Container'); //fade in image for(i = 100; i > 20; i--) { setTimeout("changeOpac(" + i + ",'Container')",(timer * speed)); timer++; } timer++; document.getElementById('PleaseWait').style.visibility = 'visible'; setTimeout("flashSign('"+thisString+"')",(timer * speed)); } function flashSign(thisSign) { if (document.getElementById('PleaseWaitText').style.visibility == 'visible') { document.getElementById('PleaseWaitText').style.visibility = 'hidden'; } else { document.getElementById('PleaseWaitText').style.visibility = 'visible'; } setTimeout("flashSign('"+thisSign+"')", 500); } function clearLayer(divid) { if (document.getElementById(divid).style.visibility == 'hidden') { } else { var speed = Math.round(1000 / 100); var timer = 0; changeOpac(100, divid); //fade in image for(i = 100; i > 0; i--) { setTimeout("changeOpac(" + i + ",'" + divid + "')",(timer * speed)); timer++; } setTimeout("document.getElementById('" + divid + "').style.visibility = 'hidden'",(timer * speed)); } } function removeLayer(divid) { if (document.getElementById(divid).style.display == 'none') { } else { var speed = Math.round(1000 / 100); var timer = 0; changeOpac(100, divid); //fade in image for(i = 100; i > 0; i--) { setTimeout("changeOpac(" + i + ",'" + divid + "')",(timer * speed)); timer++; } setTimeout("document.getElementById('" + divid + "').style.display = 'none'",(timer * speed)); setTimeout("document.getElementById('" + divid + "').style.visibility = 'hidden'",(timer * speed)); } } function displayLayer(divid) { var speed = Math.round(300 / 100); var timer = 0; changeOpac(0, divid); document.getElementById(divid).style.display = 'block'; document.getElementById(divid).style.visibility = 'visible'; //fade in image for(i = 0; i < 100; i++) { setTimeout("changeOpac(" + i + ",'" + divid + "')",(timer * speed)); timer++; } } // MHC-BrochurCart Add var xmlsendMessage; var changeDiv; function addBrochure(thisID, thisDiv) { xmlsendMessage=GetXmlHttpObject(); changeDiv = thisDiv var url="/mhc_brochurecart/addbrochure.asp"; url=url+"?RecordID="+thisID+"&sid="+Math.random(); xmlsendMessage.onreadystatechange=stateaddBrochureChanged; xmlsendMessage.open("GET",url,true); xmlsendMessage.send(null); } function stateaddBrochureChanged() { checkaddBrochureState(xmlsendMessage, changeDiv); } function checkaddBrochureState(thisXML, thisID) { if (thisXML.readyState == 4) { updateCart(thisID); } } // MHC-BrochurCart Remove function removeBrochure(thisID, thisDiv) { if (thisDiv == '') { changeDiv = 'CartDiv'; } else { changeDiv = thisDiv; } xmlsendMessage=GetXmlHttpObject(); var url="/mhc_brochurecart/removebrochure.asp"; url=url+"?RecordID="+thisID+"&sid="+Math.random(); xmlsendMessage.onreadystatechange=stateremoveBrochureChanged; xmlsendMessage.open("GET",url,true); xmlsendMessage.send(null); } function stateremoveBrochureChanged() { checkremoveBrochureState(xmlsendMessage, changeDiv); } function checkremoveBrochureState(thisXML, thisID) { if (thisXML.readyState == 4) { displayBrochureCart(thisID); } } var InfoFormState; InfoFormState = false; function updateCart(thisID) { var speed = Math.round(200 / 100); var timer = 0; var htmlForm; htmlForm = '
'; if (InfoFormState == false) { changeOpac(100, thisID); InfoFormState = true; for(i = 100; i > 0; i--) { setTimeout("changeOpac(" + i + ",'"+thisID+"')",(timer * speed)); timer++; } timer++; setTimeout("document.getElementById('"+thisID+"').innerHTML = '"+htmlForm+"'",(timer * speed)); timer++; setTimeout("displayBrochureCart('CartDiv')",(timer * speed)); //fade in image timer++; for(i = 0; i <= 100; i++) { setTimeout("changeOpac(" + i + ",'"+thisID+"')",(timer * speed)); timer++; } } else { document.getElementById(thisID).innerHTML = htmlForm; displayBrochureCart('CartDiv'); } } // MHC-BrochurCart display function displayBrochureCart(thisDiv) { xmlsendMessage=GetXmlHttpObject(); changeDiv = thisDiv var url="/mhc_brochurecart/brochurecart.asp?sid="+Math.random(); xmlsendMessage.onreadystatechange=statedisplayBrochureChanged; xmlsendMessage.open("GET",url,true); xmlsendMessage.send(null); } function statedisplayBrochureChanged() { checkdisplayBrochureState(xmlsendMessage, changeDiv); } function checkdisplayBrochureState(thisXML, thisID) { if (thisXML.readyState == 4) { document.getElementById(thisID).innerHTML = thisXML.responseText; } } function mhcRequestBrochures() { document.getElementById('PleaseWaitImage').style.width = '100px'; document.getElementById('PleaseWaitImage').style.height = '100px'; document.getElementById('PleaseWaitText').style.textAlign = 'left'; var thisHTML; thisHTML = '

Contact Details

'; thisHTML += '
'; thisHTML += ''; thisHTML += ''; thisHTML += ''; thisHTML += ''; thisHTML += ''; thisHTML += ''; thisHTML += ''; thisHTML += ''; thisHTML += ''; thisHTML += ''; thisHTML += '
First Name
Last Name
Email
Tel
Address
Town
County
Postcode
'; thisHTML += ''; thisHTML += '
'; document.getElementById('PleaseWaitText').innerHTML = thisHTML; var speed = Math.round(200 / 100); var timer = 0; changeOpac(100, 'Container'); //fade in image for(i = 100; i > 20; i--) { setTimeout("changeOpac(" + i + ",'Container')",(timer * speed)); timer++; } document.getElementById('PleaseWait').style.visibility = 'visible'; document.getElementById('PleaseWait').style.display = 'block'; } var NOTNULL = 0; var ISNUMERIC = 1; var ISALPHA = 2; var ISALPHANUM = 3; var ISEMAIL = 4; var ISTEL = 5; var REQD = 1; var NOTREQD = 0; var numericExp = /^[0-9]+$/; var telExp = /^[0-9\(\)\-\ \+]+$/; var alphaExp = /^[a-zA-Z]+$/; var alphanumExp = /^[0-9a-zA-Z]+$/; var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/; function lightup(imageobject, opacity){ if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5) imageobject.style.MozOpacity=opacity/100 else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4) imageobject.filters.alpha.opacity=opacity } function checkField2(thisForm, thisField, thisType, thisREQD) { var thisFieldText; thisFieldText = thisField.replace("_", " "); switch (thisType) { case NOTNULL : if (document.getElementById(thisField).value == null || document.getElementById(thisField).value.length == 0) { return '* You must complete the ' + thisFieldText + ' field!' + '\n\n'; } else { return ''; } break; case ISNUMERIC : if (thisREQD == NOTREQD && document.getElementById(thisField).value == null) { return ''; } else if (document.getElementById(thisField).value.match(numericExp)) { return ''; } else { { return '* You may only use numeric values to complete the ' + thisFieldText + ' field!' + '\n\n'; } } break; case ISTEL : if (thisREQD == NOTREQD && document.getElementById(thisField).value == null) { return ''; } else { if (document.getElementById(thisField).value.match(telExp)) { return ''; } else { return '* You may only use real telephone numbers to complete the ' + thisFieldText + ' field! e.g. +44 (01202) 123456' + '\n\n'; } } break; case ISALPHA : if (thisREQD == NOTREQD && document.getElementById(thisField).value == null) { return ''; } else { if (document.getElementById(thisField).value.match(alphaExp)) { return ''; } else { return '* You may only use alpha values to complete the ' + thisFieldText + ' field!' + '\n\n'; } } break; case ISALPHANUM : if (thisREQD == NOTREQD && document.getElementById(thisField).value == null) { return ''; } else { if (document.getElementById(thisField).value.match(alphanumExp)) { return ''; } else { return '* You may only use alphanumeric values to complete the ' + thisFieldText + ' field!' + '\n\n'; } } break; case ISEMAIL : if (thisREQD == NOTREQD && document.getElementById(thisField).value == null) { return ''; } else { if (document.getElementById(thisField).value.match(emailExp)) { return ''; } else { return '*You may only use valid email addresses to complete the ' + thisFieldText + ' field!' + '\n\n'; } } break; default : return 'Error!'; }; } function checkField(thisForm, thisField, thisType, thisREQD) { var varForm = document.getElementById(thisForm); switch (thisType) { case NOTNULL : if (document.getElementById(thisField).value == null) { alert('You must complete the ' + thisField + ' field!'); return false; } else { return true; } break; case ISNUMERIC : if (thisREQD == NOTREQD && document.getElementById(thisField).value.length == 0) { return true; } else if (document.getElementById(thisField).value.match(numericExp)) { return true; } else { { alert('You may only use numeric values to complete the ' + thisField + ' field!'); return false; } } break; case ISTEL : if (thisREQD == NOTREQD && document.getElementById(thisField).value.length == 0) { return true; } else { if (document.getElementById(thisField).value.match(telExp)) { return true; } else { alert('You may only use real telephone numbers to complete the ' + thisField + ' field! e.g. +44 (01202) 123456'); return false; } } break; case ISALPHA : if (thisREQD == NOTREQD && document.getElementById(thisField).value.length == 0) { return true; } else { if (document.getElementById(thisField).value.match(alphaExp)) { return true; } else { alert('You may only use alpha values to complete the ' + thisField + ' field!'); return false; } } break; case ISALPHANUM : if (thisREQD == NOTREQD && document.getElementById(thisField).value.length == 0) { return true; } else { if (document.getElementById(thisField).value.match(alphanumExp)) { return true; } else { alert('You may only use alphanumeric values to complete the ' + thisField + ' field!'); return false; } } break; case ISEMAIL : if (thisREQD == NOTREQD && document.getElementById(thisField).value.length == 0) { return true; } else { if (document.getElementById(thisField).value.match(emailExp)) { return true; } else { alert('You may only use valid email addresses to complete the ' + thisField + ' field!'); return false; } } break; default : return false; }; } 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&&i0) if (t==1){ //fromto ma=a[i+1].split('_');if(isNaN(v)||v ma[1]/1){err=true} } else if (t==2){ rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true; } else if (t==3){ // date ma=a[i+1].split("#");at=v.match(ma[0]); if(at){ cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]]; dte=new Date(cy,cm,cd); if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true}; }else{err=true} } else if (t==4){ // time ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true} } else if (t==5){ // check this 2 if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")]; if(!o1.checked){err=true} } else if (t==6){ // the same if(v!=MM_findObj(a[i+1]).value){err=true} } } else if (!o.type&&o.length>0&&o[0].type=='radio'){ at = a[i].match(/(.*)\[(\d+)\].*/i); o2=(o.length>1)?o[at[2]]:o; if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true} if (t==2){ oo=false; for(j=0;j