/**
* Convert links to strand charts to thickbox formatted tags
* @requires jquery.js
* @requires thickbox-href-creator.js
* @author Sunil Jolly
**/

var StrandTableThickboxLinks = function() {
	
	//the thickbox configuration
	var CONST_HEIGHT_MARGIN = 120;
	var CONST_WIDTH_MARGIN = 80;

	function createPopUpLinks() {
		$('.thickbox').each(function() {
					if(!$(this).hasClass('.no-layout')) {				
						var href = $(this).attr("href");
						$(this).attr("href", "/layout/set/ajax" + href + "?popUp=true" + ThickBoxHrefCreator.get('ajax'));
					}
										 });
									 
					
	}

	//initThickBox here instead of cwa.thickbox.js due to ie6 bug
	function initThickBox() {
		tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
		imgLoader = new Image();// preload image
		imgLoader.src = tb_pathToImage;
	}

	return {
		//initialiser
		init : function() {
			createPopUpLinks();
			initThickBox();
			
		}
		
	};
	
}();


function onThickBoxOpened() {
	$('.flash-widget').hide();
}

function onThickboxClosed() {
	$('.flash-widget').show();
}