$(document).ready(function() {
	// fancybox
	$(".Fancy").fancybox();
	$(".iFrameBox").fancybox({
		'frameWidth': 800,
		'frameHeight': 470
	});
	$(".NewsletterBox").fancybox({
		'frameWidth': 400,
		'frameHeight': 130
	});
	$(".ContactBox").fancybox({
		'frameWidth': 700,
		'frameHeight': 370
	});
	$(".LiggingBox").fancybox({
		'frameWidth': 550,
		'frameHeight': 500
	});
	// 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(){
			$("#imgDimensions").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>
*/
