function bindTabs(tabDiv, contentDiv) {
  //alert("tabDiv.selector="+tabDiv.selector+" and contentDiv.selector="+contentDiv.selector);
  tabDiv.find("li > a").click(function(){
    tabDiv.find("li").toggleClass("on");
    contentDiv.children("div:not(.clearer)").each(function() {
      var cElem = this;
      alert ("cElem is hidden? " + $(cElem).is(":hidden") + " and the id is " + $(cElem).attr("id"));
      if ( $(cElem).is(":hidden") ) {
        $(cElem).show();
      } else if ( $(cElem).is(":visible") ) {
        $(cElem).hide();
      } else {
        $(cElem).hide();
      }
    });
    return false;
  });
}



$(document).ready(function($){
  Shadowbox.init({
        //skipSetup: true,
        language:     'en',
        players:     ['flv','img','iframe','html','swf','qt','wmv'],
        flashParams: {allowfullscreen:'true'},
        flashVars:   {controlbar:'over'}
      });
  // clears hint text from global search - http://plugins.jquery.com/project/clearinginput
  $('#globalSearch').clearingInput(); // Input value 'tip: use quotes around phrases'
  //var keywords = $('#keywords').clearingInput({text: keywords.val()});
  if ($('#keywords').val() == '') {
    $('#keywords').clearingInput();
  }

  // use the jquery.flash 606 to embed flash, content embedded via client
  $('span.video').each(function(){
    // get file extension
    var filePath = $(this).find('a').attr('href');
    var dot = $(this).find('a').attr('href').lastIndexOf(".");
    var extension = filePath.substr(dot,filePath.length);
    
    if (extension == ".flv") {
	    $(this).flash({
	        src: "/shadowbox-simplicis/libraries/mediaplayer/player.swf",
	        width: 490,
	        height: 450,
	        flashvars: { file: $(this).find('a').attr('href') }
	      });
    } else {
      $(this).flash({
        src: $(this).find('a').attr('href'),
        width: 490,
        height: 450,
        flashvars: { file: $(this).find('a').attr('href') }
      });
    }
    // hide the orginal link which has been moved into div.alt
    $(this).find('.alt').hide();
  });

  $("span.popupVideo a, span.popupVideoImage a").click(function(){
  	
  	// get file extension and set popup to file type
  	var filePath = $(this).attr("href");
  	var dot = $(this).attr("href").lastIndexOf(".");
  	var extension = filePath.substr(dot,filePath.length);
  	
  	if (extension == ".swf") {
	    // (Shadowbox.plugins.fla) ? 'flv' : 'unsupported-flv'
	    Shadowbox.open(
	    {
	    title: $(this).text(),
	    player: 'swf',
	    content: $(this).attr('href'),
	    height: 450,
	    width: 490
	    });
  	} else {
  		// flv file type 
	    Shadowbox.open(
	    {
	    title: $(this).text(),
	    player: (Shadowbox.plugins.fla) ? 'flv' : 'unsupported-flv',
	    content: $(this).attr('href'),
	    height: 450,
	    width: 490
	    });
  	} 
    return false;
  });

});