// JScript File
function Load() {


//alert(navigator.userAgent.toLowerCase());
if (deviceHasFlash()){

	window.onunload = function() {
		 window["__flash__removeCallback"] = function (instance, name) {
		 return;
		 };
		 }

		var flashvars = { StrapCount: 1,
			BackCount: 1,
			WorkCount: 25,
			ThePath: location.href
		};
		var params = { menu: "false", wmode: "transparent" };
		var attributes = {};
		swfobject.embedSWF("/swf/player_one.swf", "flash-home", "582", "346", "7.0.0", "", flashvars, params, attributes);
		swfobject.embedSWF("/flash/clients_377x109_fp8_v1.swf", "flash_portfolio", "377", "109", "7.0.0", "", flashvars, params, attributes);


		// SIFR from here on in
		$('.spotlight h4').flash({
			src: '/flash/fonts/museo500v2.swf',
			flashvars: {
				css: ['* {color: #E45B0B;font-size:19;letter-spacing: -1;leading: 8;fontSize:19px}'
					  , 'a:link { color: #E45B0B; text-decoration: none;font-size:19;margin-top:4}'
					  , 'a:hover { color: #E45B0B; text-decoration: underline; }'].join(' ')
			}
		},
		{
			version: 7
		},
		function(htmlOptions) {
			$(this).attr({
				style: 'padding:0;margin:0 0 0 10px'
			})
			htmlOptions.flashvars.txt = this.innerHTML;
			this.innerHTML = '<span>' + this.innerHTML + '<span>';
			var $alt = $(this.firstChild);
			htmlOptions.wmode = 'transparent';
			htmlOptions.height = $alt.height() + 10;
			htmlOptions.width = $alt.width() + 10;
			$alt.addClass('sifr-alt');
			$(this).addClass('flash-replaced').prepend($.fn.flash.transform(htmlOptions));
		});
		

		$('.item h3').each(function(i) {
			var txt = this.innerHTML;
			this.innerHTML = "<span id='ff" + i + "'>" + this.innerHTML + "</span>";
			var $alt = $(this.firstChild);

			$(this).append($alt);
			var height = $alt.height();
			var width = $alt.width();
			$alt.addClass('sifr-alt');
			$(this).attr({ style: 'padding:0;margin:0 0 0 92px;' })
			.mouseleave(function(event) { callExternalInterface("ff" + i, txt); });

			var flashvars = { css: escape("* {color:#00569F;font-size:20;letter-spacing: -1;} a:link { color: #00569F; text-decoration: none;} a:hover{ color: #00569F; text-decoration: underline; }"), txt: escape(txt) };
			var params = { menu: "false", wmode: "transparent", SWLiveConnect: "true", allowScriptAccess: "always" };
			var attributes = { id: "ff" + i, name: "ff" + i };
			swfobject.embedSWF("/flash/fonts/museo500v2.swf", "ff" + i, width, height, "7.0.0", "", flashvars, params, attributes);
		}
		);

		$('#newsTab').each(function(i) {
			var txt = this.innerHTML;
			this.innerHTML = "<span id='swfNews'>" + this.innerHTML + "</span>";
			var $alt = $(this.firstChild);

			//this.innerHTML = "<span >" + this.innerHTML + "</span>";
			$(this).append($alt);
			var height = $alt.height();
			var width = $alt.width();
			$alt.addClass('sifr-alt');
			$(this).attr({ style: 'padding:0;margin:3px 0 0 4px;' })
				.mouseleave(function(event) { callExternalInterface("swfNews", txt); })
				.mouseover(function(event) {
				$('#feed-blog').attr({ style: 'display:none' })
				$('#feed-news').fadeIn('fast');
				})
				var flashvars = { css: escape("* { color: #ffffff;font-size:19;letter-spacing: -1;leading: 8;}a:link { color: #ffffff; text-decoration: none;font-size:19;margin-top:4}a:hover { color: #ffffff; text-decoration: underline; }"), txt: escape(txt) };
			var params = { menu: "false", wmode: "transparent", SWLiveConnect: "true", allowScriptAccess: "always" };
			var attributes = { id: "swfNews", name: "swfNews" };
			swfobject.embedSWF("/flash/fonts/museo500v2.swf", "swfNews", width, height, "7.0.0", "", flashvars, params, attributes);
			}
	    );
	  

$('#blogTab').each(function(i) {
		    var txt = this.innerHTML;
			this.innerHTML = "<span id='swfBlog'>" + this.innerHTML + "</span>";
			var $alt = $(this.firstChild);

			//this.innerHTML = "<span >" + this.innerHTML + "</span>";
			$(this).append($alt);
			var height = $alt.height();
			var width = $alt.width();
			$alt.addClass('sifr-alt');
			$(this).attr({ style: 'padding:0;margin:3px 0 0 4px;' })
				.mouseleave(function(event) { callExternalInterface("swfBlog", txt); })
				.mouseover(function(event) {
					    $('#feed-news').attr({ style: 'display:none' })
					    $('#feed-blog').fadeIn('fast');
					})//
		    var flashvars = { css: escape("* { color: #E45B0B;font-size:19;letter-spacing: -1;leading: 8;}a:link { color: #E45B0B; text-decoration: none;font-size:19;margin-top:4}a:hover { color: #E45B0B; text-decoration: underline; }"), txt: escape(txt) };
			var params = { menu: "false", wmode: "transparent", SWLiveConnect: "true", allowScriptAccess: "always" };
			var attributes = { id: "swfBlog", name: "swfBlog" };
			swfobject.embedSWF("/flash/fonts/museo500v2.swf", "swfBlog", width, height, "7.0.0", "", flashvars, params, attributes);
		}
	    );


	

		$('.portfolio h4').flash({
			src: '/flash/fonts/museo500v2.swf',
			flashvars: {
				css: ['* {color: #E45B0B;font-size:19;letter-spacing: -1;leading: 8;}'
					  , 'a:link { color: #E45B0B; text-decoration: none;font-size:19;margin-top:4}'
					  , 'a:hover { color: #E45B0B; text-decoration: underline; }'].join(' ')
			}
		},
		{
			version: 7
		},
		function(htmlOptions) {
			$(this).attr({
				style: 'padding:0;margin:0 0 0 10px'
			})
			htmlOptions.flashvars.txt = this.innerHTML;
			this.innerHTML = '<span>' + this.innerHTML + '<span>';
			var $alt = $(this.firstChild);
			htmlOptions.wmode = 'transparent';
			htmlOptions.height = $alt.height() + 10;
			htmlOptions.width = $alt.width() + 10;
			$alt.addClass('sifr-alt');
			$(this).addClass('flash-replaced').prepend($.fn.flash.transform(htmlOptions));
		});



		$('.text-motto').flash({
			src: '/flash/fonts/museo500v2.swf',
			flashvars: {
				css: ['* {color:#434343;font-size:22;letter-spacing: -1;width:540px;leading: -2},'].join(' ')
			}
		},
		{
			version: 7
		},
		function(htmlOptions) {
			$(this).attr({
				style: 'padding:0;margin:0 0 0 -4px'
			})
			htmlOptions.flashvars.txt = this.innerHTML;
			this.innerHTML = '<span>' + this.innerHTML + '<span>';
			var $alt = $(this.firstChild);
			htmlOptions.wmode = 'transparent';
			htmlOptions.height = $alt.height() + 10;
			htmlOptions.width = $alt.width() + 10;
			$alt.addClass('sifr-alt');
			$(this).addClass('flash-replaced').prepend($.fn.flash.transform(htmlOptions));
		});
		
		
		
		function getMovieName(movieName) {
			if (navigator.appName.indexOf("Microsoft") != -1) { return window[movieName] }
			else { return document[movieName] }
		}
		function callExternalInterface(swfID, text) { getMovieName(swfID).callRedraw(text) }
		
		
		
	//OLD CODE	
		 //$('#blogTab').each(function(i) {
		  //  var txt = this.innerHTML;
			//this.innerHTML = "<span id='swfBlog'>" + this.innerHTML + "</span>";
			//var $alt = $(this.firstChild);

			//this.innerHTML = "<span >" + this.innerHTML + "</span>";
			//$(this).append($alt);
			//var height = $alt.height();
			//var width = $alt.width();
			//$alt.addClass('sifr-alt');
			//$(this).attr({ style: 'padding:0;margin:3px 0 0 4px;' })
			//.mouseleave(function(event) { callExternalInterface("swfBlog", txt); })
			//.mouseover(function(event) {
				//	    $('#feed-news').attr({ style: 'display:none' })
					//    $('#feed-blog').fadeIn('fast');
					//})
		   // var flashvars = { css: escape("* { color: #E45B0B;font-size:19;letter-spacing: -1;leading: 8;}a:link { color: #E45B0B; text-decoration: none;font-size:19;margin-top:4}a:hover { color: #E45B0B; text-decoration: underline; }"), txt: escape(txt) };
			//var params = { menu: "false", wmode: "transparent", SWLiveConnect: "true", allowScriptAccess: "always" };
			//var attributes = { id: "swfBlog", name: "swfBlog" };
			//swfobject.embedSWF("/flash/fonts/museo500v2.swf", "swfBlog", width, height, "7.0.0", "", flashvars, params, attributes);
		//}
	   // );

		
		
		
		
	   // $('.item h3').each(function(i) {
		 //   var txt = this.innerHTML;
		 //   this.innerHTML = "<span id='ff" + i + "'>" + this.innerHTML + "</span>";
		 //   var $alt = $(this.firstChild);

			//this.innerHTML = "<span >" + this.innerHTML + "</span>";
		 //   $(this).append($alt);
		 //   var height = $alt.height();
		 //   var width = $alt.width();
		//    $alt.addClass('sifr-alt');
		//   $(this).attr({ style: 'padding:0;margin:0 0 0 92px' })
		//	.mouseleave(function(event) { callExternalInterface("ff" + i, txt); });

		  //  var flashvars = { css: escape("* {color:#00569F;font-size:20;letter-spacing: -1;width:230px;} a:link { color: #00569F; text-decoration: none;} a:hover{ color: #00569F; text-decoration: underline; }"), txt: escape(txt) };
		  //  var params = { menu: "false", wmode: "transparent", SWLiveConnect: "true", allowScriptAccess: "always" };
		  //  var attributes = { id: "ff" + i, name: "ff" + i };
		  //  swfobject.embedSWF("/flash/fonts/museo500v2.swf", "ff" + i, width, height, "7.0.0", "", flashvars, params, attributes);
	   // }
		// );
		
		
		
		
		
		
		
		//$('#newsTab').each(function(i) {
	  //  var txt = this.innerHTML;
	   // this.innerHTML = "<span id='swfNews'>" + this.innerHTML + "</span>";
		//var $alt = $(this.firstChild);

		//this.innerHTML = "<span >" + this.innerHTML + "</span>";
		//$(this).append($alt);
		//var height = $alt.height();
		//var width = $alt.width();
		//$alt.addClass('sifr-alt');
		//$(this).attr({ style: 'padding:0;margin:3px 0 0 4px;' })
			//.mouseleave(function(event) { callExternalInterface("swfNews", txt); })
			//.mouseover(function(event) {
			//$('#feed-blog').attr({ style: 'display:none' })
			//$('#feed-news').fadeIn('fast');
			//})
			//var flashvars = { css: escape("* { color: #ffffff;font-size:19;letter-spacing: -1;leading: 8;}a:link { color: #ffffff; text-decoration: none;font-size:19;margin-top:4}a:hover { color: #ffffff; text-decoration: underline; }"), txt: escape(txt) };
	  //  var params = { menu: "false", wmode: "transparent", SWLiveConnect: "true", allowScriptAccess: "always" };
		//var attributes = { id: "swfNews", name: "swfNews" };
		//swfobject.embedSWF("/flash/fonts/museo500v2.swf", "swfNews", width, height, "7.0.0", "", flashvars, params, attributes);
	//}
	  //  );


		
		
		//$('.coreTitle').each(function() {
		//        $(this).attr({
		//            style: 'padding:0;margin:0'
		//        })
		//        $(this).flash({
		//        src: '/flash/fonts/museo500v2.swf',
		//        flashvars: {
		//            css: ['* {color:#00569F;font-size:22;letter-spacing: -1;width:240px;leading: -2;}'
		//				  , 'a:link { color: #00569F; text-decoration: none;}'
		//				  , 'a:hover{ color: #00569F; text-decoration: underline; }'].join(' ')
		//        }
		//    },
		//    {version: 7},function(htmlOptions) {
		//        $(this).attr({
		//            style: 'padding:0;margin:0 0 0 92px'
		//        })
		//        htmlOptions.flashvars.txt = this.innerHTML;
		//        this.innerHTML = '<span>' + this.innerHTML + '</span>';
		//        var $alt = $(this.firstChild);
		//        htmlOptions.wmode = 'transparent';
		//        htmlOptions.height = $alt.height() + 10;
		//		
		//        htmlOptions.width = $alt.width() + 10;
		//        $alt.addClass('sifr-alt');
		//		$(this).addClass('core-flash-replaced').prepend($.fn.flash.transform(htmlOptions));
		//            this.innerHTML == '';
		//        }
		//);



		//})
		
		
		
		
		//    $('#newsTab').flash({
	//        src: '/flash/fonts/museo500v2.swf',
	//        flashvars: {
	//            css: ['* {color: #ffffff;font-size:19;letter-spacing: -1;leading: 8;fontSize:19px}'
	//				  , 'a:link { color: #ffffff; text-decoration: none;font-size:19;margin-top:4}'
	//				  , 'a:hover { color: #ffffff; text-decoration: underline; }'].join(' ')
	//        }
	//    },
	//    {
	//        version: 7
	//    },
	//    function(htmlOptions) {
	//        $(this).attr({
	//            style: 'padding:0;margin:3px 0 0 4px;'
	//        })

	//        htmlOptions.flashvars.txt = this.innerHTML;
	//        this.innerHTML = '<span>' + this.innerHTML + '<span>';
	//        var $alt = $(this.firstChild);
	//        htmlOptions.wmode = 'transparent';
	//        htmlOptions.height = $alt.height() + 10;
	//        htmlOptions.width = $alt.width() + 10;
	//        $alt.addClass('sifr-alt');
	//        $(this)
	//                .addClass('tab-flash-replaced')
	//                .prepend($.fn.flash.transform(htmlOptions))
	//				.mouseover(function(event) {
	//				    $('#feed-blog').attr({ style: 'display:none' })
	//				    $('#feed-news').fadeIn('fast');

	//				})


	//}); 

	}
	else{
		$("#flash-home a,#flash-reel a").click(function(e){
		e.preventDefault;
		return false
		})
		$("#blogTab").mouseover(function(event) {
			$('#feed-news').attr({ style: 'display:none' })
			$('#feed-blog').fadeIn('fast');
		})
		$("#newsTab").mouseover(function(event) {
				$('#feed-blog').attr({ style: 'display:none' })
				$('#feed-news').fadeIn('fast');
				})
	}
}
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))
}
