// scripts/theme_anime.js - Copyright Doug Ashbaugh 2009
var tcImgIndex=0;
var tcPauseAutomation = false;
var tcImagesShwnCnt = 0;
var tcMaxImages = 18;
var tcMaxImageLoops = 3;
var tcAnimTimer = null;
var tcAnimTimeDelay = 3000;

function hideNormalDialog(){
    try
    {
        $("#normalDialog").dialog("close");
        $("#normalDialog").dialog("destroy");
        return(true);
    }
    catch(e)
    {
        return(false);
    }
}

function showChangePageDialog(){
    try
    {
        var msg = null;
        $('#normalDialog').dialog({
            autoOpen: false,
            modal: true,
            title: 'Navigation in progress...'
        });
        msg  = '<div  class="dialogMsgWrapper rounded">';
        msg += '<div class="dialogImage"></div>';
        msg += '<div class="dialogMsgInnerTitle">Changing Page...</div>';
        msg += '<div class="dialogMsgTxtWrapper">';
        msg += 'Thank&nbsp;you&nbsp;for&nbsp;being&nbsp;a&nbsp;valued&nbsp;member!<br><br>';
        msg += '<b>Membership is always FREE!</b><br><br>';
        msg += 'One moment please...<br>';
        msg += '</div>';
        msg += '</div>';
        $('#normalDialog').html(msg);
        $('#normalDialog').dialog('open');
        setTimeout('hideNormalDialog()', 60000); // hide in 60s if search does not complete.
        return(true);
    }
    catch(e)
    {
        return(false);
    }
}

function showChangeTopicDialog(){
    try
    {
        var msg = null;
        $('#normalDialog').dialog({
            autoOpen: false,
            modal: true,
            title: 'Navigation in progress...'
        });
        msg  = '<div  class="dialogMsgWrapper rounded">';
        msg += '<div class="dialogImage"></div>';
        msg += '<div class="dialogMsgInnerTitle">Changing Section...</div>';
        msg += '<div class="dialogMsgTxtWrapper">';
        msg += 'Thank&nbsp;you&nbsp;for&nbsp;being&nbsp;a&nbsp;valued&nbsp;member!<br><br>';
        msg += '<b>Membership is always FREE!</b><br><br>';
        msg += 'Please share with all your friends!<br>';
        msg += '</div>';
        msg += '</div>';
        $('#normalDialog').html(msg);
        $('#normalDialog').dialog('open');
        setTimeout('hideNormalDialog()', 60000); // hide in 60s if search does not complete.
        return(true);
    }
    catch(e)
    {
        return(false);
    }
}

function showSearchingDialog(){
    try
    {
        var msg = null;
        $("#normalDialog").dialog({
            autoOpen: false,
            modal: true,
            title: "Search in progress"
        });
        msg  = '<div  class="dialogMsgWrapper rounded">';
        msg += '<div class="dialogImage"></div>';
        msg += '<div class="dialogMsgInnerTitle">Searching...</div>';
        msg += '<div class="dialogMsgTxtWrapper">';
        msg += 'Thank&nbsp;you&nbsp;for&nbsp;being&nbsp;a&nbsp;valued&nbsp;member!<br><br>';
        msg += '<b>Membership is always FREE!</b><br><br>';
        msg += 'Please tell all your friends!<br>';
        msg += '</div>';
        msg += '</div>';
        $("#normalDialog").html(msg);
        $("#normalDialog").dialog("open");
        setTimeout('hideNormalDialog()', 60000); // hide in 60s if search does not complete.
        return(true);
    }
    catch(e)
    {
        return(false);
    }
}

function getRandNumber(max){
    try {
        var i = Math.random() * max * 10;
        i = i % max;
        i = Math.floor(i);
        return(i);
    } catch(e){
        alert("ERROR in function getRandNumber() " + e.message + '/' + e.name);
    }
}

