/*
* name: ui.global.js
* author: RAJF
* notes: global ui functions and config
*/

/*
* ## INTERNAL VARS ##
*/
var _debug;
var _arrowLocation;
var _params = {};
var _attributes = {};
var _flashFileUrl;
var _ie6;
/*
* ## END INTERNAL VARS ##
*/

/*
* ## CONFIG ##
*/
// Log to Firebug Console, set to false for Live!
_debug = true;
_imageLocation = "img/";
_flashLocation = "_temp/";
// cookie name
_cookiename = "panelSettings"
/* swf object */
_params.scale = "noscale";
_params.salign = "tl";
_params.swliveconnect = "true";
_params.allowscriptaccess = "always";
_params.wmode = "opaque";
/*
* ## END CONFIG ##
*/

/*
* window onload function
*/
$(function(){

	$(".player, .module").corner("bottom");

	// custom font
	Cufon.replace('#primary-nav a', { fontFamily: 'Alstom' });
	
//	swfobject.embedSWF(_flashLocation + "media_player.swf", "player", "568", "516", "9.0.0", false);
	
	$(".player .video-info").collapsable({
		actionElement:"h3"
	});
	
  /* Phase 2 */  
  $("#related-videos").fsAccordian({ 
    actionElement: "h2",
    animate: true,
    containerElement: 'ul',
    objectArray: $('#most-viewed')
  });

  /* Phase 2 */  
  $(".video-list li").fsPreviewBox({
    animate: true
  });

  /* Phase 2 */  
  $(".thumb li").fsPreviewBox({
    animate: true
  });

});

// log to firebug console
function debug(message)
{
	if(_debug) if (window.console) console.log(message);
}

/*
* open windows in external window
*/ 
function setLinkRel()
{
  $('a[rel="external"]').click( function() {
      window.open( $(this).attr('href') );
      return false;
  });
}

// blurring on DHTML elements which shouldn't have the dotted outline
// use: $('a.noblur').nb();
$.fn.nb = function() {
	return this.focus(function(){
	this.blur()
	});
}
