$(document).ready(function() {
	// fancybox

	$(".iFrameBox").fancybox({
		'width'				: 540,
		'height'			: 470,
		'autoScale'			: false,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe',
		'titleShow'			: 'false'
	});
	$(".sitemap").fancybox({
		'width'				: 830,
		'height'			: 500,
		'autoScale'			: false,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe',
		'titleShow'			: 'false',
		'centerOnScroll'	: 'true'
	});
	
	// message box
	$('#MessageBox').animate({opacity:0},{queue: false, duration: 10});
	// scroll the message box to the top offset of browser's scroll bar
	$('#MessageBox').animate({top:$(window).scrollTop()+"px",opacity:0.9 },{queue: false, duration: 350});
	$(window).scroll(function(){
		$('#MessageBox').animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350});
	});
	$('#MessageBox').mouseover(function(){
		$('#MessageBox').animate({opacity:1},{queue: false, duration: 350});
	});
	$('#MessageBox').mouseout(function(){
		$('#MessageBox').animate({opacity:0.9},{queue: false, duration: 350});
	});
	// when the close button at right corner of the message box is clicked
	$('#MessageBox #Close').click(function(){
		$('#MessageBox').animate({top:"-=30px",opacity:0}, "slow");
		$('#MessageBox').hide("slow");
	});
});
function popImage(imageURL,imageTitle){
	$("body").append("<a id='popImage' href="+imageURL+" title="+imageTitle+"></a>");
	$("#popImage").fancybox({
		'callbackOnClose':function(){
			$("#popImage").remove();
		}
	}).trigger('click');
};
/*
for autoload :
javascript -> document.ready :
$("#autostart").fancybox({'frameWidth':500,'frameHeight':300}).trigger('click');
body :
<a id="autostart" href="#inline"></a>
<div id="inline" style="display:none;">qsdf</div>
*/
