﻿//the Premier ad links
var PremierAds = new Array();
PremierAds[1] = '<a href="http://atlantic-western.com/" target="_blank"><img src="webads/atlantic-western-530x125.gif" alt="Atlantic Western Realty" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[2] = '<a href="http://brookledge.com/" target="_blank"><img src="webads/brook_ledge_p.jpg" alt="Brook Ledge" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[3] = '<a href="http://jeanpierrehourdebaigt.com/" target="_blank"><img src="webads/jeanpierrehourdebaigt.jpg" alt="Jean Pierre Hourdebaigt" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[4] = '<a href="http://www.equestrianaidfoundation.org/" target="_blank"><img src="webads/equestrian_aid_foundation.gif" alt="Equestrian Aid Foundation" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[5] = '<a href="http://www.equinedentistrywithoutdrama.com/" target="_blank"><img src="webads/equine_practice.gif" alt="Equine Practice" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[6] = '<a href="http://www.artofheidiosgoodmetcalf.com" target="_blank"><img src="webads/heidi_osgood-metcalf.jpg" alt="Art of Heidi Osgood-Metcalf" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[7] = '<a href="http://www.sidelinesnews.com" target="_blank"><img src="webads/sidelines.jpg" alt="Sidelines" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[8] = '<a href="http://www.vinceremos.com" target="_blank"><img src="webads/vinceremos.gif" alt="Vinceremos" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[9] = '<a href="http://www.macmahonlaw.com" target="_blank"><img src="webads/mac_mahon_law.jpg" alt="Dermot Mac Mahon" width="530" height="125" class="premiersponsors" /></a>';
PremierAds[10] = '<a href="http://www.thebarnbook.com" target="_blank"><img src="webads/barn_book.jpg" alt="The Barn Book" width="530" height="125" class="premiersponsors" /></a>';



//the Premier ad links
var ForumPremierAds = new Array();
ForumPremierAds[1] = '<a href="http://atlantic-western.com/" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/atlantic-western-530x125.gif" alt="Atlantic Western Realty" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[2] = '<a href="http://brookledge.com/" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/brook_ledge_p.jpg" alt="Brook Ledge" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[3] = '<a href="http://jeanpierrehourdebaigt.com/" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/jeanpierrehourdebaigt.jpg" alt="Jean Pierre Hourdebaigt" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[4] = '<a href="http://www.equestrianaidfoundation.org/" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/equestrian_aid_foundation.gif" alt="Equestrian Aid Foundation" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[5] = '<a href="http://www.equinedentistrywithoutdrama.com/" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/equine_practice.gif" alt="Equine Practice" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[6] = '<a href="http://www.artofheidiosgoodmetcalf.com" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/heidi_osgood-metcalf.jpg" alt="Art of Heidi Osgood-Metcalf" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[7] = '<a href="http://www.sidelinesnews.com" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/sidelines.jpg" alt="Sidelines" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[8] = '<a href="http://www.vinceremos.com" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/vinceremos.gif" alt="Vinceremos" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[9] = '<a href="http://www.macmahonlaw.com" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/mac_mahon_law.jpg" alt="Dermot Mac Mahon" width="530" height="125" class="premiersponsors" /></a>';
ForumPremierAds[10] = '<a href="http://www.thebarnbook.com" target="_blank"><img src="http://www.wellingtonequestrianclassifieds.com/webads/barn_book.jpg" alt="The Barn Book" width="530" height="125" class="premiersponsors" /></a>';


//the featured ad links
var FeaturedAds = new Array();

FeaturedAds[1] = '<a href="http://www.lopezossorio.com.ar/" target="_blank"><img src="webads/lopez-ossorio.jpg" alt="Roberto Lopez Ossorio" width="175" height="260" class="featuredads" /></a>';

FeaturedAds[2] = '<a href="http://www.ahsajudge.com/" target="_blank"><img src="webads/ahsajudge.jpg" alt="Mark Wonderly" width="175" height="260" class="featuredads" /></a>';

