// JScript File
function Load() {

//alert(navigator.userAgent.toLowerCase());
if (deviceHasFlash()){
window.onunload = function() {
     window["__flash__removeCallback"] = function (instance, name) {
     return;
     };
	 }

    $("#slideShow").jFlow({
        slides: "#slides",
        controller: ".jFlowControl", // must be class, use . sign
        slideWrapper: "#jFlowSlide", // must be id, use # sign
        selectedWrapper: "jFlowSelected",  // just pure text, no sign
        easing: "swing",
        width: "388px",
        height: "287px",
        duration: 400,
        prev: ".jFlowPrev", // must be class, use . sign
        next: ".jFlowNext" // must be class, use . sign
    });

    $('.right-text H3').flash(
        {
            src: '/flash/fonts/museo500v2.swf',
            flashvars: {
                css: ['* {color:#E65A0E;font-size:25;letter-spacing: -1;leading: -4;line-height:-1},'].join(' ')
            }
        },
        { version: 7 },
        function(htmlOptions) {
            $(this).attr({ style: 'padding:0;margin:0 0 0 -4px;cursor:pointer' })
            var url = $('.right-text H3 a').attr('href');
            if (!url === undefined) { $('.right-text H3 a').attr('href', '#') };
            htmlOptions.flashvars.txt = this.innerHTML;
            this.innerHTML = '<span>' + this.innerHTML + '</span>';
            var $alt = $(this.firstChild);
            htmlOptions.wmode = 'transparent';
            htmlOptions.style = 'cursor:pointer';
            htmlOptions.height = height="30px";
            htmlOptions.width = width="300px";
            $alt.addClass('sifr-alt');
            $(this)
                .addClass('flash-replaced')
                .mouseup(function(event) {
            if (!url === undefined) {
                        window.open(url,"_blank");
                        return false;
                    }
                })
                .prepend($.fn.flash.transform(htmlOptions))
                .mouseover(function(event) {
                    $(this).attr({ style: "cursor:pointer" })
                });
        }
    );






  $('.case-study').each(function() {
        var current = location.href
        if (current.indexOf($(this).attr('href')) != -1) {
            $(this).toggleClass("case-study_selected");

        }
        else {
            $(this)
					.mouseover(function(event) {
	//				    $(this).animate({ width: "191px", height: "52px",
	//				        marginLeft: "-2px", marginTop: "-2px"
	//				    }, { duration: 100, queue: false });
					});
            $(this).mouseout(function(event) {
    //            $(this).animate({ width: "189px", height: "50px",
    //                marginLeft: "0px", marginTop: "0px"
     //           }, { duration: 100, queue: false });
            });
        }


    });
} 
else{
		 $('.case-study').each(function() {
        var current = location.href
        if (current.indexOf($(this).attr('href')) != -1) {
            $(this).toggleClass("case-study_selected");

        }
        else {
            $(this)
					.mouseover(function(event) {
	//				    $(this).animate({ width: "191px", height: "52px",
	//				        marginLeft: "-2px", marginTop: "-2px"
	//				    }, { duration: 100, queue: false });
					});
            $(this).mouseout(function(event) {
    //            $(this).animate({ width: "189px", height: "50px",
    //                marginLeft: "0px", marginTop: "0px"
     //           }, { duration: 100, queue: false });
            });
        }


    });
	$("#slideShow").jFlow({
        slides: "#slides",
        controller: ".jFlowControl", // must be class, use . sign
        slideWrapper: "#jFlowSlide", // must be id, use # sign
        selectedWrapper: "jFlowSelected",  // just pure text, no sign
        easing: "swing",
        width: "388px",
        height: "287px",
        duration: 400,
        prev: ".jFlowPrev", // must be class, use . sign
        next: ".jFlowNext" // must be class, use . sign
    });
	}
}
function deviceHasFlash(){
	//return false
	var _devicetype = navigator.userAgent.toLowerCase()
	return !((_devicetype.indexOf("win64") != -1) || (_devicetype.indexOf("iphone")!= -1)|| (_devicetype.indexOf("ipad")!= -1)|| (_devicetype.indexOf("ipod")!= -1))
} 

