﻿//*******************************************************************************************************************************************************************************************************************************************************
// Data
//*******************************************************************************************************************************************************************************************************************************************************
var ex = '';

//*******************************************************************************************************************************************************************************************************************************************************
// showHide
//*******************************************************************************************************************************************************************************************************************************************************
function showHide(idecko) {
    el = document.getElementById(idecko).style;
    try {
        el.display = (el.display == 'block') ? 'none' : 'block';
    }
    catch (ex) { }
    return (el.display == 'block') ? false : true;
}

//*******************************************************************************************************************************************************************************************************************************************************
// ShowBlock
//*******************************************************************************************************************************************************************************************************************************************************
function ShowBlock(ideckoS, ideckoH) {
    try {
        elS = document.getElementById(ideckoS).style;
        elH = document.getElementById(ideckoH).style;
        elS.display = 'none'
        elH.display = 'block'
    }
    catch (ex) { }
}

//*******************************************************************************************************************************************************************************************************************************************************
// showHide
//*******************************************************************************************************************************************************************************************************************************************************
function HideBlock(ideckoS, ideckoH) {
    try {
        elS = document.getElementById(ideckoS).style;
        elH = document.getElementById(ideckoH).style;
        elS.display = 'block'
        elH.display = 'none'
    }
    catch (ex) { }
}

//*******************************************************************************************************************************************************************************************************************************************************
// GetWidth
//   This function is used to return current window Width.
//*******************************************************************************************************************************************************************************************************************************************************
function GetWidth() {
    var width = 0;
    try {
        if (self.innerHeight) {
            width = self.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientHeight) {
            width = document.documentElement.clientWidth;
        }
        else if (document.body) {
            width = document.body.clientWidth;
        }
    }
    catch (ex) { }
    return width;
}

//*******************************************************************************************************************************************************************************************************************************************************
// GetHeight
//   This function is used to return current window Height.
//*******************************************************************************************************************************************************************************************************************************************************
function GetHeight() {
    var height = 0;
    try {
        if (self.innerHeight) {
            height = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight) {
            height = document.documentElement.clientHeight;
        }
        else if (document.body) {
            height = document.body.clientHeight;
        }
    }
    catch (ex) { }
    return height;
}

//*******************************************************************************************************************************************************************************************************************************************************
// GetOverlayWidth
//*******************************************************************************************************************************************************************************************************************************************************
function GetOverlayWidth() {
    var width = 0;
    try {
        width = GetWidth();
        var scrW = window.screen.width;
        if (scrW > width) width = scrW;
    }
    catch (ex) { }
    return width;
}

//*******************************************************************************************************************************************************************************************************************************************************
// GetOverlayHeight
//*******************************************************************************************************************************************************************************************************************************************************
function GetOverlayHeight() {
    var height = 0;
    try {
        height = GetHeight();
        var scrH = screen.height;
        if (scrH > height) height = scrH;
        var height2 = f_clientHeight();
    }
    catch (ex) { }
    return height;
}

//*******************************************************************************************************************************************************************************************************************************************************
// GetGetOverlayLowWidth
//*******************************************************************************************************************************************************************************************************************************************************
function GetOverlayLowWidth() {
    var width = 0;
    try {
        width = GetWidth();
        var scrW = screen.width;
        if (scrW < width) width = scrW;
    }
    catch (ex) { }
    return width;
}

//*******************************************************************************************************************************************************************************************************************************************************
// GetGetOverlayLowHeight
//*******************************************************************************************************************************************************************************************************************************************************
function GetOverlayLowHeight() {
    var height = 0;
    try {
        height = GetHeight();
        var scrH = screen.height;
        if (scrHW < height) height = scrH;
    }
    catch (ex) { }
    return height;
}



//*******************************************************************************************************************************************************************************************************************************************************
// BodyOnLoad
//   This function acts on body load.
//*******************************************************************************************************************************************************************************************************************************************************
function BodyOnLoad() {
    try {
        var wid = GetWidth();
        var hei = GetHeight();
        var iq = 0;
    }
    catch (ex) {
    }
}

