/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;/* ---------- EventDispatcher 

     Name : EventDispatcher 
     type : SSAS 
     Version : 1.0.0.0 
     Date : 2005-10-22 
     Author : ekameleon 
     URL : http://www.ekameleon.net 
     Mail : contact@ekameleon.net 

     METHODS 
      
             - addEventListener( eventName , o , f ) 
              
             - dispatchEvent(ev) 
              
             - eventListenerExists(eventName, obj, func) 
              
             - removeAllEventListeners(eventName) 
              
             - removeEventListener(eventName, o, f) 
              
             - updateEvent(eventName, oInit) 

     THANKS : 
      
             Inspiration & Compatibility : GDispatcher by Grant Skinner, http://gskinner.com/ 

---------- */ 

try { 
      
     var dummy = EventDispatcher; 
      
} catch (e) { 

     // ----o Constructor 

     EventDispatcher = function() {} 
     
     EventDispatcher.prototype.version = "1.0"
              
     // ---- 

     var c = EventDispatcher ; // class 
     var p = EventDispatcher.prototype ; // prototype 

     // ----o Static Methods 

     c.initialize = function (target /*Object*/ ) { 
             if (target == undefined) return null ; 
             var attributes = [ 
                  "addEventListener"   , "dispatchEvent", "eventListenerExists" , 
                  "removeAllEventListeners" , "removeEventListener" , "updateEvent" 
             ] ; 
             var i = new EventDispatcher ; 
             var l = attributes.length ; 
             while(--l > -1) { 
                   var prop = attributes[ l ] ; 
                  target [prop] = i[prop] ; 
             } 
     } 

     c.toString = function() /*String*/ { 
             return "[EventDispatcher]" ; 
     } 

     // -----o Private Properties 

     p._listeners = null ; 
      
     // -----o Private Methods 

     p.addEventListener = function ( eventName /*String*/ , obj /*Object*/, func ) /*Void*/ { 
             if (typeof(eventName) == "string") { 
                   if (this._listeners == null) this._listeners = {} ; 
                   var a = this._listeners[eventName] ; 
                   if (a == undefined) this._listeners[eventName] = a = [] ; 
                   if (EventDispatcher.indexOf( a , obj , func) == -1) { 
                        a.push( { o:obj , f:func } ) ; 
                   } 
             } 
     } 
      
     p.dispatchEvent = function ( ev /*Object*/ ) /*Void*/{
     	try{ 
             if ( typeof (ev.type) == "string") { 
                   if ( ev.type == "ALL") return ; 
                   var a ; 
                   if (ev.target == undefined) ev.target = this ; 
                   var f = this[ev.type + "_handler"] ; 
                   if (f != undefined ) f(ev) ; 
                   if( this._listeners ) a   = this._listeners[ev.type] ; 
                   if (a != undefined ) EventDispatcher.dispatch(ev.target, a, ev) ; 
                   if( this._listeners ) a   = this._listeners["ALL"] ; 
                   if (a != undefined) EventDispatcher.dispatch(ev.target, a, ev) ; 
             }
     	}
     	catch( err )
     	{
     		for( var i in err )
     		{
     			trace( i + ":" +  err[i] );
     		}
     	} 
     } 
      
     p.eventListenerExists = function (eventName/*String*/, obj /*Object*/, func/*Object*/) /*Boolean*/ { 
             var a = _listeners[eventName] ; 
             if (a == undefined) return false ; 
             return (EventDispatcher.indexOf(a, obj, func) > -1) ; 
     } 

     p.removeAllEventListeners = function(eventName/*String*/) /*Void*/ { 
             if (eventName) delete this._listeners[eventName] ; 
             else delete this._listeners ; 
     } 

     p.removeEventListener = function ( eventName /*String*/ , obj /*Object*/ , func /*Object*/ ) /*Void*/ { 
             var a = this._listeners[eventName] ; 
             if (a == undefined) return ; 
             var id = EventDispatcher.indexOf(a, obj, func) ; 
             if (id > -1) a.splice(id, 1) ; 
     } 
      
     p.updateEvent = function ( eventName/*String*/, oInit/*Object*/) /*Void*/ { 
             var ev = {} ; 
             ev.dynamic = true ; 
             ev.type = eventName ; 
             ev.target = this ; 
             if ( oInit != undefined ) for (var each in oInit) ev[each] = oInit[each] ; 
             this.dispatchEvent( ev ) ; 
     } 

     // ----o Static Private Methods 
      
     c.dispatch = function ( target /*Object*/ , a /*Array*/ , ev /*Object*/ ) /*Void*/ { 
             for (var each in a) { 
                   var item = a[each] ; 
                   var o = item.o ; 
                   var f = item.f ; 
                   var tof = typeof(o) ; 
                   if (tof == "object") { 
                        if (f instanceof Function) { 
                             var f = Proxy.create(o, f) ; 
                             if (f != undefined) f(ev) ; 
                        } else if (o["handleEvent"] != undefined && f == undefined) { 
                              o ["handleEvent"](ev) ; 
                        } else { 
                             if (f == undefined) f = ev.type ; 
                             if (typeof(f) == "string" && o[f] != undefined) { 
                                   o [f].apply(o, [ev]) ; 
                             } 
                        } 
                  }   else { // function 
                       if( o ) o.apply(target, [ev]) ; 
                   } 
             }      
      } 
      
     c.indexOf = function ( a /*Array*/ , o /*Object*/ , f /*Object*/ ) /*Number*/ { 
             var l = a.length ; 
             while (--l > -1) { 
                   var item = a[ l ] ; 
                   if (item.o == o && item.f == f) return l ; 
             } 
             return -1; 
     } 
      
     // ----o Encapsulate 

     delete c ; 
     delete p ;       
} //global js functionality required throughout site

