function showVideo(id) {
	document.write("<object width=\"292\" height=\"225\"><param name=\"movie\" value=\"http://www.youtube.com/v/"+id+">&amp;hl=en&amp;fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/"+id+"&amp;hl=en&amp;fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"292\" height=\"225\"></embed></object>");
}

/* Tabs Slider */
jQuery(function(){
	$slideshow = {
		context: false,
		tabs: false,
		timeout: 3000,      // time before next slide appears (in ms)
		slideSpeed: 1000,   // time it takes to slide in each slide (in ms)
		tabSpeed: 500,      // time it takes to slide in each slide (in ms) when clicking through tabs
		fx: 'fade',   // the slide effect to use - http://malsup.com/jquery/cycle/options.html

		init: function() {
			this.context = $('#tabsSlider');
			this.tabs = $('#tabsNav li', this.context);
			this.tabs.remove();
			this.prepareSlideshow();
			this.fillEmptyGap();
		},

		prepareSlideshow: function() {
			$('#tabsSlides > ul', $slideshow.context).cycle({
				fx: $slideshow.fx,
				timeout: $slideshow.timeout,
				speed: $slideshow.slideSpeed,
				fastOnEvent: $slideshow.tabSpeed,
				pager: $('#tabsNav', $slideshow.context),
				pagerAnchorBuilder: $slideshow.prepareTabs,
				before: $slideshow.activateTab,
				pauseOnPagerHover: true,
				pause: true
			});
		},

		prepareTabs: function(i, slide) {
			return $slideshow.tabs.eq(i);
		},

		fillEmptyGap: function() {
			// fill possibly empty gap in the end
			var tabsLiWidths = 0,
				tabsUl = $('#tabsNav').outerWidth(true);

			$('#tabsNav li').each(function() {
				tabsLiWidths += $(this).outerWidth(true);
			});

			var fillWidth = tabsUl - tabsLiWidths;

			$('#tabsNav').append('<span class="fill">&nbsp;</span>');
			$('#tabsNav span.fill').css('width',fillWidth);
		}
		
	};
	
	$('body').addClass('js');
	
	$slideshow.init();
	
});
/* End Tabs Slider */

var arrowimages={down:['downarrowclass', '', 0], right:['rightarrowclass', '']}

var jqueryslidemenu={

animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds

buildmenu:function(menuid, arrowsvar){
	jQuery(document).ready(function($){
		var $mainmenu=$("#"+menuid+">ul")
		var $headers=$mainmenu.find("ul").parent()
		$headers.each(function(i){
			var $curobj=$(this)
			var $subul=$(this).find('ul:eq(0)')
			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
			this.istopheader=$curobj.parents("ul").length==1? true : false
			$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
			$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
				'<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])
				+'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])
				+ '" style="border:0;" />'
			)
			$curobj.hover(
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					this._offsets={left:$(this).offset().left, top:$(this).offset().top}
					var menuleft=this.istopheader? 0 : this._dimensions.w
					menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
					if ($targetul.queue().length<=1) //if 1 or less queued animations
						$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over)
				},
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					$targetul.slideUp(jqueryslidemenu.animateduration.out)
				}
			) //end hover
			$curobj.click(function(){
				$(this).children("ul:eq(0)").hide()
			})
		}) //end $headers.each()
		$mainmenu.find("ul").css({display:'none', visibility:'visible'})
	}) //end document.ready
}
}

//build menu with ID="myslidemenu" on page:
jqueryslidemenu.buildmenu("tcsmenu", arrowimages)
