/*
CSS Browser Selector v0.3.5 (Feb 05, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u) { var ua = u.toLowerCase(), is = function(t) { return ua.indexOf(t) > -1; }, g = 'gecko', w = 'webkit', s = 'safari', o = 'opera', h = document.documentElement, b = [(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + RegExp.$1) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : is('konqueror') ? 'konqueror' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : is('mozilla/') ? g : '', is('j2me') ? 'mobile' : is('iphone') ? 'iphone' : is('ipod') ? 'ipod' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js']; c = b.join(' '); h.className += ' ' + c; return c; }; css_browser_selector(navigator.userAgent);

util = {
    obj: function(n, d){
        var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
        if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
        for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
        if(!x && d.getElementById) x=d.getElementById(n); return x;
    },
    clear: function(obj, txt){
        if( obj.value && obj.value.toLowerCase() == txt.toLowerCase() )
            obj.value = '';
    },
    reset: function(obj, txt){
        if(obj.value.length == 0)
            obj.value = txt;
    },
    prevEle: '',
    toggleClass: function(id, classA, classB){
        var ele = util.obj(id);
        if(!ele) return;
        if(ele.className == classA){
            ele.className = classB;
            if(util.prevEle != '' && ele != util.prevEle) util.prevEle.className = classA;
        }else{
            ele.className = classA;
            if(util.prevEle != '' && ele != util.prevEle) util.prevEle.className = classB;
        }
        util.prevEle = ele;
    },
    show: function(eleId){
	    var obj = util.obj(eleId);
	    if (!obj) return;
	    obj.style.display = 'block';
    },
    hide: function(eleId){
	    var obj = util.obj(eleId);
	    if (!obj) return;
	    obj.style.display = 'none';
    },
    prevShown: '',
    showHide: function(eleId){
        if(util.prevShown != '')
            util.hide(util.prevShown);
        if(util.prevShown != eleId){
            util.prevShown = eleId;
            util.show(eleId);
        }else{
            util.prevShown = '';
        }
    }
}

dotNet = {
    postbackOnEnter: function(event, objId){
        if( event && event.keyCode == 13 )
            __doPostBack(objId,'');
    }
}

