/*****************************************************************
 * flashLightBoxInjector - REBUILT FOR JQUERY
 *****************************************************************/
 
/*
function loadjscssfile(filename, filetype){
	if (filetype=="js"){ //if filename is a external JavaScript file
		var fileref=document.createElement('script')
		fileref.setAttribute("type","text/javascript")
		fileref.setAttribute("src", filename)
	}
 	else if (filetype=="css"){ //if filename is an external CSS file
  		var fileref=document.createElement("link")
 		 fileref.setAttribute("rel", "stylesheet")
  		fileref.setAttribute("type", "text/css")
  		fileref.setAttribute("href", filename)
 	}
 	if (typeof fileref!="undefined")
  	document.getElementsByTagName("head")[0].appendChild(fileref)
}

loadjscssfile("/bv/CC/_shared/fancybox/jquery.fancybox-1.3.1.js", "js") 
loadjscssfile("/bv/CC/_shared/fancybox/jquery.fancybox-1.3.1.css", "css") 
*/


function FLBinitialize() {
	//not called for some reason
}

function FLBreset() {
	$("#flashLightBoxInjectionBox").html("");
}

function FLBappendElement(link, title, id, setId) {
	$("#flashLightBoxInjectionBox").append('<a href="' + link + '" href="' + link + '" id="' + id + '" rel="fancybox"></a>');
}

function FLBupdateImageList() {
	$("#flashLightBoxInjectionBox a").fancybox({
		'margin'		: 0,
		'padding'		: 0,
		'autoscaling'	: false,
		'overlayColor' 	: '#333333',
		'overlayOpacity' : 0.5
	});
}

function FLBstart(id) {	
	idx = id.split("photoFrame").join("");
	flashLightBoxInjectorCURRENT = idx;
	$("#flashLightBoxInjectionBox a").eq(idx).click();
}

function FLBupdateFlashGallery() {	
}
		
function flashLightBoxInjector() {
}


flashLightBoxInjector.prototype.initialize=FLBinitialize;
flashLightBoxInjector.prototype.reset=FLBreset;
flashLightBoxInjector.prototype.appendElement=FLBappendElement;
flashLightBoxInjector.prototype.updateImageList=FLBupdateImageList;
flashLightBoxInjector.prototype.updateFlashGallery=FLBupdateFlashGallery;
flashLightBoxInjector.prototype.start=FLBstart;

var flashLightBoxInjectorCURRENT;

function updateFlashGallery(){
  	/*
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	if (isIE){
    	return [currentIndex + "," +lightboxState];
	}else{
     	getFlashMovie("bodycopy_CarChapter_swf").updateGallery(unescape(flashLightBoxInjectorCURRENT))
	}
	*/
}


$(document).ready(function() {
	$("body").append("<div id='flashLightBoxInjectionBox' style='display:none;'></div>");
	myFlashLightBoxInjector = new flashLightBoxInjector();
});

