/*var d = document;
var winIE = (navigator.userAgent.indexOf('Opera')==-1 && (d.getElementById && d.documentElement.behaviorUrns)) ? true : false;
function bodySize(){
	if(winIE && d.documentElement.clientWidth) {
		sObj = d.getElementById('rootBox').style;
		sObj.width = (d.documentElement.clientWidth<990) ? '960px' : '85%';

		sObj2 = d.getElementById("innerContent").style;
		sObj2.width = (d.documentElement.clientWidth<990) ? '960px' : '85%';
	}
}*/

var IE='\v'=='v';
var d = document;
function bodySize() {
	/*sObj = d.getElementById('rootBox').style;
	sObj.width = (d.documentElement.clientWidth<990) ? '990px' : '85%';*/
	sObj = document.getElementsByTagName("body")[0];
	if (sObj && sObj.className!='popup') {
		sObj.style.width = (document.documentElement.clientWidth<1000) ? "1000px" : "100%";
	}

}

function changeCSS(source) {
	document.getElementById('cssLink').href = "/i/"+source+".css";
}

function init(){
	if(IE) { bodySize(); }
}
onload = init;
if(IE) { onresize = bodySize; }


var calendarSelects = function(){

    var mSel = $('.calendarMonth');
    var ySel = $('.calendarYear');
    var a = $('.calendarHidden');

    var onChange = function(){
        var m = mSel.val().toString();
        var y = ySel.val();
        var href = a.attr('href');
        href += '&M='+y+'-';
        if (m.length == 1) m = '0'+m;
        href += m;
        window.location.href = href;
    };

    mSel.bind('change', onChange);
    ySel.bind('change', onChange);
};

$(calendarSelects);


/*
var monthSelector = function() {
    var months = $('.monthSelector'),
             doNotHide = false,
             cb = $('.calendarBox'),
             ofs = cb.offset();
    if (!months.length) return;

    months
        .appendTo('body')
        .bind('click', function(){ doNotHide = true;  })
        .width( parseInt(cb.width() ) )
        .css({top: ofs.top+40+'px', left: ofs.left+20+'px'});

    $('.monthSelectorLink')
        .css('cursor', 'pointer')
        .bind('click.ms', function(){
            doNotHide = true;
            months.fadeIn('fast');
            $('body').bind('click.ms', function(){
                if (doNotHide) {
                    doNotHide = false;
                    return;
                }
                months.fadeOut('fast');
                $('body').unbind('.ms');
            });
        });
};

$(monthSelector);
*/
