/**jQuery.noConflict();***/
jQuery(document).ready(function ($) {
			$("a.fancybox_lrgimg").fancybox({
				'width': '600px',
				'overlayColor': '#000',
				'overlayOpacity': .6,
				'transitionIn': 'elastic',
				'transitionOut': 'elastic'
			});
			$("a.fancybox_story").fancybox({
				'width': 602,
				'height': 513,
				'overlayColor': '#000',
				'overlayOpacity': .6,
				'transitionIn': 'elastic',
				'transitionOut': 'elastic',
                'autoScale': 'true',
                'type': 'iframe'
			});
            $("a.fancybox_faq").fancybox({
				'width': 500,
				'height': 350,
				'overlayColor': '#000',
				'overlayOpacity': .6,
				'transitionIn': 'elastic',
				'transitionOut': 'elastic',
                'type': 'iframe'
			});
            $("a.fancybox_video").fancybox({
				'width': 520,
				'height': 370,
				'overlayColor': '#000',
				'overlayOpacity': .6,
				'transitionIn': 'elastic',
				'transitionOut': 'elastic',
                'type': 'iframe'
			});
            $("a.fancybox_confirm").fancybox({
				'overlayColor': '#000',
				'overlayOpacity': .6,
				'transitionIn': 'elastic',
				'transitionOut': 'elastic'
			});
});
 function showVideo(vid, vtype) {
	 createVideo(vid, 486, 412, 'videoContainer',vtype);
	 jQuery("#video").fancybox({
		 //'padding'			: 0,
		 //'showCloseButton'	: false,
		 //'autoDimensions'	 : true,
		 'overlayColor': '#000',
		 'overlayOpacity': .6,
		 'transitionIn': 'elastic',
		 'transitionOut': 'elastic',
		 'scrolling'		: 'no',
		 'titleShow'		: false,
		 'onStart'		: function() {
			jQuery("#BrightCovePlayer").show();
		 },
		 'onClosed'		: function() {
			jQuery("#BrightCovePlayer").hide();
		 }
	 });
	 jQuery("#video").trigger("click");
 }

 function createVideo(vid, width, height, vContainer, vtype) {
	 var params = {
			quality: "high",
			scale: "noscale",
			wmode: "window",
			bgcolor: "#FFFFFF",
			base: "http://admin.brightcove.com",
			seamlesstabbing: "false",
			allowFullScreen: "true",
			swLiveConnect: "true",
			allowscriptaccess: "always"
	 };
	 if(vtype == 'youtube'){
		 params = {
			quality: "high",
			scale: "noscale",
			wmode: "window",
			bgcolor: "#FFFFFF",
			base: "http://www.youtube.com",
			seamlesstabbing: "false",
			allowFullScreen: "true",
			swLiveConnect: "true",
			allowscriptaccess: "always"
		};
	 }
	 var flashvars = {
			'@videoPlayer': vid,
			playerID: "66754061001",
			domain: "embed"
	 };

	 var attributes = {
			id: vContainer,
			name: vContainer
	 };
	 if(vtype == 'youtube'){
		 swfobject.embedSWF("http://www.youtube.com/v/"+vid, vContainer, width, height, "9.0.124", "flash/expressInstall.swf", flashvars, params, attributes);
	 }else{
		 swfobject.embedSWF("http://c.brightcove.com/services/viewer/federated_f9/66754061001?isVid=1&publisherID=1213897989", vContainer, width, height, "9.0.124", "flash/expressInstall.swf", flashvars, params, attributes);
	 }
 }
