function addNewBox() {
    jQuery('#addBox1').click
	(
	 	function () {
	 	    jQuery.blockUI
			(
			 	{
			 	    message: $('#addNewbox1'), centerY: ($.browser.msie && parseInt($.browser.version) === 6) ? false : true ? false : true,
			 	    css:
					{
					    border: 'none',
					    padding: '0',
					    top: (jQuery(window).height() - 647) / 2 + 145 + 'px',
					    left: (jQuery(window).width() - 647) / 3 - 28 + 'px',
					    backgroundColor: 'transparent',
					    color: '#000',
					    position: 'absolute'
					}
			 	}
			   );
	 	}
		);
    jQuery('#addBox2').click
		(
			function () {
			    jQuery.blockUI
				 (
					{
					    message: $('#addNewbox2'), centerY: ($.browser.msie && parseInt($.browser.version) === 6) ? false : true ? false : true,
					    css:
						{
						    border: 'none',
						    padding: '0',
						    top: (jQuery(window).height() - 647) / 2 + 145 + 'px',
						    left: (jQuery(window).width() - 647) / 3 - 28 + 'px',
						    backgroundColor: 'transparent',
						    color: '#000',
						    position: 'absolute'
						}
					}
					);
			}
			);
		
		jQuery('#img_popup').click
		(
			function()
			{
				 jQuery.blockUI
				 (
					{ 
						message: $('#img_pop_box'),centerY: ($.browser.msie && parseInt($.browser.version) === 6) ? false : true ? false : true,
						css:
						{
							border: 'none',
							padding: '0',
							top:  (jQuery(window).height() - 647) /2 +145 + 'px', 
							left: (jQuery(window).width() - 647) /2 -28 + 'px',
							backgroundColor: 'transparent',
							color: '#000',
							position: 'absolute'
						}
					  }
					);
			    }
			);
		
		jQuery('#video_popup').click
		(
			function()
			{
				 jQuery.blockUI
				 (
					{ 
						message: $('#video_pop_box'),centerY: ($.browser.msie && parseInt($.browser.version) === 6) ? false : true ? false : true,
						css:
						{
							border: 'none',
							padding: '0',
							top:  (jQuery(window).height() + 50) + 'px', 
							left: (jQuery(window).width() - 647) /2 -28 + 'px',
							backgroundColor: 'transparent',
							color: '#000',
							position: 'absolute'
						}
					  }
					);
			    }
			);

    jQuery('#img_popup').click
		(
			function () {
			    jQuery.blockUI
				 (
					{
					    message: $('#img_pop_box'), centerY: ($.browser.msie && parseInt($.browser.version) === 6) ? false : true ? false : true,
					    css:
						{
						    border: 'none',
						    padding: '0',
						    top: (jQuery(window).height() - 647) / 2 + 145 + 'px',
						    left: (jQuery(window).width() - 647) / 2 - 28 + 'px',
						    backgroundColor: 'transparent',
						    color: '#000',
						    position: 'absolute'
						}
					}
					);
			}
			);

    jQuery('#video_popup').click
		(
			function () {
			    jQuery.blockUI
				 (
					{
					    message: $('#popcontrol_box'), centerY: ($.browser.msie && parseInt($.browser.version) === 6) ? false : true ? false : true,
					    css:
						{
						    border: 'none',
						    padding: '0',
						    top: (jQuery(window).height() + 50) + 'px',
						    left: (jQuery(window).width() - 647) / 2 - 28 + 'px',
						    backgroundColor: 'transparent',
						    color: '#000',
						    position: 'absolute'
						}
					}
					);
			}
			);

jQuery('#popcontrol_box_link').click
		(
			function () {
			    jQuery.blockUI
				 (
					{
					    message: $('#popcontrol_box'), centerY: ($.browser.msie && parseInt($.browser.version) === 6) ? false : true ? false : true,
					    css:
						{
						    border: 'none',
						    padding: '0',
						    top: (jQuery(window).height() + 50) + 'px',
						    left: (jQuery(window).width() - 647) / 2 - 28 + 'px',
						    backgroundColor: 'transparent',
						    color: '#000',
						    position: 'absolute'
						}
					}
					);
			}
			);

}


function CallPopupBlockUI(height) {
    jQuery.blockUI
				 (
					{
					    message: $('#popcontrol_box'), centerY: ($.browser.msie && parseInt($.browser.version) === 6) ? false : true ? false : true,
					    css:
						{
						    border: 'none',
						    padding: '0',
						    top: (jQuery(window).height() / 2 - 300) + 'px',
						    left: (jQuery(window).width() - 647) / 2 - 28 + 'px',
						    backgroundColor: 'transparent',
						    color: '#000',
						    position: 'absolute'
						}
					}
					);

}


function displayPopup(url, height, width) {

    if (!height || height == 0) {
        height = 400;
    }

    if (!width || width == 0) {
        width = 400;
    }

    var fullUrl = url + '?iframe=true&width=' + width + '&height=' + height;
    //alert(fullUrl);
    jQuery.prettyPhoto.open(fullUrl);
    
    /*var popupLink = $('#popcontrol_box_link').get(0);

    if (popupLink != null) {
        CallPopupBlockUI(height);
    }

    $('#popupIframe').attr('src', url);


    if (height > 0) {
        $('#popupIframe').css('height', height); 
      
    }
    else {
        $('#popupIframe').css('height', 300);
    }

    //var iframeItem = $('#popupIframe').get(0);
    //iframeItem.location.reload();*/
    
}

(function ($) {
    jQuery(function () {
        jQuery(".galleryImage").click(function () {
            var image = $(this).attr("rel");
            var link = $(this).attr("relAddt");
            var alt = $(this).attr("alt");
            $('.galleryMainImage').hide();
            $('.galleryMainImage').show();
            $('.galleryMainImage').attr('src', image);
            $('.galleryMainImage').attr('alt', alt);
            $('.galleryMainImageLink').attr('href', link);
            return false;
        });
    });

    jQuery(document).ready(function () {
       jQuery("a[rel^='prettyPhoto']").prettyPhoto({ theme: 'light_square' });
    });
})(jQuery);