function fetchImg(i){
    try {
        var img = new Array('');
        img[0] = '/i/letsparty.jpg';
        img[1] = '/i/magglobe3.jpg';
        img[2] = '/i/classifieds.jpg';
        img[3] = '/i/vehicles2.jpg';
        img[4] = '/i/heartsblue.jpg';
        img[5] = '/i/people.jpg';
        img[6] = '/i/carnival.jpg';
        img[7] = '/i/jobsboard.jpg';
        img[8] = '/i/shopping.jpg';
        img[9] = '/i/coupons.jpg';
        img[10] = '/i/mut5/sports_matrix.png';
        img[11] = '/i/mut5/weather_100x125.png';
        img[12] = '/i/mut5/lodging_100x125.png';
        img[13] = '/i/mut5/dining.png';
        img[14] = '/i/mut5/movies_100x125.png';
        img[15] = '/i/mut5/nightclub_100x125.jpg';
        img[16] = '/i/mut5/xboxctrlr_100x125.gif';
        img[17] = '/i/mut5/comedy_100x125.png';
        img[18] = '/i/mut5/news_100x125.jpg';
        return(img[i]);
    } catch(e){
        //alert("ERROR in function fetchPhrase() " + e.message + '/' + e.name);
        return( '' );
    }
}

function fetchPhrase(i){
    try {
        var img = new Array('');
        img[0] = 'Party Events Finder - Find and post social events!';
        img[1] = 'Web Search - Find the best websites here!';
        img[2] = 'Classifieds - Post FREE classifieds here!';
        img[3] = 'Motors - Post FREE vehicle ads here!';
        img[4] = 'Dating - Better than FREE! Earn rewards with us!';
        img[5] = 'People Finder - Find people and classmates!';
        img[6] = 'Social Events Finder - Post your party or event for FREE!';
        img[7] = 'Job Board - Resumes and job postings are FREE!';
        img[8] = 'Shopping - Sell your goods here for FREE!';
        img[9] = 'Coupons galore - Post and find coupons and discounts.';
        img[10] = 'Sports News - Local, National, and Global';
        img[11] = 'Weather - Local, National, and Global';
        img[12] = 'Lodging - Homes, Apartments, Hotels, &amp; More!';
        img[13] = 'Dining - Food, Wine, &amp; More!';
        img[14] = 'Movies - Movie schedules, reviews, &amp; More!';
        img[15] = 'Night Life - Clubs, Venues, and Places to Hang out!';
        img[16] = 'Gaming - Game reviews, Tips, &amp; More!';
        img[17] = 'Comedy - Fun, Comics, Jokes, &amp; More!';
        img[18] = 'News - Local, National, &amp; Global News';
        return(img[i]);
    } catch(e){
        //alert("ERROR in function fetchPhrase() " + e.message + '/' + e.name);
        return( '' );
    }
}

function getRandomImage(){
    try {
        var i=0;
        var min=0, max=tcMaxImages;
        var finalImg = '';
        var img = new Array('');
        i = getRandNumber(max);
        finalImg = fetchImg(i);
        //alert("Final image: " + finalImg + " for i="+i);
        return(finalImg);
    } catch(e){
        alert("ERROR in function getRandomImage() " + e.message + '/' + e.name);
    }
}

function getNextImage(idx){
    try {
        finalImg = fetchImg(idx);
        return(finalImg);
    } catch(e){
        //alert("ERROR in function getNextImage() " + e.message + '/' + e.name);
        return('');
    }
}

function getNextImageIndex()
{
    try {
        tcImgIndex++;
        if (tcImgIndex > tcMaxImages)
        {
            tcImgIndex = 0;
        }
        return( tcImgIndex );
    } catch(e){
        alert("ERROR in function getNextImageIndex() " + e.message + '/' + e.name);
    }
}

function setNavMessage(msg){
    try {
        $('#divInnerNavMsg').html( '<div id="divHiddenTcMsg" style="display:none;">' + msg + '</div>' );
        $('#divHiddenTcMsg').show('slow');
        return(false);
    } catch(e) {
        return(false);
    }
}

function flashArrows(){
    flashShowArrows();
    setTimeout("flashHideArrows()", 250);
    setTimeout("flashShowArrows()", 350);
    setTimeout("flashHideArrows()", 450);
    setTimeout("flashShowArrows()", 550);
    setTimeout("flashHideArrows()", 650);
    setTimeout("flashShowArrows()", 750);
    setTimeout("flashHideArrows()", 850);
}

function flashShowArrows(){
    try {
        var i=0;
        var maxImages = 9;
        var tmp='';
		
        for (i=1; i<=maxImages; i++){
            tmp = 'imgarrow' + i;
            if ( tcGetDomObj(tmp) ) {
                tcShowImg(tmp);
            }
        }
        return(true);
    } catch(e){
        //alert("ERROR in function flashArrows() " + e.message + '/' + e.name);
        return(false);
    }
}

