﻿/// <reference path="../JQuery/jquery-1.5.1.min.js" />

/// <reference path="../JQuery/jquery-ui-1.8.14.custom.min.js" />

function DocumentReady() {
    //    Mid="a1"enuClick();
}
//set Iframe URL

//function MenuClick() {
//    $(".MasterMenu a").click(function (event) {
//        var PageNumber = $(event.target).val();
//        var sourceAddress = "Content.aspx?Cnt=" + PageNumber.toString();
//        $(".MasterMenu a").removeClass("selected");
//        $(event.target).addClass("selected");
//        switchSrc(sourceAddress);
//        // 
//    });
//}

//set Iframe URL
function switchSrc(sourceAddress) {
    document.getElementById("MainIFrame").src = sourceAddress;
}

//Test Hidden Field for set Iframe URL
function getforhiddenfield() {
    document.getElementById("MainIFrame").src = document.getElementById("Hid_page").value;
}

//set Iframe height
function FrameLoadComplete() {
    $($("#MainIFrame")[0].contentWindow.document).ready(function () {
        //set frame height 
        $("#MainIFrame").height(10);
        SetFrameHeight();
    });
}
function SetFrameHeight() {

    var innerFormHeight = $($("#MainIFrame")[0].contentWindow.document).height();

    //set height
    var minHeightParam = 400;

    var innerheight = 0;

    if (innerFormHeight <= minHeightParam)
        innerheight = minHeightParam;
    else
        innerheight = innerFormHeight;

    innerheight += 10;
    $("#MainIFrame").height(innerheight);
}
