$(document).ready(function () {
    $(function () {
        $('#slides').slides({
            preload: true,
            generatePagination: false,
            effect: 'fade',
            fadeSpeed: 1000,
            play: 6000,
            pause: 200,
            hoverPause: true
        });
    });

    //setting height to all promoboxes
    var promoWrapHeight = $('#promoWrap').height();
    $('.promoBox').css({ height: promoWrapHeight + 'px' });

    /***********************************************************************/

    //Specifying the calculated value to the pagination
    var bottomPos = $('#promoWrap').css('bottom').replace('px', '');
    var promoBoxHeight = $('.promoBox').height();
    var totalBottomPos = parseInt(bottomPos) + promoBoxHeight + 17;
    //alert(totalBottomPos);
    $('.pagination').css({ bottom: totalBottomPos + 'px' });
    /***********************************************************************/
});

var Browser = {
    Version: function () {
        var version = 999; // we assume a sane browser
        if (navigator.appVersion.indexOf("MSIE") != -1)
        // bah, IE again, lets downgrade version number
            version = parseFloat(navigator.appVersion.split("MSIE")[1]);
        return version;
    }
}

var userAgent = navigator.userAgent.toLowerCase();
$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());

if ($.browser.chrome == false) {
	if (Browser.Version() == 999 || Browser.Version() >= 7) {
		js_script = document.createElement('script');
		js_script.type = "text/javascript";
		js_script.src = '/layout/js/bgstretcher.js';
		document.getElementsByTagName('head')[0].appendChild(js_script);

		//setTimeout('doInit();',1000);
		function doInit() {
			$(document).ready(function () {
				$('body').bgStretcher({
					images: ['/layout/img/body-bg.jpg'],
					imageWidth: 1960,
					imageHeight: 1000
				});
			});
		}
		doInit();
	}

}
$(document).ready(function () {
    $('#month').gentleSelect({
        columns: 1,
        itemWidth: 70,
        title: "MONTH"
    });

    $('#day').gentleSelect({
        columns: 1,
        itemWidth: 51,
        title: "DAY"
    });
    window.onload = doInit;
});
