
//-----------------------------
// $(document).ready() 
//-----------------------------
$(document).ready(function() {
	//$(".UIBtn").css('font-size', '10px').button();

	$("a.vidbox").fancybox({
		'padding': 0,
		'autoScale': false,
		'transitionIn' : 'elastic',
		'transitionOut' : 'elastic',
		'width' : 420,
		'height' : 320,
		'hideOnOverlayClick' : true,
		'hideOnContentClick' : false,
		'overlayOpacity' : 0.9,
		'overlayColor' : '#000000',
		'titlePosition' : 'outside',
		'showCloseButton' : true,
		'showNavArrows' : true, 
		'type' : 'swf',
		'swf' : {
			'wmode' : 'transparent',
			'background-color' : 'red',
			'allowfullscreen' : 'true'
		}
	});

	$('a.blockContent').click(function() { 
		$('#UIModalContent').dialog('destroy').html('Form Loading.  Please Wait.').dialog({
			title: "Quick Contact", modal: true, width: 600, height: 400, resizable: false,
			buttons:{"Close": function() { $(this).dialog("close"); }},
			open: function(event, ui) {
				//$(this).dialog( "option", "position", 'center' );
				$(this).parent().css("left",($(window).width()-$(this).width())/2+"px");
				$(this).parent().css("top",($(window).height()-$(this).height())/2-50+"px");
				$(this).attr("uimtop",$(this).parent().offset().top-$(window).scrollTop()).attr("uimleft",$(this).parent().offset().left);
			},
			dragStop: function(event, ui){
				$(this).attr("uimtop",$(this).parent().offset().top-$(window).scrollTop()).attr("uimleft",$(this).parent().offset().left);
			}
		});
		$.ajax({
			url: "/AJAX/quick_contact.cfm",
			data: "sendToURL="+this.href, 
			cache: false,
			type: "POST",
			async: true,
			success: function(html){ 
				$('#UIModalContent').html(html).dialog({
					title: "Quick Contact", modal: true, width: 600, height: 440, resizable: false,
					buttons:{"Close": function() { $(this).dialog("close"); }},
					open: function(event, ui) {
						//$(this).dialog( "option", "position", 'center' );
						$(this).parent().css("left",($(window).width()-$(this).width())/2+"px");
						$(this).parent().css("top",($(window).height()-$(this).height())/2-50+"px");
						$(this).attr("uimtop",$(this).parent().offset().top-$(window).scrollTop()).attr("uimleft",$(this).parent().offset().left);
					},
					dragStop: function(event, ui){
						$(this).attr("uimtop",$(this).parent().offset().top-$(window).scrollTop()).attr("uimleft",$(this).parent().offset().left);
					}
				});
			}
		});
	});
	
	changeHero(0);
});

