<!--
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++) if(x.src!=x.oSrc) 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]; }
}

var NS6 = (document.getElementById&&!document.all);
var IE = (document.all);
var NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4");

var State = 'AUS';
if (!States) {
  var States = null;
} //if
if (!Path) {
  var Path = '';
} //if
if (!Page) {
  var Page = '';
} //if
if (!StatePage) {
  var StatePage = false;
} //if
var map = null;
var StateLinks = new Array();
var StateLinkError = '';
var BannerRetries = 0;
var SortBy = 'Name';
var SelectedCategory = 'ALL';

var moving = setTimeout('null',1);
var movingOut = false;
var movingBack = false;
var theMenu = null;
var theRollover = null;
var RolloverImage = Path + 'images/Menu/Markers/Sub-Items/MenuArrow/highlight.gif';
var rolledOver = false;

var FlashAdsPlayed = '-';
var FirstAd = -1;

//Change PartnerLink
var PartnerLink = ''

function SetPartnerLink(UseCookie){
  var lh = location.href;
  var i = lh.indexOf('?pl=');
  var i2 = lh.length;
  if(i != -1){
	if(lh.indexOf('?',i + 1) != -1){
		i2 = lh.indexOf('?',i + 1);
	}//if
	PartnerLink = lh.substring(i + 4, i2);
	setCookie(state);
  }//if
  if(PartnerLink == '' && UseCookie == true){
	  processCookie();
	  //if(PartnerLink.indexOf('?pl=') == -1){
		//  PartnerLink = '';
	  //}//if							 
  }//if
}//function
//End Change PartnerLink

function setCookie(state) {
  var expires = new Date();

  /*
  cookie expires in one year (actually, 365 days)
  365 days in a year
  24 hours in a day
  60 minutes in an hour
  60 seconds in a minute
  1000 milliseconds in a second
  */
  expires.setTime(expires.getTime() + 365 * 24 * 60 * 60 * 1000);
  document.cookie = "State=" + state + "; expires=" + expires.toGMTString() + "; path=/";
  if (FlashAdsPlayed != '-') {
    document.cookie = "FlashAdsPlayed=" + FlashAdsPlayed + "; path=/";
  } //if
  if (FirstAd != -1) {
    document.cookie = "FirstAd=" + FirstAd + "; expires=" + expires.toGMTString() + "; path=/";
  } //if  
  //Change PartnerLink
  if (PartnerLink != ''){
	  document.cookie = "PartnerLink=" + PartnerLink + "; path=/";
  }//if
  //End Change PartnerLink  
} //function

function processCookie() {
  var dc = document.cookie;
  var dc1;
  if (dc == "" || dc == null) {
    State = 'AUS';
    setCookie(State);
  } else {
    while (dc != '') {
    if (dc.indexOf(';') != -1) {
      dc1 = dc.substring(0, dc.indexOf(';'));
    dc = dc.substring(dc.indexOf(';') + 2, dc.length);
    } else {
      dc1 = dc;
    dc = '';
    } //if
    switch (dc1.substring(0, dc1.indexOf('='))) {
      case 'State':
        State = dc1.substring(dc1.indexOf('=') + 1, dc1.length);
				//ProcessState();
      break;
    case 'FlashAdsPlayed':
      FlashAdsPlayed = dc1.substring(dc1.indexOf('=') + 1, dc1.length);
      break;
    case 'FirstAd':
      FirstAd = parseInt(dc1.substring(dc1.indexOf('=') + 1, dc1.length));
      break;
    case 'PartnerLink':
	  PartnerLink = dc1.substring(dc1.indexOf('=') + 1, dc1.length);
	  break;
    } //switch
  } //while
  } //if
}  //function