function flashHideArrows(){
    try {
        var i=0;
        var maxImages = 9;
        var tmp='';
		
        for (i=1; i<=maxImages; i++){
            tmp = 'imgarrow' + i;
            if ( tcGetDomObj(tmp) ) {
                tcHideImg(tmp);
            }
        }
        return(true);
    } catch(e){
        //alert("ERROR in function flashArrows() " + e.message + '/' + e.name);
        return(false);
    }
}

function showNextImage(msg){
    try {
        var img;
        var phrase;
        var idx = 0;

        if (msg == '')
        {
            idx = getNextImageIndex();
            //img = getRandomImage();
            img = getNextImage(idx);
            phrase = fetchPhrase(idx);
            msg = "<table><tr><td><img src='"+img+"' /></td><td>&nbsp;</td><td style='vertical-align:middle;'>";
            msg = msg + '<b>' + phrase + '</b><br><br>';
            msg = msg + 'Welcome! Click a link at the top of the page to select a service.<br><br>';
            msg = msg + "Click the 'Explore' link below to find other great places near you to <b>Search, Surf, &amp; Earn&#8482;</b> your way to great rewards!";
            msg = msg + "</td></tr></table>";
            setNavMessage(msg);
        } else {
            setNavMessage(msg);
        }
        tcImagesShwnCnt = tcImagesShwnCnt + 1;
        return( true );
    } catch(e){
        //alert("ERROR in function showNextImage() " + e.message + '/' + e.name);
        return(false);
    }
}

function doReanimate()
{
    tcImagesShwnCnt = 0;
    tcPauseAutomation = false;
    myInitAutomate();
    return(false);
}

function tcMutPauseAnimation()
{
    try
    {
        if ( tcAnimTimer != null )
        {
            clearInterval( tcAnimTimer );
        }
        tcPauseAutomation = true;
        tcImagesShwnCnt = 0;
        $('#divNavMsg').show('slow');
        $('#divHiddenTcMsg').show('slow');
        return(true);
    } catch(e){
        //alert("ERROR in function tcMutPauseAnimation() " + e.message + '/' + e.name);
        return(false);
    }
}

function myAnimation()
{
    try
    {
        if ( ! tcPauseAutomation )
        {
            showNextImage('');
            if ( tcImagesShwnCnt > tcMaxImages * tcMaxImageLoops )
            {
                tcMutPauseAnimation();
                document.getElementById('divNavMsg').style.display='none';
                return(true);
            }
        }
        return(true);
    } catch(e){
        //alert("ERROR in function myInitAutomate() " + e.message + '/' + e.name);
        return(false);
    }
}

function myInitAutomate()
{
    try
    {
        showNextImage('');
        tcPauseAutomation = false;
        tcAnimTimer = setInterval("myAnimation()", tcAnimTimeDelay);
        return(true);
    } catch(e){
        //alert("ERROR in function myInitAutomate() " + e.message + '/' + e.name);
        return(false);
    }
}

function classifiedsMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/classifieds.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + '<b>Classifieds - FREE classified ads for everyone!</b><br><br>List your stuff here for FREE!<br><br>';
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function classifiedsMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function comedyMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/comedy_100x125.png' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Comedy - Jokes, Comics, Fun, and More!</b><br><br>Sit back and have a laugh!<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function comedyMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function gamingMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/xboxctrlr_100x125.gif' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Gaming - Reviews, Tips, Game News, and More!</b><br><br>Find the latest gaming news &amp; more!<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function gamingMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function nightlifeMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/nightclub_100x125.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Nightlife - Bars, Clubs, Venues, and More!</b><br><br>Find great places to eat, drink, &amp; be merry!<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function nightlifeMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function moviesMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/movies_100x125.png' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Movies  - Schedules, Reviews, and More!</b><br><br>Find great movie theaters near you!<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function moviesMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function diningMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/dining.png' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Dining  - Food, Wine, and More!</b><br><br>Find great places to eat, drink, and be merry!<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function diningMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function lodgingMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/lodging_100x125.png' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Lodging - Homes, Apartments, Hotels, &amp; More</b><br><br>Info on everything from Bed &amp; Breakfasts to New Homes!<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function lodgingMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function weatherMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/weather_100x125.png' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Weather - Local, National, and Global Weather</b><br><br>Weather info and other interesting information!<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function weatherMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function sportsMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/sports_matrix.png' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Sports News - Local, National, and Global Sports News</b><br><br>Articles about your favorite sports.<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function sportsMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function newsMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/mut5/news_100x125.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>News - Local, National, and Global News Stories</b><br><br>Articles about local news and events.<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function newsMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function webSearchMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/magglobe3.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + "<b>Web Search - Search the Internet for the best websites!</b><br><br>Search, Surf, & Earn&#8482; your way to great prizes and rewards!<br><br>";
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function webSearchMO() " + e.message + '/' + e.name);
        return(false);
    }
}

function motorsMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/vehicles2.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + '<b>Motors - FREE vehicle classified ads for everyone!</b><br><br>List your vehicle here for FREE!<br><br>';
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function motorsMO() " + e.message + '/' + e.name);
        return(false);
    }
}
function datingMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/heartsblue.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + '<b>FREE dating where you can even earn great rewards!</b><br /><br />';
        msg = msg + 'We support general dating for everyone, plus dating codes for people with special needs. ';
        msg = msg + 'Never pay a cent for a dating site membership! Dating here is better than FREE! Join us for FREE today!<br /><br />';
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function datingMO() " + e.message + '/' + e.name);
        return(false);
    }
}
function peopleMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/people.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + '<b>People Finder - Find friends and classmates here!</b><br><br>';
        msg = msg + 'Post your own profile through the members area for FREE!<br><br>';
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function peopleMO() " + e.message + '/' + e.name);
        return(false);
    }
}
function socialMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/carnival.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + '<b>Social Events - Find parties and events here!</b><br><br>';
        msg = msg + 'Post your own parties and social events through the members area for FREE!<br><br>';
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function socialMO() " + e.message + '/' + e.name);
        return(false);
    }
}
function jobMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/jobsboard.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + '<b>Job Board - Find jobs and search resumes for talent here.</b><br><br>';
        msg = msg + 'Post your resume or job listings through the members area for FREE!<br><br>';
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function jobMO() " + e.message + '/' + e.name);
        return(false);
    }
}
function shoppingMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img src='/i/shopping.jpg' /></td><td>&nbsp;</td><td>";
        msg = msg + '<b>Shopping - Find products and services at great prices here.</b><br><br>';
        msg = msg + 'Post your product or services through the members area for FREE!<br><br>';
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function shoppingMO() " + e.message + '/' + e.name);
        return(false);
    }
}
function couponsMO(){
    try {
        tcMutPauseAnimation();
        var msg;
        msg = '<div class="divInnerNavMsg">';
        msg = msg + "<table><tr><td><img style='padding:5px 0 0 5px;' src='/i/coupons.gif' /></td><td>&nbsp;</td><td>";
        msg = msg + '<b>Coupons - Find coupons and price alerts here!</b><br><br>';
        msg = msg + 'Find deals and help others by posting coupons and great price finds here!<br><br>';
        msg = msg + "Click the 'Join' link below to get your FREE account setup today!";
        msg = msg + "</td></tr></table>";
        msg = msg + "</div>";
        setNavMessage(msg);
        return(true);
    } catch(e){
        //alert("ERROR in function couponsMO() " + e.message + '/' + e.name);
        return(false);
    }
}

/* Function for colorizing buttons in theme sets*/
/* black */
function classicBlackButtonOut(b){
    b.style.backgroundColor='#EFEFEF';
}
function classicBlackButtonOver(b){
    b.style.backgroundColor='#FFFF00';
}

/* blue */
function simpleBlueButtonOut(b){
    b.style.backgroundColor='#D0FFFF';
}
function simpleBlueButtonOver(b){
    b.style.backgroundColor='#8AFFFF';
}

function datingBlueButtonOut(b){
    b.style.backgroundColor='#D0FFFF';
}
function datingBlueButtonOver(b){
    b.style.backgroundColor='#8AFFFF';
}

function spaceButtonOut(b){
    b.style.backgroundColor='#EFEFEF';
}
function spaceButtonOver(b){
    b.style.backgroundColor='#FFCC00';
}

//legacy Mutant IV
function clearNavMsg(msg){ // legacy - keep for old themes
    showNextImage(msg);
}

// Mut V additions
function classifiedblueButtonOut(b){
    b.style.backgroundColor='#D0FFFF';
}
function classifiedblueButtonOver(b){
    b.style.backgroundColor='#8AFFFF';
}

//Mutant V - theme consolidation
function nullFn(){
    return;
} //used by state selector

