<!-- Copyright © 2004-2005 by HieroWeb Interactive.
  // Put this code in the <HEAD> section of your HTML page

    function PopWidnow(url_pop)
    {
     var PopWidth=840;
     var PopHeight=540;
     var PopLeft = (window.screen.width-PopWidth)/10;
     var PopTop = (window.screen.height-PopHeight)/10;

     DyroBiz=window.open(url_pop,'DyroBiz','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
     }
     
  // javascript:PopWidnow('http://www.hiero.com/survey/TakeSurvey.asp?PageNumber=1&SurveyID=106')    

    function PopWidnow2(url_pop)
    {
     var PopWidth=480;
     var PopHeight=300;
     var PopLeft = (window.screen.width-PopWidth)/10;
     var PopTop = (window.screen.height-PopHeight)/10;

     DyroBiz=window.open(url_pop,'DyroBiz','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
     }
     
  // javascript:PopWidnow('http://www.hiero.com/survey/TakeSurvey.asp?PageNumber=1&SurveyID=106') 
  
    function PopWidnow3(url_pop)
    {
     var PopWidth=340;
     var PopHeight=250;
     var PopLeft = (window.screen.width-PopWidth)/10;
     var PopTop = (window.screen.height-PopHeight)/10;

     DyroBiz=window.open(url_pop,'DyroBiz','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
     }
     
  // javascript:PopWidnow('http://www.hiero.com/survey/TakeSurvey.asp?PageNumber=1&SurveyID=106')   
  
    function PopWidnow4(url_pop)
    {
     var PopWidth=370;
     var PopHeight=170;
     var PopLeft = (window.screen.width-PopWidth)/50;
     var PopTop = (window.screen.height-PopHeight)/50;

     DyroBiz=window.open(url_pop,'DyroBiz','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
     }
     
  // javascript:PopWidnow('http://www.hiero.com/survey/TakeSurvey.asp?PageNumber=1&SurveyID=106')   
  
    function PopWidnow5(url_pop)
    {
     var PopWidth=325;
     var PopHeight=450;
     var PopLeft = (window.screen.width-PopWidth)/50;
     var PopTop = (window.screen.height-PopHeight)/50;

     DyroBiz=window.open(url_pop,'DyroBiz','toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,width='+PopWidth+',height='+PopHeight+',top='+PopTop+',left='+PopLeft);
     }
     
  // javascript:PopWidnow('http://www.hiero.com/survey/TakeSurvey.asp?PageNumber=1&SurveyID=106')   
  
  

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//CONTACT FORM

function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
    if (dc.length > 0) {
    begin = dc.indexOf(cname);
        if (begin != -1) {
        begin += cname.length;
        end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        }
    }
return null;
}

function setCookie(name, value) {
var now = new Date();
var then = new Date(now.getTime() + 31536000000);
document.cookie = name + "=" + escape(value) +
"; expires=" + then.toGMTString() + "; path=/";
}


function getValue(element) {
var value = getCookie(element.name);
    if (value != null) element.value = value;
}

function setValue(element) {
setCookie(element.name, element.value);
}

function fixElement(element, message) {
alert(message);
element.focus();
}

function isMailReady(form) {
var passed = false;
    if (form.subject.value == "") {
    fixElement(form.subject, "Please include a subject.");
	}
    else if (form.name.value == "") {
    fixElement(form.name, "Please inlcude your name.");
    }
    else if (form.email_address.value.indexOf("@") == -1 || form.email_address.value.indexOf(".") == -1) {
    fixElement(form.email_address, "Please include a proper e-mail address.");
    }
	else if (form.body.value == "") {
    fixElement(form.body, "Please inlcude a message.");
    }
    else {
    passed = true;
    }
return passed;
}


//WEB SERVICES FORM

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&&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 && d.getElementById) x=d.getElementById(n); return x;
}

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') { num = parseFloat(val);
        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 (num<min || max<num) 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 == '');
}

// Set the horizontal and vertical position for the auto size popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}


//Check the enquiry form is filled in correctly
function CheckForm () {

	//If there is aproblem with the form then display an error
	if (document.frmInterSearch.search.value == "") {
		msg = "_________________________________________________________________\n\n";
		msg += "Your search has not been submitted because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form to Mojoe.\n";
		msg += "_________________________________________________________________\n\n";
		msg += "\n\tPlease enter at least one keyword to search for."

		alert(msg + "\n\n");

		return false;
	}

	return true;
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=310');
}

// End hiding script from old browsers -->