function ajax360PreloaderRun(iProductID){
/* Get Div Height */
imageDivHeight = $("#ajax360PreloaderInitImage").height();
$("#ajax360PreloaderFlash").hide();
ajax360PreloaderLoader("showLoader");
$("#ajax360PreloaderFlash").load("../jquery/shopping/ajax360Preloader.cfm", {iProductID:iProductID},
function(){setTimeout(function () {ajax360PreloaderLoad360(imageDivHeight);ajax360PreloaderLoader("hideLoader");}, 3000);
});
}
function ajax360PreloaderLoad360(imageDivHeight){
	// $("#ajax360PreloaderFlash").height(imageDivHeight);
	$("#ajax360PreloaderInitImage").fadeOut(function(){
		$("#ajax360PreloaderFlash").fadeIn('slow');
		ajax360PreloaderLoadButton("switchToImage");
	});
}
function ajax360PreloaderLoadInitImage(imageDivHeight){
	$("#ajax360PreloaderInitImage").height(imageDivHeight);
	$("#ajax360PreloaderFlash").fadeOut(function(){
		$("#ajax360PreloaderInitImage").fadeIn('slow');
		ajax360PreloaderLoadButton("switchTo360");
	});
}
function ajax360PreloaderLoader(Loader){
	if (typeof(Loader) != 'undefined' && Loader == 'showLoader'){
		$("#ajax360PreloaderChanger").html("<div id='ajax360PreloaderLoader' style='display: none;'></div>");
		$("#ajax360PreloaderLoader").fadeIn();
	}else if (typeof(Loader) != 'undefined' && Loader == 'hideLoader'){
		$("#ajax360PreloaderLoader").fadeOut(function(){
			$("#ajax360PreloaderChanger").html();
		});
	}
}
function ajax360PreloaderLoadButton(buttonType){
	if (typeof(buttonType) != 'undefined' && buttonType == 'switchTo360'){
		$("#ajax360PreloaderChanger").html("<input type='button' class='button' value='Click To View Rotation' onclick='ajax360PreloaderLoad360(imageDivHeight)' style='border: 1px solid #333; background-color: #EEE;'/>").fadeIn();
	}else if (typeof(buttonType) != 'undefined' && buttonType == 'switchToImage'){
		$("#ajax360PreloaderChanger").html("<input class='button' type='button' value='Click To View Images' onclick='ajax360PreloaderLoadInitImage(imageDivHeight)' style='border: 1px solid #333; background-color: #EEE;'/>").fadeIn();
	}
}