function initSearch(){
    showSearchingDialog();
    document.getElementById('searchform1').submit();
}

/* Bar and Nightclub Search */
function doBarSearch(){
    document.forms.searchform1.CtlTyp.value=770;
    initSearch()
}

/* Live Entertainment Search */
function doLiveEntSearch(){
    document.forms.searchform1.CtlTyp.value=772;
    initSearch()
}

/* Gaming - Reviews Search */
function doGamingReviewsSearch(){
    document.forms.searchform1.CtlTyp.value=730;
    initSearch()
}

/* Gaming - Trailers Search */
function doGamingTrailersSearch(){
    document.forms.searchform1.CtlTyp.value=732;
    initSearch()
}

/* Gaming - Cheats Search */
function doGamingCheatsSearch(){
    document.forms.searchform1.CtlTyp.value=734;
    initSearch()
}

/* Gaming - Deals Search */
function doGamingDealsSearch(){
    document.forms.searchform1.CtlTyp.value=734;
    initSearch()
}

/* Web Search */
function doWebSearch(){
    document.forms.searchform1.CtlTyp.value=1;
    initSearch()
}

/* TODO - Change SE logic to News Search (by range) 650 to 699 */
function doNewsSearch(){
    document.forms.searchform1.CtlTyp.value=650; 
    initSearch()
}

/* Comedy Section */
function doComedyJokesSearch(){
    document.forms.searchform1.CtlTyp.value=720; 
    initSearch()
}

function doComedyVideosSearch(){
    document.forms.searchform1.CtlTyp.value=722; 
    initSearch()
}

/* TODO - Change SE logic to Sports search (by range) 700 to 709 */
function doSportsSearch(){
    document.forms.searchform1.CtlTyp.value=700; 
    initSearch()
}

/* TODO - Change SE logic to Weather search (by range) 710 to 714 */
function doWeatherSearch(){
    document.forms.searchform1.CtlTyp.value=710; 
    initSearch()
}

/* TODO - Change SE logic to Lodging search (by range) 765 to 768 */
function doLodgingSearch(){
    document.forms.searchform1.CtlTyp.value=710; 
    initSearch()
}

/* Dining Search */
function doDiningSearch(){
    document.forms.searchform1.CtlTyp.value=740; 
    initSearch()
}

function doDiningArtisanSearch(){
    document.forms.searchform1.CtlTyp.value=742; 
    initSearch()
}

function doDiningDeliverySearch(){
    document.forms.searchform1.CtlTyp.value=744; 
    initSearch()
}

function doDiningReviewsSearch(){
    document.forms.searchform1.CtlTyp.value=746; 
    initSearch()
}

/* Movie Search */
function doMovieSchedsSearch(){
    document.forms.searchform1.CtlTyp.value=775;
    initSearch()
}

function doMovieReviewsSearch(){
    document.forms.searchform1.CtlTyp.value=777;
    initSearch()
}

/* Job Section */
function doResumes(){
    document.forms.searchform1.CtlTyp.value=100;
    initSearch();
}
function doJobs(){
    document.forms.searchform1.CtlTyp.value=105;
    initSearch();
}

/* Society Page */
function doSocietyEvents(){
    document.forms.searchform1.CtlTyp.value=85;
    initSearch();
}

function doSocietyClubs(){
    document.forms.searchform1.CtlTyp.value=87;
    initSearch();
}

/* Dating Page */
function doMlfW() {
    document.forms.searchform1.CtlTyp.value=70; // man lf woman
    initSearch();
}
function doMlfM() {
    document.forms.searchform1.CtlTyp.value=71; // man lf man
    initSearch();
}
function doMlfC() {
    document.forms.searchform1.CtlTyp.value=72; // man lf couples
    initSearch();
}
function doWlfM() {
    document.forms.searchform1.CtlTyp.value=73; // womman lf man
    initSearch();
}
function doWlfW() {
    document.forms.searchform1.CtlTyp.value=74; // womman lf woman
    initSearch();
}
function doWlfC() {
    document.forms.searchform1.CtlTyp.value=75; // womman lf couples
    initSearch();
}
function doClfC() {
    document.forms.searchform1.CtlTyp.value=76; // couples lf couples
    initSearch();
}
function doClfW() {
    document.forms.searchform1.CtlTyp.value=77; // couples lf women
    initSearch();
}
function doClfM() {
    document.forms.searchform1.CtlTyp.value=78; // couples lf men
    initSearch();
}