/*
 * USE THIS function prototype $('name'); instead of document.getElementId('name');
 *
 * much shorter much better.
 */
var $ = function( id ) 
{
	return document.getElementById( id );
};

var afl = new Object(); // create a new global namespace where we can hold methods without clashing
afl.document = new Object(); // create the document subnamespace

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_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_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_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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

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 == '');
}

MM_reloadPage(true);

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

/* draws dots to the end of a string for each second that passes e.g. Calling . - Calling .. - Calling ... */

var dotTimerID;

function dotTimer( pElementId , pMessage , pNumberOfDots )
{
	var secs;	var state;	var i;	var dots = ""; var element;
	
	element = document.getElementById( pElementId );
	
	time = new Date();
	secs = time.getSeconds();
	
	for( i = 0 ; i < ( state = secs % ( pNumberOfDots + 1 ) ) ; i++ ) 
	{	
		if( state != 0 )
			dots += ".";
	}
	
	element.innerHTML = pMessage + dots;

	dotTimerID = setTimeout( "dotTimer('" + pElementId + "' , '" + pMessage + "' , " + pNumberOfDots + " )" , 1000 );
}

/**
* method replaces the value of elements of the specified name by the passed value
* @param elementName {String} The name of the elements to replace
* @param value {String} the string to place within those nodes
* @return {Boolean} Returns true if elements where replaced false if there were no elements
* @example afl.document.replaceElementsInPage( "wallet_points_available", "hello" ); // replaces the value of all  wallet_points_available with hello
*/
afl.document.replaceElementsInPage = function replaceElementsInPage( elementName, value )
{
	var myElementsCollection = document.getElementsByTagName( elementName );
	
	if( myElementsCollection.length ) // if there are any elements to replace relace them
	{
		for( var i = 0; i < myElementsCollection.length; i++ )
		{
			myElementsCollection[ i ].innerHTML = value;
		}
		
		return true; // elements were replaced send back a true
	}
	
	return false; // no elements were replaced send back a false
}

