﻿
function clearSearchBoxText() {


    if (document.getElementById("txtSearchBox").value == "Search") {
        document.getElementById("txtSearchBox").value = "";
    }

}


function openURL(url) {
    WARCWindow = window.open(url, 'popupWindow2', 'width=790,height=500,"Warc",top=20,left=20,resizable=yes,toolbar=yes,menubar=yes,location=no,status=yes,directories=no,scrollbars=yes');
    if (!WARCWindow.opener)
        WARCWindow.opener = self;
}


function ViewDataResults(GUID, FileType, Forecast) {
    //Call using javascript:ViewDataResults('GUID','FILETYPE')
    var PageURL;
    PageURL = "/Content/DownloadDataFile.aspx?DataGUID=" + GUID + "&Type=" + FileType + "&Forecast=" + Forecast;
    document.location.href = PageURL;

}
function ViewNewspaperTrends(Country) {
    var PageURL;
    PageURL = "/Pages/ForecastsAndData/Results/NewspaperTrendsResults.aspx?Country=" + Country;
    document.location.href = PageURL;

}


function HideVideoOverviewText() {
    VideoText
    document.getElementById("VideoText").setAttribute("class", "HiddenVideoText");
}
function ShowVideoOverviewText() {
    VideoText
    document.getElementById("VideoText").setAttribute("class", "VideoText");
}

function DownloadDataForecast(SeriesIDs, TableTitle) {
    var PageURL;
    PageURL = "/Content/DownloadForecastDataFile.aspx?SeriesIDs=" + SeriesIDs + "&TableTitle=" + TableTitle + "&StartDate=01 January 2002&EndDate=01 January 2011&Frequency=Annually&PercentageChange=False&ConstantPrice=False&CurrentPrice=False";
    document.location.href = PageURL;
}

function ToggleHitHighlighting() {
    if (document.styleSheets[1].disabled == false) {
        document.styleSheets[1].disabled = true;
        document.getElementById("imgShowHitsLink").src = "/Images/Content/HideHits.jpg";
        
    }
    else {
        document.styleSheets[1].disabled = false;
        
        document.getElementById("imgShowHitsLink").src = "/Images/Content/ShowHits.jpg";
    }

}

//Google code
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-183038-1']);
_gaq.push(['_trackPageview']);

(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