/* People Finder */
function doPeople(){
    document.forms.searchform1.CtlTyp.value=80;
    initSearch()
}
function doClassmate(){
    document.forms.searchform1.CtlTyp.value=81;
    initSearch()
}

/* Classifieds */
function doApts(){
    document.forms.searchform1.CtlTyp.value=560;
    initSearch();
}
function doBands(){
    document.forms.searchform1.CtlTyp.value=570;
    initSearch();
}
function doBarter(){
    document.forms.searchform1.CtlTyp.value=380;
    initSearch();
}
function doBusiness(){
    document.forms.searchform1.CtlTyp.value=610;
    initSearch();
}
function doBuilding(){
    document.forms.searchform1.CtlTyp.value=600;
    initSearch();
}
function doChalkboard(){
    document.forms.searchform1.CtlTyp.value=640;
    initSearch();
}
function doComputer(){
    document.forms.searchform1.CtlTyp.value=400;
    initSearch();
}
function doFinance(){
    document.forms.searchform1.CtlTyp.value=510;
    initSearch();
}
function doFurniture(){
    document.forms.searchform1.CtlTyp.value=390;
    initSearch();
}
function doFreeStuff(){
    document.forms.searchform1.CtlTyp.value=165;
    initSearch();
}
function doGeneral(){
    document.forms.searchform1.CtlTyp.value=300;
    initSearch();
}
function doGreenEarth(){
    document.forms.searchform1.CtlTyp.value=630;
    initSearch();
}
function doGuns(){
    document.forms.searchform1.CtlTyp.value=580;
    initSearch();
}
function doHealth(){
    document.forms.searchform1.CtlTyp.value=590;
    initSearch();
}
function doJewelry(){
    document.forms.searchform1.CtlTyp.value=420;
    initSearch();
}
function doMassage(){
    document.forms.searchform1.CtlTyp.value=520;
    initSearch();
}
function doMedical(){
    document.forms.searchform1.CtlTyp.value=530;
    initSearch();
}
function doModelling(){
    document.forms.searchform1.CtlTyp.value=540;
    initSearch();
}
function doMusical(){
    document.forms.searchform1.CtlTyp.value=450;
    initSearch();
}
function doPets(){
    document.forms.searchform1.CtlTyp.value=470;
    initSearch();
}
function doHomes(){
    document.forms.searchform1.CtlTyp.value=550;
    initSearch();
}
function doRideFinder(){
    document.forms.searchform1.CtlTyp.value=490;
    initSearch();
}
function doSports(){
    document.forms.searchform1.CtlTyp.value=440;
    initSearch();
}
function doTickets(){
    document.forms.searchform1.CtlTyp.value=460;
    initSearch();
}
function doTools(){
    document.forms.searchform1.CtlTyp.value=430;
    initSearch();
}
function doTravel(){
    document.forms.searchform1.CtlTyp.value=500;
    initSearch();
}
function doTV(){
    document.forms.searchform1.CtlTyp.value=410;
    initSearch();
}
function doWantAds(){
    document.forms.searchform1.CtlTyp.value=310;
    initSearch();
}
function doWebsites(){
    document.forms.searchform1.CtlTyp.value=620;
    initSearch();
}
function doYardSales(){
    document.forms.searchform1.CtlTyp.value=480;
    initSearch();
}

