function toggleDisplay(objid) {
    elementid = "ctl00_MainContent_" + objid;
    obj = document.getElementById(elementid);
    if (obj.style.display == "none") {
        document.getElementById(elementid).style.display = "block";
    }
    else {
        document.getElementById(elementid).style.display = "none";
    }
}

function limitText(textbox, maxlength) {
    textboxid = "ctl00_ContentPlaceHolder1_" + textbox;
    obj = document.getElementById(textboxid);
    if (obj.value.length > maxlength) { }
    obj.value = obj.value.substring(0, maxlength);
}

function goThere(destination) {
    window.location = destination;
}

function PhilsTest() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'PhilsTest']);
}

function GetPhotoGANext() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'imageclick/next']);
}

function GetPhotoGAPrev() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'imageclick/previous']);
}

function GetDealerProfilePhotoGANext() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'DealerProfile/imageclick/next']);
}

function TrackHomeVehicleOfWeek() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'HomeVehicleOfWeek']);
}

function GetDealerProfilePhotoGAPrev() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'DealerProfile/imageclick/previous']);
}

function GetPhotoGANewNext() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'imageclick/next']);
}

function GetPhotoGANewPrev() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'imageclick/previous']);
}

function GetPhotoGAMobileNext() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'imageclick/next']);
}

function GetPhotoGAMobilePrev() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'imageclick/previous']);
}

function TrackMakesDDL() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'quicksearch/make']);
}

function TrackModelsDDL() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'quicksearch/model']);
}

function TrackYearsDDL() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'quicksearch/year']);
}

function TrackMakesDDLMobile() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'quicksearch/make']);
}

function TrackModelsDDLMobile() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'quicksearch/model']);
}

function TrackYearsDDLMobile() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'quicksearch/year']);
}

function TrackSelectCategory() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'SelectCategory']);
}

function TrackSelectSubCategory() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'SelectSubCategory']);
}

function TrackAdPage_NextAd() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'AdPage_NextAd']);
}

function TrackAdPage_PrevAd() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'AdPage_PrevAd']);
}

function TrackAdPageSuggestions() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'AdPageSuggestions']);
}

function TrackSearchResultsList() {
    _gaq.push(['_setAccount', 'UA-5222739-1']);
    _gaq.push(['_trackPageview', 'SearchResultsList']);
}





function stopNoPhotos(objid) {
    if (document.getElementById("ctl00_ContentPlaceHolder1_img30Ad" + objid).value == "True") {
        alert("Sorry! To select this package you must choose at least one photo for your ad!\n\nPlease go back to your management page and edit the ad.");
        return false;
    }
    else {
        alert("Sorry! To select this package you must choose at least one photo for your ad!\n\nPlease go back to your management page and edit the ad.");
        return false;
    }
    return false;
}

function confirm_delete() {
    if (confirm("WARNING:\n\nAre you sure you want to delete this advert?") == true)
        return true;
    else
        return false;
}

function confirm_forsale() {
    if (confirm("WARNING: This will re-activate the ad for this car.\n\nAre you sure you want to put this car on sale again?") == true)
        return true;
    else
        return false;
}

function confirm_sold() {
    if (confirm("WARNING: This will de-activate your ad on the website\n\nAre you sure you want to mark this car as sold?") == true)
        return true;
    else
        return false;
}

/* Classifieds Change Main Photo */


