var frameWidth = 640;
var frameHeight = 490;

var wideFrameWidth = 1024;
var wideFrameHeight = 605;

var widerFrameWidth = 700;
var widerFrameHeight = 500;

$(document).ready(function() {

	
	$("a.iframelogin").fancybox({ 
		'width'				: 300,
		'height'			: 110,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false			
	}); 
	
	
	$("a.iframe").fancybox({ 
		'width'				: frameWidth,
		'height'			: frameHeight,
		'autoDimensions'	: false,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false			
	}); 

	$("a.iframerefresh").fancybox({ 
		'width'				: frameWidth,
		'height'			: frameHeight,
		'autoDimensions'	: false,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false,
		'onClosed': refreshWindow
	});

	$("a.iframeresubmit").fancybox({ 
		'width'				: frameWidth,
		'height'			: frameHeight,
		'autoDimensions'	: false,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false,
		'onClosed': resubmitForm
	});

	$("a.iframesmall").fancybox({ 
		'width'				: 500,
		'height'			: 300,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false			
	});
	
	$("a.iframesmaller").fancybox({ 
		'width'				: 270,
		'height'			: 230,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false			
	}); 

	$("a.iframenotifications").fancybox({ 
		'width'				: 300,
		'height'			: 110,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false,
		'onClosed': refreshWindow		
	}); 
	

	$("#checkAll").click(function() {
		var checked_status = this.checked;
	   	$(".checkbox").each(function(){
	    	this.checked = checked_status;
	   	});
	});

	$("a.iframewider").fancybox({ 
		'width'				: widerFrameWidth,
		'height'			: widerFrameHeight,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titleShow'			: false,
		'type'				: 'iframe'
	}); 
	
	$("a.iframewide").fancybox({ 
		'width'				: wideFrameWidth,
		'height'			: wideFrameHeight,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titleShow'			: false,
		'type'				: 'iframe'
	}); 

	$("a.iframewiderefresh").fancybox({ 
		'width'				: wideFrameWidth,
		'height'			: wideFrameHeight,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false,
		'onClosed': refreshWindow
	});

	$("a.iframewideresubmit").fancybox({ 
		'width'				: wideFrameWidth,
		'height'			: wideFrameHeight,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false,
		'onClosed': resubmitForm
	});
});

function refreshWindow() {
	if (document.form1.hiddenChanges) {
		document.form1.hiddenChanges.value = 0;
	}
	$("#overlay-div").css('opacity', '0.3').show();
	window.location = window.location.href.replace(/#.*$/,"");
}

function resubmitForm() {
	$("#overlay-div").css('opacity', '0.3').show();
	document.form1.hiddenKeepScroll.value = 1;
	document.form1.submit();
}