function processState() {
  var lh = location.href;
  //if (lh.indexOf(".php") == -1) {
	  if (Page == 'SelectState' || StatePage == true) {
		var canOpen = true;
		var state = '';
		if (lh == "" || lh == null || lh.indexOf('?') == -1) {
		  canOpen = false;
		} else {
		  var fileName = '/index.html';
		  if (lh.lastIndexOf('/') != -1) fileName = lh.substring(lh.lastIndexOf('/'), lh.indexOf('?'));
		  lh = lh.substring(lh.indexOf('?') + 1, lh.length);
		  if (lh.indexOf('?') == -1) {
			state = lh.substring(0, lh.length);
			canOpen = false;
		  } else {
			state = lh.substring(0, lh.indexOf('?'));
			while (lh.indexOf('?') != -1) {
			  lh = lh.substring(lh.indexOf('?') + 1, lh.length);
			  s1 = lh.substring(0, lh.indexOf('='));
			  s2 = lh.substring(lh.indexOf('=') + 1, (lh.indexOf('?') == -1 ? lh.length : lh.indexOf('?')));
	//alert('s1 = ' + s1);
			  for (i1 in States) {
				if (s1 == States[i1]) {
	//alert('About to Process ' + state + ' ' + State + ' ' + StateLinks[i1]);
				  StateLinks[i1] = s2;
	/*        } else if (s1 == 'ErrorMessage') {
				  while (s2.indexOf('-') != -1) {
			  s2 = s2.substring(0, s2.indexOf('-')) + ' ' + s2.substring(s2.indexOf('-') + 1, s2.length);
				  } //while
			StateLinkError = s2;
			break;
	*/
				} //if
			  } //for
			} //while
			if (Page == 'SelectState') {
			  setState(state);
			} else {
			  State = state;
			  setCookie(State);
			} //if
		  } //if
		} //if
		if (canOpen == false) {
		  if (state != '') {
			State = state;
			setCookie(State);
		  } //if
		  if (Page == 'SelectState') {
			alert('Page not found. Redirecting you to the ADL Software homepage.');
			openLink('index.html');
		  } else {
			Link = Page
			while (Link.indexOf('.') != -1) {
			  Link = Link.substring(0, Link.indexOf('.')) + '/' + Link.substring(Link.indexOf('.') + 1, Link.length);
			} //while		
			Link = Link + fileName;
			if (Link.toLowerCase().indexOf('adlinspect') != -1) {
			  //openStateLink('QLD', Link); //changed by EP 7/08/07
			  openStateLink('QLD', Link, 'NSW', Link, 'VIC', Link, 'SA', Link, 'TAS', Link,'WA', Link);
			} else {
			  openStateLink('QLD', Link, 'NSW', Link, 'VIC', Link, 'WA', Link);
			} //if
		  } //if
		} //if
	  } else {
		if (lh == "" || lh == null || lh.indexOf('?') == -1 /*|| lh.indexOf('.php') != -1 || lh.indexOf('/forum?') != -1 || lh.indexOf('/forum/?') != -1 || lh.substring((lh.length >= 6 ? lh.length - 6 : 0), lh.length) == '/forum' || lh.substring((lh.length >= 7 ? lh.length - 7 : 0), lh.length) == '/forum/'*/) {
		  /*if (lh.indexOf('/forum/index.php') != -1 || lh.indexOf('/forum?') != -1 || lh.indexOf('/forum/?') != -1 || lh.substring((lh.length >= 6 ? lh.length - 6 : 0), lh.length) == '/forum' || lh.substring((lh.length >= 7 ? lh.length - 7 : 0), lh.length) == '/forum/') {
			if (lh.indexOf('?c=') == -1 && lh.indexOf('?') != -1) {
			  State = lh.substring(lh.indexOf('?') + 1, lh.length);
			  if (State.indexOf('?') != -1) {
			  State = State.substring(0, State.indexOf('?'));
			  } //if
			  setCookie(State);
			openForum();
			} else if (lh.indexOf('?c=') != -1) {
			  lh = lh.substring(lh.indexOf('?c=') + 3, lh.length);
			  switch (lh) {
				case '2':
				  State = 'QLD';
				  break;
				case '3':
				  State = 'NSW';
				  break;
				case '4':
				  processCookie();
				  break;
				default:
				  openForum();
				  break;
			  } //switch
			  setCookie(State);
			} else {
			  processCookie();
			  openForum();
			} //if
		  } else {*/
		  processCookie();
		  //} //if
		} else {
		  State = lh.substring(lh.indexOf('?') + 1, lh.length);
		  if (State.indexOf('?') != -1) {
			lh = State;
			State = State.substring(0, State.indexOf('?'));
			/*if (Page == 'RealEstateInfo.WhereToGetIt') {
			  SortBy = lh.substring(lh.indexOf('?') + 1, lh.length);
			  if (SortBy.indexOf('?') != -1) {
				SelectedCategory = SortBy.substring(SortBy.indexOf('?') + 1, SortBy.length);
				SortBy = SortBy.substring(0, SortBy.indexOf('?'));
			  } //if
			} //if*/
		  } //if
		  setCookie(State);
		} //if
	  } //if
  //} else {
  //	processCookie();
  //} //if
}  //function

