/****** Custom Variables ******/

$.browser.msie6 = $.browser.msie && parseInt($.browser.version) == 6 && !window["XMLHttpRequest"];
$.browser.chrome = $.browser.safari;

/****** Initialization After Build ******/

$(document).ready(function() {

    $(function() {
       $(":contains(' B teledyne dot kom')").not(":has(:contains(' B teledyne dot kom'))").each(function() {
            var that = $(this),
            html = that.html();
            html = html.replace(/\ B\ teledyne\ dot\ kom/, "@teledyne.com");
            that.html(html);
       });
   });

   $('#splash').jshowoff({
       speed: 9000,
       changeSpeed: 900,
       controls: true,
       links: true,
       autoPlay: true
   });

    /****** CSS Exceptions ******/
    $('.prettytable tr:even').addClass('odd');

    if ($.browser.mozilla) {
        //Firefox
        $('img').css('-moz-border-radius', '6px 6px');
        $('.presentation').css('min-height', '700px');
        $('.highlights div:odd').css('background', '#F7FBFF')
                                .css('-moz-border-radius', '6px 6px');
        $('#sideobjs').css('min-width', '200px');
        $('.dbullets').css('margin-left', '5px');
        $('.pageheader').css('-moz-border-radius', '6px 6px');
        $('.presentation').css('-moz-border-radius', '6px 6px');
        $('.pheader').css('-moz-border-radius', '6px 6px');
        $('.wefurther').css('-moz-border-radius', '6px 6px');
        $('.certs, .feature, .genericSide').css('-moz-border-radius', '6px 6px');
        $('#jshowoff div, #jshowoff img, #jshowoff').css('-moz-border-radius-topleft', '6px 6px')
                            					    .css('-moz-border-radius-topright', '6px 6px');
        $('#splash').css('-moz-border-radius-topleft', '6px 6px')
	                .css('-moz-border-radius-topright', '6px 6px');
        $('#jshowoff-slidelinks a, #jshowoff-controls a, #splash div p span').css('-moz-border-radius', '6px 6px');
    }

    if ($.browser.opera) {
        //Opera
        $('img').css('border-radius', '6px 6px');
        $('.presentation').css('min-height', '700px');
        $('.highlights div:odd').css('background', '#F7FBFF')
                                .css('border-radius', '6px 6px');
        $('#sideobjs').css('min-width', '200px');
        $('.dbullets').css('margin-left', '5px');
        $('.pageheader').css('border-radius', '6px 6px');
        $('.presentation').css('border-radius', '6px 6px');
        $('.pheader').css('border-radius', '6px 6px');
        $('.wefurther').css('border-radius', '6px 6px');
        $('.certs, .feature, .genericSide').css('border-radius', '6px 6px');
        $('#jshowoff div, #jshowoff img, #jshowoff').css('border-top-left-radius', '6px 6px')
                            					    .css('border-top-right-radius', '6px 6px');
        $('#splash').css('border-top-left-radius', '6px 6px')
	                .css('border-top-right-radius', '6px 6px');
        $('#jshowoff-slidelinks a, #jshowoff-controls a, #splash div p span').css('border-radius', '6px 6px');
    }

    if ($.browser.chrome || $.browser.safari || $.browser.webkit) {
        //Chrome & Safari
        $('.presentation').css('min-height', '700px');
        $('.highlights div:odd').css('background', '#F7FBFF')
                                .css('-webkit-border-radius', '6px 6px');
        $('#sideobjs').css('min-width', '200px');
        $('.navmenu li ul').css('opacity', '.95');
        $('.dbullets').css('margin-left', '5px');
        $('.pageheader').css('-webkit-border-radius', '6px 6px');
        $('.presentation').css('-webkit-border-radius', '6px 6px');
        $('.pheader').css('-webkit-border-radius', '6px 6px');
        $('.wefurther').css('-webkit-border-radius', '6px 6px');
        $('.certs, .feature, .genericSide').css('-webkit-border-radius', '6px 6px');
        $('#jshowoff div, #jshowoff img, #jshowoff').css('-webkit-border-top-left-radius', '6px 6px')
                            					    .css('-webkit-border-top-right-radius', '6px 6px');
        $('#splash').css('-webkit-border-top-left-radius', '6px 6px')
              	    .css('-webkit-border-top-right-radius', '6px 6px');
        $('#splash div p span').css('-webkit-border-radius', '6px 6px');
        $('#jshowoff-slidelinks a, #jshowoff-controls a').css('-webkit-border-radius', '6px 6px');
    }

    if ($.browser.msie) {
        //MSIE All
        $('.dbullets').css('margin-left', '2px');
    }

    if ($.browser.msie6) {
        //MSIE 6
        $('.presentation').css('min-height', '700px');
        $('.highlights div:odd').css('background', '#F7FBFF');
        DD_roundies.addRule('.highlights div', '6px');
        $('.pageheader').css('width', '858px');
        DD_roundies.addRule('.presentation', '6px');
        DD_roundies.addRule('.pageheader', '6px');
        DD_roundies.addRule('.pheader', '6px');
        DD_roundies.addRule('.certs, .feature, .genericSide', '6px');
        $('#splash div p span').css('background', '#3399CC');
        $('#jshowoff-bottom').css('background', '#5E5E5E');
        $('#jshowoff-slidelinks a, #jshowoff-controls a').css('background', '#5E5E5E');
        $('#jshowoff-slidelinks a.jshowoff-active').css('background', '#FFFFFF');
    }

    if ($.browser.msie && ($.browser.version < 7.9999) && ($.browser.version > 6.9999)) {
        //MSIE 7
        $('.presentation').css('min-height', '700px');
        $('.highlights div:odd').css('background', '#F7FBFF');
        DD_roundies.addRule('.highlights div', '6px');
        $('#sideobjs').css('width', '200px');
        $('.pageheader').css('width', '858px');
        DD_roundies.addRule('.presentation', '6px');
        DD_roundies.addRule('.pageheader', '6px');
        DD_roundies.addRule('.pheader', '6px');
        DD_roundies.addRule('.certs, .feature, .genericSide', '6px');
        DD_roundies.addRule('.wefurther', '6px');
    }

    if ($.browser.msie && ($.browser.version > 7.9999)) {
        //MSIE 8+
        $('.presentation').css('min-height', '700px');
        $('.highlights div:odd').css('background', '#F7FBFF').corner("round 6px");
        $('#sideobjs').css('width', '200px');
        $('.dbullets').css('margin-left', '7px');
        $('.pageheader').css('width', '858px');
        $('.certs, .feature').corner("keep cc:#D7EEF1");
        $('.pheader').corner("round 6px");
    }
});
