﻿
    function openPopup(url,w,h) {
        width = w;
        height = h;
        x = parseInt(screen.width / 2.0) - (width / 2.0);
        y = parseInt(screen.height / 2.0) - (height / 2.0);

        var win = window.open(url, "editorPopup", "top=" + y + ",left=" + x + ",scrollbars=no,dialog=yes,minimizable=no,modal=yes,width=" + width + ",height=" + height + ",resizable=no");
    }

    function deleteZoneContent(ZoneAreaVal, PageIDVal) {

        $.ajax({
            type: "POST",
            url: "/admin/DeleteContent.asmx/DeleteZone",
            data: "{'ZoneArea': " + ZoneAreaVal + ", 'PageID': " + PageIDVal + "}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                alert("Content has been removed from this area.");
                window.location.reload(true);
            }
        });

    }

    function OnComplete(args) {
        alert(args);
    }

    function OnTimeOut(args) {
        alert("ERROR : Service call timed out. Possbily content area has no content.");

    }

    function OnError(args) {
        alert("Error calling service method.");
    }

    $(document).ready(function () {
        $('.galImg a').colorbox({ rel: 'group1' });
        $("div#gallery div:nth-child(5n)").addClass("last")
		$("a[rel='advertgallery']").colorbox({scalePhotos: true, maxWidth:800, maxHeight: 600});
    });
	
	$(function() {
		if ($.browser.msie) {
			if (parseInt($.browser.version, 10) == 7) {
				var zIndexNumber = 1000;
				$("#menusocial ul.mainMenu li").each(function() {
					$(this).css('zIndex', zIndexNumber);
					zIndexNumber -= 10;
				});
				
				$("#menusocial ul.mainMenu li").hover(
				function() {
					$(this).css('zIndex', 1110);
				},
				function () {
				    $("#menusocial ul.mainMenu li").each(function() {
						$(this).css('zIndex', zIndexNumber);
						zIndexNumber -= 10;
					});
				  }
				);
				
				$("#menusocial ul.mainMenu li ul li").hover(
				function() {
					$(this).parent().parent().css('zIndex', 1110);
				}, function() {
					$(this).parent().parent().css('zIndex', 1110);
				}
				);
			}
		}
	});