processState();

function moveOut(Menu, Rollover) {
  var TheMenu = MM_findObj(Menu);
  if (TheMenu != null) {
    if (theMenu != TheMenu) {
      if (IE) {
        if (theMenu != null) {
          theMenu.style.pixelLeft = -12;
          theMenu.style.visibility = 'hidden';
        } //if
        TheMenu.style.visibility = 'visible';
      } //if
      if (NS6) {
        if (theMenu != null) {
          theMenu.style.left = -12;
          theMenu.style.visibility = 'hidden';
        } //if
        TheMenu.style.visibility = 'visible';
      } //if
      if (NS) {
        if (theMenu != null) {
          theMenu.left = -12;
          theMenu.visible = false;
        } //if
        TheMenu.visible = true;
      } //if
      if (theRollover != null) {
        if (rolledOver) {
          rolledOver = false;
          theRollover.src = theRollover.oSrc;
        } //if
      } //if
      theRollover = MM_findObj(Rollover);
      theRollover.nSrc = RolloverImage;
      theRollover.oSrc = theRollover.src;
    } //if
    movingBack = false;
    theMenu = TheMenu;
    moveOut1();
  } //if
} //function

function moveOut1() {
  if ((NS && parseInt(theMenu.left) < 140) || (NS6 && parseInt(theMenu.style.left) < 140) || (IE && theMenu.style.pixelLeft < 140)) {
    movingOut = true;
    clearTimeout(moving);
    moving = setTimeout('moveOut1()', 20);
    slideMenu(11);
  } else {
    movingOut = false;
    clearTimeout(moving);
    moving = setTimeout('null', 1);
    if (movingBack) {
      moveBack();
    } else {
      if (theRollover != null && !rolledOver) {
        theRollover.oSrc = theRollover.src;
        theRollover.src = theRollover.nSrc;
        rolledOver = true;
      } //if
    } //if
  } //if
} //function

function moveBack() {
  if (theMenu != null) {
    movingBack = true;
    if (!movingOut) {
      moving = setTimeout('moveBack1()', 500);
    } //if
  } //if
} //function

function moveBack1() {
  if (movingBack) {
    if ((NS && parseInt(theMenu.left) > -9) || (NS6 && parseInt(theMenu.style.left) > -9) || (IE && theMenu.style.pixelLeft > -9)) {
      if (theRollover.src != theRollover.oSrc) {
        theRollover.src = theRollover.oSrc;
        rolledOver = false;
      } //if
      clearTimeout(moving);
      moving = setTimeout('moveBack1()', 20);
      slideMenu(-11);
    } else {
      if (IE) {
        theMenu.style.visibility = 'hidden';
        theMenu.style.pixelLeft = -12;
      } //if
      if (NS6) {
        theMenu.style.visibility = 'hidden';
        theMenu.style.left = -12;
      } //if
      if (NS) {
        theMenu.visible = false;
        theMenu.left = -12;
      } //if
      movingBack = false;
      theMenu = null;
      clearTimeout(moving);
      moving = setTimeout('null', 1);
    } //if
  } //if
} //function