/* Motors */
function doAutoUsed() {
    document.forms.searchform1.CtlTyp.value=320;
    initSearch();
}
function doAutoNew() {
    document.forms.searchform1.CtlTyp.value=321;
    initSearch();
}
function doAutoParts() {
    document.forms.searchform1.CtlTyp.value=322;
    initSearch();
}
function doTruckUsed() {
    document.forms.searchform1.CtlTyp.value=330;
    initSearch();
}
function doTruckNew() {
    document.forms.searchform1.CtlTyp.value=331;
    initSearch();
}
function doTruckParts() {
    document.forms.searchform1.CtlTyp.value=332;
    initSearch();
}
function doSuvUsed() {
    document.forms.searchform1.CtlTyp.value=335;
    initSearch();
}
function doSuvNew() {
    document.forms.searchform1.CtlTyp.value=336;
    initSearch();
}
function doSuvParts() {
    document.forms.searchform1.CtlTyp.value=337;
    initSearch();
}
function doRvUsed() {
    document.forms.searchform1.CtlTyp.value=340;
    initSearch();
}
function doRvNew() {
    document.forms.searchform1.CtlTyp.value=341;
    initSearch();
}
function doRvParts() {
    document.forms.searchform1.CtlTyp.value=342;
    initSearch();
}
function doBoatUsed() {
    document.forms.searchform1.CtlTyp.value=350;
    initSearch();
}
function doBoatNew() {
    document.forms.searchform1.CtlTyp.value=351;
    initSearch();
}
function doBoatParts() {
    document.forms.searchform1.CtlTyp.value=352;
    initSearch();
}
function doSailUsed() {
    document.forms.searchform1.CtlTyp.value=355;
    initSearch();
}
function doSailNew() {
    document.forms.searchform1.CtlTyp.value=356;
    initSearch();
}
function doSailParts() {
    document.forms.searchform1.CtlTyp.value=357;
    initSearch();
}
function doCycleUsed() {
    document.forms.searchform1.CtlTyp.value=360;
    initSearch();
}
function doCycleNew() {
    document.forms.searchform1.CtlTyp.value=361;
    initSearch();
}
function doCycleParts() {
    document.forms.searchform1.CtlTyp.value=362;
    initSearch();
}
function doAircraft() {
    document.forms.searchform1.CtlTyp.value=370;
    initSearch();
}
function doBuses() {
    document.forms.searchform1.CtlTyp.value=371;
    initSearch();
}
function doMilitary() {
    document.forms.searchform1.CtlTyp.value=372;
    initSearch();
}
function doRacecar() {
    document.forms.searchform1.CtlTyp.value=373;
    initSearch();
}
function doClothing() {
    document.forms.searchform1.CtlTyp.value=374;
    initSearch();
}
function doTrailer() {
    document.forms.searchform1.CtlTyp.value=375;
    initSearch();
}
function doFarm() {
    document.forms.searchform1.CtlTyp.value=376;
    initSearch();
}
function doGreen() {
    document.forms.searchform1.CtlTyp.value=377;
    initSearch();
}
function doGreenParts() {
    document.forms.searchform1.CtlTyp.value=378;
    initSearch();
}
function doOther() {
    document.forms.searchform1.CtlTyp.value=379;
    initSearch();
}
function doRepairs() {
    document.forms.searchform1.CtlTyp.value=315;
    initSearch();
}
/* Shopping */
function doProducts(){
    document.forms.searchform1.CtlTyp.value=60;
    initSearch();
}
function doServices(){
    document.forms.searchform1.CtlTyp.value=65;
    initSearch();
}

/* Coupons */
function doAlerts(){
    document.forms.searchform1.CtlTyp.value=90;
    initSearch();
}
function doCoupons(){
    document.forms.searchform1.CtlTyp.value=91;
    initSearch();
}

/* Common Across Pages */
function initStateSelectorAndYearFields(){
    try 
    {
        var step = 1;
        initStateSelector();
		
        step = 2; 
        myComputeYearFields();
    } 
    catch(e)
    {
        alert("Error occurred during initStateSelectorAndYearFields() at step: " + step);
    }
}

function initStateSelectorAndAgeFields(){
    try 
    {
        var step = 1;
        initStateSelector();
		
        step = 2;
        myComputeAgeFields();	
    } 
    catch(e)
    {
        alert("Error occurred during initStateSelectorAndAgeFields() at step: " + step);
    }
}

function initStateSelector(){
    try 
    {
        var fn = 'initStateSelector';
		
        var step = 0;
        var prevStateSelected = document.getElementById('prevStateName').value;
		
        step = 1;
        var stateSelHtml = tcBuildStateSelector(prevStateSelected, 'Stat', nullFn)
        
        step = 2;
        document.getElementById('divStateSelector').innerHTML = stateSelHtml;
		
        step = 3;
        clearNavMsg('');
		
        return(true);
    } 
    catch(e)
    {
        alert("Error occurred during initStateSelector() at step: " + step);
        return(false);
    }
}

function toggleDiv(id){
    if (document.getElementById){
        obj = document.getElementById(id);
        if (obj.style.display == "none"){
            obj.style.display = "";
        } else {
            obj.style.display = "none";
        }
    }
}

function showHideLegal(id){
    if (document.getElementById){
        obj = document.getElementById(id);
        if (obj.style.display == "none"){
            obj.style.display = "";
        } else {
            obj.style.display = "none";
        }
    }
}

//EOF