/**
* method searchs through all elements of a certain type and replaces the value of all elements that have a certain attribute
* @param elementName {String} The name of the elements to replace
* @param attributeName {String} The name of the attribute to match against
* @param attributeValue {String} The value of the attribute to match against
* @param value {String} the string to place within those nodes
* @return {Boolean} Returns true if elements where replaced false if there were no elements
* @example afl.document.replaceElementsWithAttributeValue( "div", "class", "test", "hello" ); // replaces <div class="test">fdsdfsd</div> with <div class="test">hello</hello>
*/
afl.document.replaceElementsByAttributeValue = function replaceElementsByAttributeValue( elementName, attributeName, attributeValue, value )
{
	var myElementsCollection = document.getElementsByTagName( elementName );
	
	if( myElementsCollection.length ) // if there are any elements to replace relace them
	{
		for( var i = 0; i < myElementsCollection.length; i++ )
		{
			if( myElementsCollection[ i ].getAttribute( attributeName ) == attributeValue  )
			{
			    myElementsCollection[ i ].innerHTML = value;
			}
		}
		
		return true; // elements were replaced send back a true
	}
	
	return false; // no elements were replaced send back a false
}


function in_array(needle, haystack, strict) {
     var found = false, key, strict = !!strict;
 
    for (key in haystack) {
        if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
            found = true;
            break;
        }
    }
 
    return found;
}/***********************************************
* Cool DHTML tooltip script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
*************************************
STEPHEN ROWE - HACKED THIS TO PIECES FOR MY OWN USE - THANKS TO DYNAMICDRIVE.COM FOR THE INITIAL START

**********/

var offsetxpoint=10 //Customize x offset of tooltip
var offsetypoint=0 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var showBox=false;
if (ie||ns6)
{
	var boxObj = document.all ? document.all['boxover'] : (document.getElementById ? document.getElementById('boxover') : '');
}

var timeOutId;

var data = new Array();


function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function addElementBefore(node,tag,id,htm)
  {
    var ne = document.createElement(tag);
    if(id) ne.id = id;
    if(htm) ne.innerHTML = htm;
    node.parentNode.insertBefore(ne,node);
  }

  function addElementAfter(node,tag,id,htm)
  {
    var ne = document.createElement(tag);
    if(id) ne.id = id;
    if(htm) ne.innerHTML = htm;
    node.parentNode.insertBefore(ne,node.nextSibling);
  }


function addElement(parent, elementType, elementId) {
	if(!document.getElementById(elementId))
  	{
  		var pEl = document.getElementById(parent);
  		var nEl = document.createElement(elementType);
  		nEl.setAttribute('id',elementId);
  		pEl.appendChild(nEl);
  	}
}

function addAttribute(element, attrName, attrValue)
{
	 element.setAttribute(attrName, attrValue);
}

function removeElement(parent,elementId) {
	if(document.getElementById(elementId))
  	{
 		var pEl = document.getElementById(parent);
  		var nEl = document.getElementById(elementId);
  		pEl.removeChild(nEl);
  	}
}

function removeAllChildren(parent)
{
	var p = document.getElementById(parent);
	if (p)
	{
		while( p.hasChildNodes() ) { p.removeChild( p.lastChild ); }
	}
}