function slideMenu(offset) {
  if (IE) {
    theMenu.style.pixelLeft += offset;
  } //if
  if (NS6) {
    theMenu.style.left = parseInt(theMenu.style.left) + offset;
  } //if
  if (NS) {
    theMenu.left = parseInt(theMenu.left) + offset;
  } //if
} //function

function inStates(state) {
  if (States != null) {
    for (i1 in States) {
      if (States[i1] == state || States[i1] == 'AUS') {
        return true;
      } //if
    } //for
    return false;
  } else {
    return false;
  } //if
} //function

function setState(state) {
  var selectState = false;
  var refreshPage = false;
  var oldState = State;
  if (Page == 'SelectState' || StatePage == true) {
    selectState = true;
  } else if ((inStates(State) == true && inStates(state) == false) || (inStates(state) == true && inStates(State) == false) || (inStates(State) == true && inStates(state) == true)) {
    refreshPage = true;
  } else if (!map) {
    map = MM_findObj('Australia');
  } //if
  if (state != State) {
    State = state;
    if (selectState == false && refreshPage == false) {
      map.src = Path + 'images/Menu/AustraliaMap/highlight' + state + '.gif';
    } //if
  } else if (StatePage == false) {
    State = 'AUS';
    if (selectState == false && refreshPage == false) {
      map.src = Path + 'images/Menu/AustraliaMap/normal.gif';
    } //if
  } //if
  setCookie(State);
  if (selectState == true) {
    for (i1 in States) {
      if (State == States[i1]) {
        if (!StateLinks[i1]) {
//      if (StateLinkError == '') {
//            alert('No Content found for ' + getStateDesc() + '. Please select another state to continue...');
//      } else {
//        alert(StateLinkError);
//      } //if
          alert('This product or service is not currently provided in ' + getStateDesc(State) + '. Please make a valid selection to continue.');
          State = oldState;
        } else if (Page == 'SelectState' || (Page != 'SelectState' && oldState != State)) {
          lh = location.href;
          lh = lh.substring(lh.indexOf('?') + 1, lh.length);
          lh = lh.substring(lh.indexOf('?'), lh.length);
          location.href = Path + StateLinks[i1] + '?' + State + lh;
    } //if
        break;
      } //if
    } //for
  } else if (refreshPage == true) {
    lh = location.href;
    if (lh.indexOf('?') != -1) {
      lh = lh.substring(0, lh.indexOf('?'));
    } //if
    while (lh.indexOf('/') != -1) {
      lh = lh.substring(lh.indexOf('/') + 1, lh.length);
    } //while
    location.href = lh + '?' + State;
  } else {
    map.oSrc = map.src;
    document.MM_sr = null;
  } //if
} //function

function getStateDesc() {
  if (inStates(State) == false) {
    return 'Australia';
  } else {
    return getStateDesc1();
  } //if
} //function

function getStateDesc1() {
  switch(State) {
    case 'QLD':
      return 'Queensland';
      break;
    case 'NSW':
      return 'New South Wales';
      break;
    case 'WA':
      return 'Western Australia';
      break;
    case 'SA':
      return 'South Australia';
      break;
    case 'ACT':
      return 'Australian Capital Territory';
      break;
    case 'NT':
      return 'Northern Territory';
      break;
    case 'TAS':
      return 'Tasmania';
      break;
  	case 'VIC':
    	return 'Victoria';
    	break;
    default:
      return 'Australia';
      break;
  } //switch
} //function

