//////////////////////////////////////////////////////////////////////////////////////////////////// function format(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + num); } //////////////////////////////////////////////////////////////////////////////////////////////////// function letternumber(e, t) { var key; var keychar; if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); keychar = keychar.toLowerCase(); if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) || (key==39) || (key==35) ||(key==46)) return true; else if ((("abcdefghijklmnopqrstuvwxyz0123456789 ").indexOf(keychar) > -1) && (t=='A')) return true; else if (((".0123456789 ").indexOf(keychar) > -1) && (t=='N')) return true; else return false; } //////////////////////////////////////////////////////////////////////////////////////////////////// d=document; ns4=(d.layers)?true:false; ns6=(navigator.userAgent.indexOf("Gecko")!=-1)?true:false; mac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false; if(ns6)mac=false; opera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false; ns61=(parseInt(navigator.productSub)>=20010726)?true:false; ie4=(!d.getElementById && d.all)?true:false; ie5p=(d.getElementById && d.all && !opera)?true:false; //////////////////////////////////////////////////////////////////////////////////////////////////// function fadein() { var ranNum= Math.round(Math.random()*21); if(ie5p) imgOne.filters[0].Apply(); document.images['imgOne'].src="i/header/"+ranNum+".jpg"; if(ie5p) imgOne.filters[0].Play(); try { var ranNum= Math.round(Math.random()*16); document.images['imgTwo'].src="aboutbg/i/"+ranNum+".jpg"; if(ie5p) imgTwo.filters[0].Play(); } catch(err) { ; } } //////////////////////////////////////////////////////////////////////////////////////////////////// function bgcolor(color, e) { if (color == '#666666') e.style.backgroundColor = ''; else e.style.backgroundColor = color; if (color != '#2F4571') e.style.color = "#FFFFFF"; if (color == '#666666') e.style.color = "#666666"; if (color == '#FFF9EE') e.style.color = "#2F4571"; } //////////////////////////////////////////////////////////////////////////////////////////////////// function NW(pn) { x_width = 806; x_height = 625; document.frmobj.target='frmobjwin'; if (pn != '') { document.frmobj.obj_array.value = pn; document.frmobj.i.value = 1; } else { document.frmobj.obj_array.value = document.frmobj.obj_array_tmp.value; document.frmobj.i.value = document.frmobj.i_tmp.value; } window.open('','frmobjwin','height='+x_height+',width='+x_width+',left=0,top=0,status=yes,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no'); } //////////////////////////////////////////////////////////////////////////////////////////////////// function SAVE(pn) { document.frmobj.obj_array.value = pn; document.frmobj.i.value = 1; } //////////////////////////////////////////////////////////////////////////////////////////////////// function MV(cur,which) { if(navigator.userAgent.indexOf('Firefox') != -1) { cur.style.MozOpacity=0.8; } strength=(which==0)? 0.8 : 1; if (cur.style.MozOpacity) cur.style.MozOpacity=strength; else if (cur.filters) cur.filters.alpha.opacity=strength*100; } //////////////////////////////////////////////////////////////////////////////////////////////////// function windowtSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { myWidth = window.innerWidth; myHeight = window.innerHeight; } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) { myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } if((slideshow_width!='') && (slideshow_height!='')) { e=document.getElementById("imgobj"); e.style.width = myWidth; e.style.height = myHeight-25; } slideshow_width=myWidth-6; slideshow_height=myHeight-25; } //////////////////////////////////////////////////////////////////////////////////////////////////// function rotateimage(){ windowtSize(); if (ie4||dom){ resetit(curcanvas); var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas); crossobj.style.zIndex++; tempobj.style.visibility="visible"; var temp='setInterval("fadepic()",50)'; dropslide=eval(temp); curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"; } else document.images.defaultslide.src=fadeimages[curimageindex]; curimageindex=(curimageindex'; nextimageindex=(nextimageindex'; if(fadeimages.length != 1) rotateimage(); } //////////////////////////////////////////////////////////////////////////////////////////////////// var IMAGE_MOVE=""; function max_min(){ window.moveTo(0,0); if(max_min_check) { if(IMAGE_MOVE == "canvas0") { dd.elements.canvas0.moveTo(0, 0); dd.elements.canvas0.setDraggable(false); } max_min_check = false; window.resizeTo(width_org+10,height_org+49); document.frmfullsceen.fullscreen.src = 'i/maximize.gif'; document.frmfullsceen.fullscreen.alt = 'Full Screen'; } else { max_min_check = true; window.resizeTo(screen.width,screen.height); document.frmfullsceen.fullscreen.src = 'i/minimize.gif'; document.frmfullsceen.fullscreen.alt = 'Original Screen'; } //////////////////////////////////////////////////////////////////////////////////////////////////// windowtSize(); try { if(fadeimages.length == 1) navigate(0); if ((IMAGE_MOVE=="") && (max_min_check) && (slideshow_width+16<=document.images.img_x.width)) { IMAGE_MOVE = "canvas0"; SET_DHTML(CURSOR_MOVE, "canvas0"); } if ((IMAGE_MOVE == "canvas0") && (max_min_check) && (slideshow_width+16<=document.images.img_x.width)) { dd.elements.canvas0.moveTo(0, 0); dd.elements.canvas0.setDraggable(true); } } catch(err) { ; } } //////////////////////////////////////////////////////////////////////////////////////////////////// function navigate(step) { if(i > 1) return false; document.frmfullsceen.previous.src = 'i/previous.gif'; document.frmfullsceen.next.src = 'i/next.gif'; if((i_tmp+step >=0) && (i_tmp+step'; else if((step==0) && (max_min_check)) crossobj.innerHTML=''; else crossobj.innerHTML=''; } //////////////////////////////////////////////////////////////////////////////////////////////////// var objPrevElement = new Object(); var objPrevElement_1 = new Object(); /////////////////////////////////////////////////////////////////////////////////////////////////// function DIVpp(show, rec) { try { if (document.getElementById('DIVpp0').className == "off") document.getElementById('DIVpp0').className="on"; else { document.getElementById('DIVpp0').className="off"; return; } } catch(err) { ; } try { document.getElementById('DIVpp1').className="off"; document.getElementById('DIVpp2').className="off"; document.getElementById('DIVpp3').className="off"; document.getElementById('DIVpp4').className="off"; document.getElementById('DIVpp5').className="off"; document.getElementById('DIVpp6').className="off"; document.getElementById('DIVpp7').className="off"; document.getElementById('DIVpp8').className="off"; document.getElementById('DIVpp9').className="off"; document.getElementById('DIVpp10').className="off"; } catch(err) { ; } try { document.getElementById(show).className="on"; if (show == "DIVpp1") document.getElementById('DIVpp1').className="on"; if (show == "DIVpp2") document.getElementById('DIVpp2').className="on"; if (show == "DIVpp3") document.getElementById('DIVpp3').className="on"; if (show == "DIVpp4") document.getElementById('DIVpp4').className="on"; if (show == "DIVpp5") document.getElementById('DIVpp5').className="on"; if (show == "DIVpp6") document.getElementById('DIVpp6').className="on"; if (show == "DIVpp7") document.getElementById('DIVpp7').className="on"; if (show == "DIVpp8") document.getElementById('DIVpp8').className="on"; if (show == "DIVpp9") document.getElementById('DIVpp9').className="on"; if (show == "DIVpp10") document.getElementById('DIVpp10').className="on"; } catch(err) { ; } objPrevElement.bgColor = "#FFFFFF"; try { objPrevElement.style.color = "#666666"; objPrevElement.style.fontWeight = "normal"; } catch(err) { ; } try { rec.bgColor = "#00B386"; rec.style.color = "#FFFFFF"; rec.style.fontWeight = "bold"; objPrevElement = rec; } catch(err) { ; } } /////////////////////////////////////////////////////////////////////////////////////////////////// function DIVpp_1(show, rec) { try { document.getElementById('DIVpp11').className="off"; document.getElementById('DIVpp22').className="off"; document.getElementById('DIVpp33').className="off"; document.getElementById('DIVpp44').className="off"; } catch(err) { ; } try { document.getElementById(show).className="on"; if (show == "DIVpp11") document.getElementById('DIVpp11').className="on"; if (show == "DIVpp22") document.getElementById('DIVpp22').className="on"; if (show == "DIVpp33") document.getElementById('DIVpp33').className="on"; if (show == "DIVpp44") document.getElementById('DIVpp44').className="on"; } catch(err) { ; } objPrevElement_1.bgColor = "#FFFFFF"; try { objPrevElement_1.style.color = "#666666"; objPrevElement_1.style.fontWeight = "normal"; } catch(err) { ; } try { rec.bgColor = "#00B386"; rec.style.color = "#FFFFFF"; rec.style.fontWeight = "bold"; objPrevElement_1 = rec; } catch(err) { ; } } /////////////////////////////////////////////////////////////////////////////////////////////////// function SubmitCheck(e) { updateRTEs(); if(e.username.value == "") { alert("Enter a username"); e.username.focus(); return false;} if(e.password.value == "") { alert("Enter a password"); e.password.focus(); return false;} if(e.retype.value == "") { alert("Retype the password"); e.retype.focus(); return false;} if(e.password.value != e.retype.value) { alert("The password and verification password do not match"); e.retype.focus(); return false;} e.submit(); } //////////////////////////////////////////////////////////////////////////////////////////////////// function checkemail(obj){ var filter=/^.+@.+\..{2,3}$/; if (filter.test(obj)) return true; else return false; } //////////////////////////////////////////////////////////////////////////////////////////////////// function frm_submit(e) { if (e==eval('document.frmenquiry')) { if (e.your_content.value=="") { e.your_content.style.backgroundColor="#FFFF00"; e.your_content.style.color="#FF0000"; e.your_content.value=" insert your enquiry"; return false; } } if ((e==eval('document.frmenquiry')) || (e==eval('document.frmnewsletter'))) { if (e.your_name.value=="") { e.your_name.style.backgroundColor="#FFFF00"; e.your_name.style.color="#FF0000"; e.your_name.value=" insert your name"; return false; } if ((e.your_email.value=="") || (!checkemail(e.your_email.value))) { e.your_email.style.backgroundColor="#FFFF00"; e.your_email.style.color="#FF0000"; e.your_email.value=" insert your email"; return false; } } e.submit(); try { e.your_name.value=""; e.your_email.value=""; e.your_tel.value=""; e.your_fax.value=""; e.your_content.value=""; } catch(err) { ; } } //////////////////////////////////////////////////////////////////////////////////////////////////// function x_onblur(obj, txt) { if(obj.value=='') obj.value = txt; } //////////////////////////////////////////////////////////////////////////////////////////////////// function x_onfocus(obj, txt) { if(obj.value==txt) { obj.style.backgroundColor="#FFFFFF"; obj.style.color="#666666"; obj.value=''; } } //////////////////////////////////////////////////////////////////////////////////////////////////// function numbers(e) { var key; var keychar; if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); keychar = keychar.toLowerCase(); // control keys if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) || (key==39) || (key==35) ||(key==46)) return true; // numbers else if ((".0123456789 ").indexOf(keychar) > -1) return true; else return false; } //////////////////////////////////////////////////////////////////////////////////////////////////// function maxlength(e, maxsize) { e.value = e.value.substring(0, maxsize); } ////////////////////////////////////////////////////////////////////////////////////////////////////