﻿var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-143704-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);
})();


function SwitchRow(ParamRowID) {
    if (document.getElementById(ParamRowID).style.display == 'none')
    { document.getElementById(ParamRowID).style.display = 'block'; }
    else
    { document.getElementById(ParamRowID).style.display = 'none'; }
}

function QueryStringAdd(strName, strValue) {
    strOperator = '&';
    strLocation = QueryStringRemove(strName)
    if (strLocation == '') strOperator = '?';
    strData = strOperator + strName + '=' + escape(strValue);
    return document.location.pathname + strLocation + strData;
}

function QueryStringRemove(strName) {
    strResult = location.search;
    strResult = strResult.replace('&' + strName + '=' + QueryString(strName), '');
    strResult = strResult.replace('?' + strName + '=' + QueryString(strName), '');
    return strResult;
}

function QueryString(strParameter) {
    var intBegin, intEnd;

    if (self.location.search.length > 1) objString = self.location.search;
    else
        if (self.location.hash.length > 1) objString = self.location.hash;
        else return ('');

    intBegin = objString.indexOf(strParameter) + strParameter.length + 1;
    intEnd = objString.indexOf('&', intBegin);
    if (intEnd == (-1)) intEnd = objString.length;
    return (objString.substring(intBegin, intEnd));
}

function ShowHighlight(ParamRow, ParamOnOff) {
    if (ParamOnOff)
    { document.getElementById(ParamRow).style.background = '#99FF99'; }
    else
    { document.getElementById(ParamRow).style.background = '#FFFFFF'; }
}


function Highlight(ParamID, ParamMouseOver, ParamColorOn, ParamColorOff) {
    if (!ParamMouseOver) {
        document.getElementById(ParamID).style.cursor = 'auto';
        document.getElementById(ParamID).style.background = ParamColorOff;
    }
    else {
        document.getElementById(ParamID).style.cursor = 'hand';
        document.getElementById(ParamID).style.background = ParamColorOn;
    }
}