function getStateIndex(state) {
  for (i1 in States) {
    if (state == States[i1]) {
      return i1;
      break;
    } //if
  } //for
} //function

function openLink(path) {
  location.href = Path + path + '?' + State;
} //function

function openStateLink() {
  var args = openStateLink.arguments;
  var lh = Path + 'selectState.html?' + State;
  if (args.length > 1) {
//  var b1 = false;
    for (i1 = 0; i1 < args.length; i1 += 2) {
/*      if (State != 'AUS') {
        if (args[i1] == State) {
      if (!args[i1 + 1]) {
        alert('No content found for ' + getStateDesc() + '. Please select another state...');
      } else {
            location.href = Path + args[i1 + 1] + '?' + State;
        b1 = true;
        break;
      } //if
        } //if
    } //if
    if (b1 == false) {*/
    lh = lh + '?' + args[i1] + '=' + (args[i1 + 1] ? args[i1 + 1] : '');
//    } //if
  } //for
//  if (b1 == false) {
//    location.href = lh + '?ErrorMessage=The-ADLForms-service-is-currently-only-provided-to-Queensland-and-New-South-Wales.-Please-select-one-of-these-states-to-continue.';
//  } //if
    location.href = lh;
  } //if
} //function

function setBanner() {
  if (BannerRetries < 20) {
    if (!window.document.Banner) {
      BannerRetries = BannerRetries + 1
    BannerRetry = setTimeout('setBanner()', 100);
  } else {
    if (window.document.Banner.PercentLoaded() == 100) {
        window.document.Banner.SetVariable("section", "1");
    } else {
      BannerRetry = setTimeout('setBanner()', 100);
    } //if
  } //if
  } //if
} //function

function writeDocumentLinks(theDocument, path) {
  document.write('<font color="#333333" face="Arial, Helvetica, sans-serif" size="3"><b>\n' +
  '                         <a href="' + Path + 'documents/' + State + '/' + path + '" target="_blank">\n' +
  '                           <img border="0" src="' + Path + 'images/Adobe1.gif" width="32" height="32"><br><img border="0" src="' + Path + 'images/clear.gif" width="32" height="3"><br>' + theDocument + '\n' +
  '                         </a>\n' +
  '                       </b></font>\n');
} //function

function openForum() {
  var lh = 'http://www.adlsoftware.com/forum/index.php';
  switch (State) {
    case 'QLD':
    lh = lh + '?c=2';
    break;
  case 'NSW':
    lh = lh + '?c=3';
    break;
  default:
    lh = lh + '?c=4';
    break;
  } //switch
  location.href = lh;
} //function

function setForumState(category) {
  switch (category) {
    case 'QLD':
    if (State != 'QLD') {
      setState('QLD');
    openForum();
    } //if
    break;
  case 'NSW':
    if (State != 'NSW') {
      setState('NSW');
    openForum();
    } //if
    break;
  default:
    if (State == 'QLD' || State == 'NSW') {
        if (category.indexOf('Other') == -1) {
          setState(category);
        } else {
          setState('AUS');
        } //if
    openForum();
    } else {
        if (category.indexOf('Other') == -1) {
          setState(category);
        } else {
          setState('AUS');
        } //if
    } //if
    break;
  } //switch
} //function

var Ads = new Array();
var SecondAd = FirstAd;
var ThirdAd = FirstAd;

