function OasisJavascriptUtils()
{
    this.GetQueryStringValue = queryStringValueGet;
    function queryStringValueGet(key)
    {
        var query = window.location.search.substring(1);
        var parms = query.split('&');
        for (var i = 0; i < parms.length; i++)
        {
            var pos = parms[i].indexOf('=');
            if (pos > 0)
            {
                if (parms[i].substring(0, pos) == key)
                {
                    if (parms[i].substring(pos + 1) != 'null')
                    {
                        return parms[i].substring(pos + 1);
                    }
                    else
                    {
                        return '';
                    }
                }
            }
        }
        
        return '';
    }
    
    this.SetQueryStringValue = queryStringValueSet;
    function queryStringValueSet(query, key, value)
    {
        var parms = query.split('&');
        var newQuery = '';
        var updated = false;
        
        for (var i = 0; i < parms.length; i++)
        {
            var pos = parms[i].indexOf('=');
            if (pos > 0)
            {
                if (parms[i].substring(0, pos) == key)
                {
                    newQuery += parms[i].substring(0, pos) + '=' + value + '&';
                    updated = true;
                }
                else
                {
                    newQuery += parms[i] + '&';
                }
            }
        }
        
        if (newQuery.length > 0)
        {
            newQuery = newQuery.substring(0, newQuery.length - 1);
        }
        
        if (!updated)
        {
            newQuery += '&' + key + '=' + value;
        }
        
        return newQuery;
    }
    
    this.GetDropDownValue = dropDownValueGet;
    function dropDownValueGet(elementId)
    {
        var dropdownIndex = document.getElementById(elementId).selectedIndex;
        return document.getElementById(elementId)[dropdownIndex].value;
    }
    
    this.GetDropDownText = dropDownTextGet;
    function dropDownTextGet(elementId)
    {
        var dropdownIndex = document.getElementById(elementId).selectedIndex;
        return document.getElementById(elementId).options[dropdownIndex].text;
    }

    this.GetClientWidth = getClientWidth;
    function getClientWidth()
    {
        var clientWidth;	
		try
		{
        if (parent.window.innerWidth)
        {
            clientWidth = (parent.window.__safari ? parent.window.innerWidth : Math.min(parent.window.innerWidth, parent.document.documentElement.clientWidth));
        }
        else if (parent.document.documentElement && parent.document.documentElement.clientWidth)
        {
            clientWidth = parent.document.documentElement.clientWidth;
        }
        else if (parent.document.body)
        {
            clientWidth = parent.document.body.clientWidth;
        }
        else 
        {
            clientWidth = parent.document.documentElement.clientWidth;
        }
        return clientWidth;
		} catch (err){}
    }
    
    this.GetClientHeight = getClientHeight;
    function getClientHeight()
    {
        var clientHeight;
		try{
        if (parent.window.innerHeight) 
        {
            clientHeight = (parent.window.__safari ? parent.window.innerHeight : Math.min(parent.window.innerHeight, parent.document.documentElement.clientHeight));
        }
        else if (parent.document.documentElement && parent.document.documentElement.clientHeight)
        {
            clientHeight = parent.document.documentElement.clientHeight;
        }
        else if (parent.document.body)
        {
            clientHeight = parent.document.body.clientHeight;
        }
        else 
        {
            clientHeight = parent.document.documentElement.clientHeight;
        }
        return clientHeight;
		} catch (err){}
    }
    
    this.GetScrollTop = getScrollTop;
    function getScrollTop()
    {
		try
		{
        var scrollTop = (parent.document.documentElement.scrollTop || parent.document.body.scrollTop);
        return scrollTop;
		} catch (err){}
    }
}