root = location.hostname.match(/trilogylab.com/i) ? '' : '/trilogylab';


if(window.swfobject) {
//	swfobject.embedSWF("flash/banner.swf", "flashcontent", "592", "213", "9.0.0", "flash/expressInstall.swf");
	swfobject.embedSWF(root+"/flash/globe.swf", "flash-globe", "55", "55", "9.0.0", root+"/flash/expressInstall.swf", '',{'wmode':'transparent'});
}

(function($){
	
	function globalInit() {

		// add corner divs to all boxes
		
		$('.box').each( function() {
			tl = document.createElement('div');
			tr = document.createElement('div');
			bl = document.createElement('div');
			br = document.createElement('div');
			
			tl.className = 'tl';
			tr.className = 'tr';
			bl.className = 'bl';
			br.className = 'br';
			
			$box = $(this);
			$box.prepend(tr);
			$box.prepend(tl);
			$box.append(br);
			$box.append(bl);
		 } );
		
		
		// set up superfish menu
		$("ul.sf-menu")
			.supersubs({minWidth:2, maxWidth:30, extraWidth:0})
			.superfish({hoverClass:'sfHover', pathClass:'active', pathLevels:0, delay:200, animation:{opacity:'show'}, speed:'def', autoArrows:1, dropShadows:1})
//			.superfish_width_mod({ vertical:0, menuWidth:'100%', equalWidth:0, resizeSeps:0, resizeSubMenus:0 })
			.find('ul').bgIframe({top:'auto', left:'auto', width:'auto', height:'auto', opacity:0, src:'javascript:false;'});
			
		$("ul.sf-menu a.sf-with-ul").click( function() { return false; } );
			
			
		if( $('#yoo-slider-1').length>0 )
			new YOOslider('yoo-slider-1', '#yoo-slider-1 .slide', { layout: 'horizontal', sizeNormal: 132, sizeFull: 300 });

		
	}

	$.event.special.hover.delay = 100;
	$.event.special.hover.speed = 100;

	$(globalInit);
	
})(jQuery);