insertAd('REPSA Banner Ad 100329a (150x250).gif', 'http://www.repsa.com.au', true, 0, 0);
insertAd('CarterCapnerSideBanner.jpg', 'http://www.cartercapner.com.au', true, 0, 0, 'QLD', 'QLD');
insertAd('RentDotCom - Ad.png', 'http://www.rent.com.au', true, 0, 0);
insertAd('RockendBanner.gif', 'http://www.rockend.com.au', true, 0, 0);
insertAd('ra_banner1.gif', 'http://www.rentaustralia.com', true, 0, 0);
insertAd('campquality.gif', 'http://www.campquality.org.au', true, 0, 0);
insertAd('ADLInspect_Demo2.png', 'http://www.adlsoftware.com/ADLInspect/ProductInfo/Demo/ADLInspect_demo.htm', true, 0, 0);
insertAd('RhondaPenny.png', 'http://www.rhondapennylawyers.com.au', true, 0, 0, 'QLD', 'QLD');
insertAd('REDAd2.gif', 'http://www.realestatedynamics.com.au', true, 0, 0, 'QLD', 'NSW', 'NSW');
insertAd('SherlockAd.gif', 'http://www.sherlock.com.au', true, 0, 0);
insertAd('reDepot_adv.gif', 'http://www.realestatedepot.com.au', true, 0, 0);
insertAd('proptrain_ad.gif', 'http://www.propertytraining.com.au', true, 0, 0, 'QLD', 'QLD');
insertAd('rentPay.swf', 'http://www.rentpay.com.au', true, 150, 255);
insertAd('ITC.jpg', 'http://www.itc.nsw.edu.au', true, 0, 0, 'NSW', 'NSW');
insertAd('storeybrook.gif', 'http://www.storeybrook.com.au', true, 0, 0);
insertAd('legalkitspecialists_ad.gif', 'http://www.legalkitspecialists.com.au', true, 150, 300);
insertAd('YourProperty-150x250.jpg', 'http://www.yourproperty.com.au', true, 0, 0);

function insertAd(theImage, theLink, newWindow, width, height) {
  Ads[Ads.length] = new Array();
  Ads[Ads.length - 1][1] = theImage;
  Ads[Ads.length - 1][2] = theLink;
  Ads[Ads.length - 1][3] = newWindow;
  Ads[Ads.length - 1][4] = width;
  Ads[Ads.length - 1][5] = height;
  var args = insertAd.arguments;
  if (args.length > 5) {
    Ads[Ads.length - 1][6] = new Array(); //States
    for (i1 = 6; i1 <= args.length; i1++) {
      Ads[Ads.length - 1][6][i1 - 5] = args[i1];
    } //for
  } else {
    Ads[Ads.length - 1][6] = null;
  } //if
} //function

function flashAdBeenPlayed(adType) {
  var s1 = FlashAdsPlayed;
  var s2 = '';
  while (s1 != '') {
    if (s1.indexOf("|") != -1) {
      s2 = s1.substring(0, s1.indexOf("|"));
      s1 = s1.substring(s1.indexOf("|") + 2, s1.length);
    } else {
      s2 = s1;
      s1 = '';
    } //if
    if (s2 == adType) {
      Ads[Ads.length] = new Array();
      Ads[Ads.length - 1][1] = adType + ".gif";
      Ads[Ads.length - 1][2] = "javascript:openLink('ADLForms/index.html')";
      Ads[Ads.length - 1][3] = false;
      Ads[Ads.length - 1][4] = 0;
      Ads[Ads.length - 1][5] = 0;
      Ads[Ads.length - 1][6] = null;
      return true;
    } //if
  } //while
  return false;
} //function

function loadNextAds() {
  if (FirstAd >= Ads.length) {
    FirstAd = 0;
  } else {
    FirstAd++;
  } //if
  var i1, i2, i3, startAd;
  i2 = FirstAd - 1;
  startAd = FirstAd;
  for (i1 = 0; i1 <= 2; i1++) {
    if (i1 == 0 || (i1 != 0 && i2 + 1 != startAd)) {
      do {
        if (i2 == Ads.length - 1) {
          i2 = 0;
        } else {
          i2++;
        } //if
        if (Ads[i2][6] == null || State == 'AUS') {
          break;
        } else {
          var b1 = false;
          for (i3 in Ads[i2][6]) {
            if (Ads[i2][6][i3] == State) {
              b1 = true;
              break;
            } //if
          } //for
          if (b1 == true) {
            break;
          } //if
        } //if
      } while (i2 + 1 != startAd) //while
    } //if
    if (i1 == 0) {
      FirstAd = i2;
    } else if (i1 == 1) {
      if (i2 != startAd) {
        SecondAd = i2;
      } else {
        SecondAd = FirstAd;
      } //if
    } else {
      if (i2 != startAd) {
        ThirdAd = i2;
      } else {
        ThirdAd = FirstAd;
      } //if
    } //if
  } //for
} //function

