﻿// <!CDATA[
function ShowModal() { var obj = GetObj("ModalDialog"); if (obj) { obj.style.display = ""; } }
function HideModal() { var obj = GetObj("ModalDialog"); if (obj) { obj.style.display = "none"; } }
function position() {
    if (!((navigator.appName.indexOf("Netscape") != -1) && (navigator.appVersion.indexOf("Mac") != -1))) {
        var cx = (screen.availWidth / 2) - (455 / 2);
        var cy = (screen.availHeight / 2) - (669 / 2);
        window.moveTo(cx, cy);
    }
}
function GetSpecialPromotion() {
    window.open('Media/Promotions/GrooveCruise.htm', "GrooveCruise", 'width=475,height=750');
}
function GetUpcomingEventPromotion() {
    window.open('Media/Promotions/11.14.2009.htm', "BarNinety", 'width=850,height=500');
}
function OnVideoHD(arg) {
    window.open('http://zenbi.com/VidHD/ZenbiHD' + arg + '.htm', 'ImageViewer', 'resizable=yes,width=1280,height=800');
}
function AX_Gallery01(arg) {
    window.open('http://zenbi.trainingcamp.com/ImageViewer.aspx?id=' + arg, 'ImageViewer', 'resizable=yes,width=1000,height=800');
}
function InitializeGuestList(arg) {
    window.open('http://zenbi.trainingcamp.com/Gl/__GuestListRegistrationWebForm.aspx?id=' + arg, 'GuestList', 'resizable=no,width=940,height=700,location=no');
}
function ShowGallery() {
    window.open('ZGallery/', 'KarbokaneGallery', 'resizable=yes,width=1100,height=800');
}
var AppWindow;
function ApplicationWindow() {
    this.url = "ViewMedia.aspx?";
    this.width = "600";
    this.height = "400";
    this.features = "status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=" + this.width + "height=" + this.height;
}
ApplicationWindow.prototype.GetUrl = function (type, index) {
    return this.url + "Type=" + type + "&Index=" + index;
}
ApplicationWindow.prototype.GetFeatures = function () { return this.features; }

function InitializeFlyer(arg) {
    var app = new ApplicationWindow;
    AppWindow = window.document.open(
				app.GetUrl("Flyers", arg),
				"WinForm",
				app.GetFeatures()
			);
    app = null;
}
function InitializeArticle(arg) {
    var app = new ApplicationWindow;
    AppWindow = window.document.open(
				app.GetUrl("Articles", arg),
				"WinForm",
				app.GetFeatures()
			);
    app = null;
}

function bookmarksite(title, url) {
    if (document.all) {
        window.external.AddFavorite(url, title);
    } else if (window.sidebar) {
        window.sidebar.addPanel(title, url, "");
    }
}

var sndCloudWin;
function ShowSoundCloud() {
    sndCloudWin = window.open('playerSCloud.aspx', "SCloud", 'width=500,height=360');
    var x = ((f_clientWidth() / 2) - (500 / 2));
    var y = ((f_clientHeight() / 2) - (360 / 2));
    sndCloudWin.moveTo(x, y);
}
function Maximize() {
    if (!((navigator.appName.indexOf("Netscape") != -1) && (navigator.appVersion.indexOf("Mac") != -1))) {
        try {
            //Run some code here
            window.moveTo(0, 0);
            window.resizeTo(screen.availWidth, screen.availHeight);
            window.document.body.focus();
            return SetDimensions();
        }
        catch (err) {
            //Handle errors here
            Maximize();
        }

    } return true;
}
function OnResizeHandler() {
    //alert("Height:" + f_clientHeight());
    var h = parseInt(f_clientHeight());
    if (h < 800) {
        //ToggleBodyScroll("");
    } else {
        //ToggleBodyScroll("hidden");
    }
    //SetDimensions();
}
function ToggleBodyScroll(arg) {
    document.getElementsByTagName("html")[0].style.overflow = document.getElementsByTagName("body")[0].style.overflow = arg; return true;
}
function SetDimensions() {
    var obj = GetObj("divFlashContent"); if (document.body.clientHeight < 800) {
    //alert(document.body.clientHeight);    
        obj.style.height = "1000px";
     } return true;
}
function GetObj(obj) { var theObj; if (!document.getElementById | document.all) { return; } else { if (document.getElementById) { theObj = eval("document.getElementById('" + obj + "')"); } else { theObj = eval("document.all." + obj); } } return theObj; }
function f_clientWidth() { return f_filterResults(window.innerWidth ? window.innerWidth : 0, document.documentElement ? document.documentElement.clientWidth : 0, document.body ? document.body.clientWidth : 0); }
function f_clientHeight() { return f_filterResults(window.innerHeight ? window.innerHeight : 0, document.documentElement ? document.documentElement.clientHeight : 0, document.body ? document.body.clientHeight : 0); }
function f_filterResults(n_win, n_docel, n_body) { var n_result = n_win ? n_win : 0; if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel; return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result; }