function encodeHtml(val) {
     encodedHtml = escape(val);
     encodedHtml = encodedHtml.replace(/\//g,"%2F");
     encodedHtml = encodedHtml.replace(/\?/g,"%3F");
     encodedHtml = encodedHtml.replace(/=/g,"%3D");
     encodedHtml = encodedHtml.replace(/&/g,"%26");
     encodedHtml = encodedHtml.replace(/@/g,"%40");
     return unescape(encodedHtml);
   } 

function setBox(id,data, obj){
	//find the boxover object and prepare its position	
	boxObj = document.getElementById(id); 

	//set the events
	if(ns6)
		document.captureEvents(Event.MOUSEMOVE);
			
	obj.onmousemove=positionBox;
	
	//don't build the data till time is up
	BOtimeOutId = window.setTimeout(function() { setData(data); }, 700);

}

function init(id,data, obj)
{
	//find the boxover object and prepare its position	
	boxObj = document.getElementById(id); 
	
	//set the events
	if(ns6)
	{
		document.captureEvents(Event.MOUSEMOVE);
	}

	obj.onmousemove = positionBox;
	
	//don't build the data till time is up
	BOtimeOutId = window.setTimeout(function() { draw(data); }, 900);
	
}
function initOperator(id,data, obj)
{
	//find the boxover object and prepare its position	
	boxObj = document.getElementById(id); 
	//set the events
	if(ns6)
		document.captureEvents(Event.MOUSEMOVE);
			
	obj.onmousemove=positionBox;
	
	//don't build the data till time is up
	BOtimeOutId = window.setTimeout(function() { drawOperator(data); }, 900);
	
}

function setData(data)
{


	removeElement('BObodyImage', 'BObodyImage_img' );
	removeElement('BOheadText', 'BOheadText_h1' );	

	
	if (ns6||ie){

		var SPAN_OPEN = " <span class='boxoverTextTitle'>";
		var SPAN_CLOSE = "</span> ";
		var string = '';
		
		for(i=0; i< data.length; i++ ) 
		{
				
			if(data[i][0] == 'BObodyImage')
			{
				addElement(data[i][0], 'img', data[i][0] + '_img' );
				document.getElementById(data[i][0] + '_img').src = data[i][2];
			
			} 
			else if(data[i][0] == 'BOheadText')
			{
			
				addElement(data[i][0], 'h1', data[i][0] + '_h1' );
				document.getElementById(data[i][0] + '_h1').innerHTML = data[i][2];
			
			} 
			else if(data[i][0] == 'status')
			{
				string = string + data[i][2] + "<br />";
			}
			else if( data[i][1] &&  data[i][2].length > 0 && data[i][2] != ' <!-- PLACEHOLDER --> ' )
			{
				
					string = string + SPAN_OPEN + data[i][1] + SPAN_CLOSE + data[i][2] + "<br />";
									
			}
		}

		document.getElementById("BObodyText").innerHTML = string;
		 		
		showBox = true;
		
		boxObj.style.visibility="visible";

	}
}

function positionBox(e){
	
	  	var curX;
	  	var curY;

		//Had to change this as firebug shows a event is not defined 	
	  	curX = (ns6) ? e.pageX : event.clientX+ietruebody().scrollLeft;
	  	curY = (ns6) ? e.pageY : event.clientY+ietruebody().scrollTop;		
			  
       
		var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
		var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
		
		var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000		

		if( rightedge < boxObj.offsetWidth)		
			boxObj.style.left = ie? ietruebody().scrollLeft+event.clientX-boxObj.offsetWidth+"px" : window.pageXOffset+e.clientX-boxObj.offsetWidth+"px"
		else if (curX < leftedge)
			boxObj.style.left="5px"
		else
			boxObj.style.left=curX+offsetxpoint+"px"
	
		if ( bottomedge < boxObj.offsetHeight)
			boxObj.style.top=ie? ietruebody().scrollTop+event.clientY-boxObj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-boxObj.offsetHeight-offsetypoint+"px"
		else
			boxObj.style.top=curY+offsetypoint+"px"
			
		
	
}

function hideBox(id){
	window.clearTimeout(BOtimeOutId);
	if (ns6||ie){

		showBox=false;
		boxObj = document.getElementById(id);
		boxObj.style.visibility="hidden"
		boxObj.style.left="-1000px"
		boxObj.style.backgroundColor=''
		boxObj.style.width=''
	}
}
// Constants for XmlHttp status

var			REQ_UNINITIALISED = 0;
var			REQ_LOADING = 1;
var			REQ_LOADED = 2;
var			REQ_INTERACTIVE = 3;
var			REQ_COMPLETE = 4;

function AjaxRequest()
{
	
	
	this.mRequest = this.getHttpRequest();
	this.mHandlers = new Array();

	// Need to assign 'this' to a variable so we can put it into the anonymous function
	
	var self = this;
	
	this.mRequest.onreadystatechange = function()
	{
		if(	self.mHandlers[ self.mRequest.readyState ] != undefined )
		{
			for( i = 0 ; i < self.mHandlers[ self.mRequest.readyState ].length ; i++ )
			{
				self.mHandlers[ self.mRequest.readyState ][ i ]( self );				
			}
		}
	}
}

AjaxRequest.prototype.addEventListener = function( pEventType, pFunction )
{
	if(	this.mHandlers[ pEventType ] == undefined )
	{
		this.mHandlers[ pEventType ] = new Array();
	}
	
	this.mHandlers[ pEventType ].push( pFunction );
}

AjaxRequest.prototype.getHttpRequest = function()
{
	// List of Microsoft XMLHTTP versions - newest first

	var MSXML_XMLHTTP_PROGIDS = new Array
	(	'MSXML2.XMLHTTP.6.0',
		'MSXML2.XMLHTTP.5.0',
		'MSXML2.XMLHTTP.4.0',
		'MSXML2.XMLHTTP.3.0',
		'MSXML2.XMLHTTP',
		'Microsoft.XMLHTTP'
	);

	// Do we support the request natively (eg, Mozilla, Opera, Safari, Konqueror)

	if( window.XMLHttpRequest != null )
	{
		return new XMLHttpRequest();
	}
	else
	{
		// Look for a supported IE version

		for( i = 0 ; MSXML_XMLHTTP_PROGIDS.length > i ; i++ )
		{
			try
			{
				return new ActiveXObject( MSXML_XMLHTTP_PROGIDS[ i ] );
			}
			catch( e )
			{
			}
		}
	}
	
	return( null );
}


//added by Stephen Rowe to allow a loading period
/*
load_display is args for the display options
func_name is the forwarding function name
2.. = args
*/
function ajaxLoadingInit( load_display )
{

	ajaxLoadDisplay( load_display );
	
	var methodArgs = ( typeof load_display.method == 'undefined' ) ? null : load_display.method;

	if( methodArgs )
	{
		var func_name = ( typeof methodArgs.func_name == 'undefined' ) ? null : methodArgs.func_name;
		
		if( func_name )
		{		
			var newArgs = [];

		    for(var i in methodArgs )
		    	if( methodArgs[i] != func_name )
		        	newArgs.push(methodArgs[i]);

			if( window[func_name] ) window[func_name].apply( this, newArgs );
		}
	}
	
}

function ajaxLoadDisplay( load_display )
{
		
	var mType = ( typeof load_display.type == 'undefined' ) ? 'image' : load_display.type;
   	
   	var mValue = ( typeof load_display.value == 'undefined' ) ? null : load_display.value;
   	
   	var mElement = ( typeof load_display.element == 'undefined' ) ? null : load_display.element;
   	
   	var mCss = ( typeof load_display.css == 'undefined' ) ? null : load_display.css;

   	var loadResult = null;
   	var loadResultHtml = '';

        if (!mValue)
        {
            mValue = '/assets/images/loading-spiral.gif';
        }

   	if( mType && mValue && mElement )
   	{
	   	if ( mType == 'image')
	   	{
                        loadResultHtml = '<table width="100%" height="100%"><tr>'
                            + '<td style="text-align: center" valign="center"><img class="loading_ani" src="'
                            + mValue + '" /></td></tr></table>';
	   		loadResult = document.createElement('img');
	   		loadResult.src = mValue;		
	   	}
	   	else if( mType == 'text')
	   	{
	   		loadResult = document.createElement('p');
	   		loadResult.innerHTML = mValue ;

		}
	
		if( loadResult && mCss )
	   			loadResult.className = mCss;
	   	
	   		
	   	if( document.getElementById(mElement) )
	   	{
                        if (loadResultHtml)
                        {
	   		    document.getElementById( mElement ).innerHTML = loadResultHtml;
                        }
                        else
                        {
	   		    document.getElementById( mElement ).innerHTML = "";
	   		    document.getElementById( mElement ).appendChild(loadResult);

                        }
	   	}
	   		
   	}
}