function writeAd(index) {
  if (Ads[index][1].substring(Ads[index][1].length - 4, Ads[index][1].length).toUpperCase() == '.SWF') {
    document.write('' +
'         <tr><td><iframe width="' + Ads[index][4] + '" height="' + Ads[index][5] + '" src="' + Path + 'flash/Ads/' + Ads[index][1] + '" vpsace="0" hspace="0" marginheight="0" marginwidth="0" frameborder="0" scrolling="no"></iframe></td></tr>\n');
  } else {
    document.write('' +
'         <tr>\n' +
'           <td><a href="' + Ads[index][2] + '"' + (Ads[index][3] == true ? 'target="_blank"' : '') + '><img border="0" src="' + Path + 'images/Ads/' + Ads[index][1] + '" width="150"></a></td>\n' +
'         </tr>\n');
  }
}

function writeAds(adType) {
  processCookie();
  if (FlashAdsPlayed == '-') {
    FlashAdsPlayed = '';
  } //if
  if (FirstAd == -1) {
  FirstAd = Math.floor(Math.random() * (Ads.length + 1)) - 1;
  } //if
  var b1 = flashAdBeenPlayed(adType);
  loadNextAds();
  document.write('' +
'         <table width="100%" border="0" cellspacing="0" cellpadding="0">\n');
  if (b1 != true) {
//  document.write('' +
//'         <tr><td><a href="javascript:openLink(\'ADLForms/index.html\')"><img border="0" src="' + Path + 'images/Ads/' + adType + '.gif" width="150" height="320"></a></td></tr>\n');
//  } else {
    document.write('' +
'         <tr><td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="150" height="320">\n' +
'                         <param name=movie value="' + Path + 'flash/Ads/' + adType + '.swf">\n' +
'                          <param name=quality value=high>\n' +
'                          <param name=loop value=false>\n' +
'                          <embed src="' + Path + 'flash/Ads/' + adType + '.swf" quality=high loop=false pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="150" height="320">\n' +
'                          </embed>\n' +
'                    </object><br><img src="' + Path + 'images/clear.gif" width="150" height="6"><br></td></tr>\n');
    if (FlashAdsPlayed != '') {
      FlashAdsPlayed += '|' + adType;
    } else {
      FlashAdsPlayed = adType;
    } //if
  } //if
  writeAd(FirstAd);
  if (FirstAd != SecondAd) {
    document.write('' +
'         <tr><td><img src="' + Path + 'images/clear.gif" width="150" height="6"></td></tr>\n');
    writeAd(SecondAd);
  } //if
  if (FirstAd != ThirdAd && b1 == true) {
    document.write('' +
'         <tr><td><img src="' + Path + 'images/clear.gif" width="150" height="6"></td></tr>\n');
    writeAd(ThirdAd);
  } //if
  document.write('' +
'         <tr>\n' +
'                      <td><img src="' + Path + 'images/clear.gif" width="150" height="4"></td>\n' +
'         </tr>\n' +
'         <tr>\n' +
'           <td><div align="center"><font face="Arial, Helvetica, sans-serif" size="1" color="#666666">To advertise in this space please contact ADL Software</font></div></td>\n' +
'         </tr>\n' +
'         <tr>\n' +
'                      <td><img src="' + Path + 'images/clear.gif" width="150" height="7"></td>\n' +
'         </tr>\n' +
'         </table>');
  setCookie(State);
} //function

processState();
//-->