FeaturedAds[3] = '<a href="http://www.bocaexecutiverealty.com/Wellington/" target="_blank"><img src="webads/boca_executive_realty.jpg" alt="Wellington Real Estate" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[4] = '<a href="http://www.dogwatchofpalmbeach.com" target="_blank"><img src="webads/dog_watch.gif" alt="Dog Watch" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[5] = '<a href="http://www.perryphotopics.com/" target="_blank"><img src="webads/perry_photo.jpg" alt="Perry Photo" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[6] = '<a href="http://www.triplecrownstudio.com/" target="_blank"><img src="webads/triplecrownstudios4.jpg" alt="Triple Crown Studio" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[7] = '<a href="http://www.kentsstables.com" target="_blank"><img src="webads/kent_book.gif" alt="Kents Stables" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[8] = '<a href="http://www.aikenhorsesonline.com" target="_blank"><img src="webads/aiken_horses.jpg" alt="Aiken Horses Online" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[9] = '<a href="http://www.ParkerFarrierService.com" target="_blank"><img src="webads/parker_farrier.jpg" alt="Parker Farrier Service" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[10] = '<a href="http://www.nancylaterdressagehorses.com" target="_blank"><img src="webads/nancy_later_dressage.jpg" alt="Nancy Later Dressage Horses" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[11] = '<a href="http://www.thefarmersdaughtergardencenter.com" target="_blank"><img src="webads/farmers_daughter.jpg" alt="The Farmers Daughter" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[12] = '<a href="http://www.wellingtonequestrianclassifieds.com/Directory.aspx?key=Eileen Gesoff&Redirect=true" target="_blank"><img src="webads/gesoff.jpg" alt="Eileen Gesoff" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[13] = '<a href="http://www.horsefuzzy.com" target="_blank"><img src="webads/joy_pritchatt.gif" alt="Joy Pritchatt" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[14] = '<a href="http://www.heads-upmedia.net" target="_blank"><img src="webads/heads-up_media.gif" alt="Heads-Up Media" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[15] = '<a href="http://www.brookledge.com" target="_blank"><img src="webads/brook_ledge_f.jpg" alt="Brook Ledge" width="175" height="260" class="featuredads" /></a>';
FeaturedAds[16] = '<a href="http://advancedprofessional.net" target="_blank"><img src="webads/apas.jpg" alt="APAS" width="175" height="260" class="featuredads" /></a>';





//use this array to keep track of which featured ads have been written out 
//already
var usedFeatured = new Array();
//we don't want number 0, so set it to used
usedFeatured[0] = 0;

// display random featured ads from the list. 
//nOutput is used to tell the function how many ads to write out
function random_featured_ads(nOutput) {
    var i;
    for (i = 0; i < nOutput; i++) {
        var bGotIt = false;
        var ry;
        while (!bGotIt) {
            ry = Math.floor(Math.random() * FeaturedAds.length);
            if (!isValueInArray(usedFeatured, ry)) {
                //got it.  put this value in the used box
                usedFeatured[i + 1] = ry;
                bGotIt = true;
            }
        }
        document.write(FeaturedAds[ry] + '<br />');
    }
}




// display all featured ads 
function all_featured_ads() {
    var i;
    for (i = 1; i <= FeaturedAds.length - 1; i++) {

        document.write(FeaturedAds[i] + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
    }
}




//use this array to keep track of which Premier ads have been written out 
//already
var usedPremier = new Array();
//we don't want number 0, so set it to used
usedPremier[0] = 0;

// display random featured ads from the list. 
//nOutput is used to tell the function how many ads to write out
function random_premier_ads(nOutput) {
    var i;
    for (i = 0; i < nOutput; i++) {
        var bGotIt = false;
        var ry;
        while (!bGotIt) {
            ry = Math.floor(Math.random() * PremierAds.length);
            if (!isValueInArray(usedPremier, ry)) {
                //got it.  put this value in the used box
                usedPremier[i + 1] = ry;
                bGotIt = true;
            }
        }
        document.write(PremierAds[ry]);
    }
}

// display random featured ads from the list. 
//nOutput is used to tell the function how many ads to write out
function random_premier_ads_for_forum(nOutput) {
    var i;
    for (i = 0; i < nOutput; i++) {
        var bGotIt = false;
        var ry;
        while (!bGotIt) {
            ry = Math.floor(Math.random() * ForumPremierAds.length);
            if (!isValueInArray(usedPremier, ry)) {
                //got it.  put this value in the used box
                usedPremier[i + 1] = ry;
                bGotIt = true;
            }
        }
        document.write(ForumPremierAds[ry]);
    }
}
// display all Premier ads
function all_premier_ads() {
    var i;
    for (i = 1; i <= PremierAds.length - 1; i++) {

        document.write(PremierAds[i] + '<br />');
    }
}

//determine if a value is in an array
function isValueInArray(arr, val) {
    inArray = false;
    for (i = 0; i < arr.length; i++)
        if (val == arr[i])
        inArray = true;
    return inArray;
}
