﻿
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 () {
    $("h2.title .cufon").height($("h2.title .cufon").height() - 10);
    $("h2.title2 .cufon").height($("h2.title2 .cufon").height() - 10);
});

//$(document).ready(function () {
//    //if ($('.who-we-are ul').length == 0) {
//    $('.who-we-are').find('ul').hide();
//    $('.who-we-are').find('ul').each(function (i) {
//        var me = $(this);

//        //setTimeout(function () { $(me).show("slide", { direction: "right" }, 800); }, 300 * i);

//        setTimeout(function () {
//            $(me).show("slide", { direction: "right", easing: 'easeOutBounce' }, 600);
//            //$(me).animate({ right: 200 }, { duration: 'slow', easing: 'easeOutBounce' });
//        }, 600 * i);

//    });

//    //  }
//});

$(document).ready(function () {
    $('.galImg a').colorbox({ rel: 'group1' });
    $('.galImg a.frame').colorbox({ rel: 'group1', transition: 'none', showFrame: true });
	if ($("ul.imgGal li").length < 3) {
		$("ul.imgGal li:nth-child(2n)").addClass("lastwide")
	} else {
		$("ul.imgGal li:nth-child(2n)").addClass("middle")
	    $("ul.imgGal li:nth-child(3n)").addClass("last");
	}
});