//*******************************************************************************************************************************************************************************************************************************************************
// BodyOnInit
//   This function acts on body load.
//*******************************************************************************************************************************************************************************************************************************************************
function BodyOnInit() {
    try {
        var wid = GetWidth();
        var hei = GetHeight();
        var iq = 0;
    }
    catch (ex) {
    }
}

//*******************************************************************************************************************************************************************************************************************************************************
// BodyOnResize
//   This function acts on body resize.
//*******************************************************************************************************************************************************************************************************************************************************
function BodyOnResize() {
    try {
        var wid = GetWidth();
        var hei = GetHeight();
        var iq = 0;
    }
    catch (ex) {
    }
}

//*******************************************************************************************************************************************************************************************************************************************************
// getScrollingPosition
//*******************************************************************************************************************************************************************************************************************************************************
function getScrollingPosition() {
    var position = [0, 0];
    try {
        if (typeof window.pageYOffset != 'undefined') {
            position = [
            window.pageXOffset,
            window.pageYOffset
            ];
        }
        else if ((typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0) || (typeof document.documentElement.scrollLeft != 'undefined' && document.documentElement.scrollLeft > 0)) {
            position = [
            document.documentElement.scrollLeft,
            document.documentElement.scrollTop
            ];
        }
        else if (typeof document.body.scrollTop != 'undefined' || typeof document.documentElement.scrollLeft != 'undefined') {
            position = [
            document.body.scrollLeft,
            document.body.scrollTop
            ];
        }
    }
    catch (ex) {
    }
    return position;
}

//*******************************************************************************************************************************************************************************************************************************************************
// f_clientWidth
//*******************************************************************************************************************************************************************************************************************************************************
function f_clientWidth() {
    return f_filterResults(
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}

//*******************************************************************************************************************************************************************************************************************************************************
// f_clientHeight
//*******************************************************************************************************************************************************************************************************************************************************
function f_clientHeight() {
    return f_filterResults(
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

//*******************************************************************************************************************************************************************************************************************************************************
// f_scrollLeft
//*******************************************************************************************************************************************************************************************************************************************************
function f_scrollLeft() {
    return f_filterResults(
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}

//*******************************************************************************************************************************************************************************************************************************************************
// f_scrollTop
//*******************************************************************************************************************************************************************************************************************************************************
function f_scrollTop() {
    return f_filterResults(
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

//*******************************************************************************************************************************************************************************************************************************************************
// f_filterResults
//*******************************************************************************************************************************************************************************************************************************************************
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;
}


//*******************************************************************************************************************************************************************************************************************************************************
// BodyOnScroll
//   This function acts on body resize.
//*******************************************************************************************************************************************************************************************************************************************************
function BodyOnScroll() {
    try {
        var wid = GetWidth();
        var hei = GetHeight();

        var scrpos = getScrollingPosition();

        var style2 = document.getElementById('Image2').style;
        style2.top = scrpos[1] + 50;
        document.getElementById('Image2').style = style2;

        var iq = 0;
    }
    catch (ex) {
    }
}

//*******************************************************************************************************************************************************************************************************************************************************
// BodyOnResize
//   This function acts on body resize.
//*******************************************************************************************************************************************************************************************************************************************************
function TestImage() {
    try {
        var imgx = new Image();
    }
    catch (ex) {
    }
}

//*******************************************************************************************************************************************************************************************************************************************************
// ShowPicture
//*******************************************************************************************************************************************************************************************************************************************************
function ShowPicture() {
    var i = 0;
    try {
        var img = document.createElement('DIV');
        var html_x = document.getElementById("pnlIntn");
        html_x.innerHTML = "MEOW";

        var body_x = document.getElementsByTagName("body");
        //var images_x = document.images.item();

        var imgx = new Image();
        imgx.src = "Test_Handler.ashx";

        var html_image_x = document.getElementById("ImageTesting");
        html_image_x.innerHTML += imgx.outerHTML;
    }
    catch (ex) {
        var iq = 0;
    }
}


