﻿
function control(id) {
    var obj = document.getElementById(id);

    if (obj)
        return obj;
    else
        return document.getElementById(ctl + '_' + id);
}

function mastercontrol(id) {
    return document.getElementById(ctl.replace("_cphContent", '') + '_' + id);
}

function move_menu(that, menu) {
    switch (menu) {
        case "H":
            that.parentNode.style.backgroundImage = 'url(images/cursor_home.jpg)';
            break;
        case "F":
            that.parentNode.style.backgroundImage = 'url(images/cursor_forum.jpg)';
            break;
        case "C":
            that.parentNode.style.backgroundImage = 'url(images/cursor_forum.jpg)';
            break;
        case "P":
            that.parentNode.style.backgroundImage = 'url(images/cursor_forum.jpg)';
            break;
        case "L":
            that.parentNode.style.backgroundImage = 'url(images/cursor_home.jpg)';
            break;
        case "R":
            that.parentNode.style.backgroundImage = 'url(images/cursor_forum.jpg)';
            break;
    }

    // that.parentNode.className="move_menu";
}
function out_menu(that) {
    //that.className="";
    that.parentNode.style.backgroundImage = 'none';
}

function print_window() {
    var lwidth = 600;
    var lheight = 510;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=no,resizable=no,status=yes";
    window.open("Popup/Print_AFS.aspx", "Print_AFS", features);
}

function print_sysreq() {
    var lwidth = 800;
    var lheight = 800;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=no,resizable=no,status=yes";
    window.open("Popup/print_sysreq.aspx", "print_sysreq", features);
}

function print_techsupport() {
    var lwidth = 600;
    var lheight = 400;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=no,resizable=no,status=yes";
    window.open("Popup/print_techsupport.aspx", "print_techsupport", features);
}

function print_download() {
    var lwidth = 600;
    var lheight = 200;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=no,resizable=no,status=yes";
    window.open("Popup/print_download.aspx", "print_techsupport", features);
}

function print_purchasereturn() {
    var lwidth = 600;
    var lheight = 200;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=no,resizable=no,status=yes";
    window.open("Popup/print_purchasereturn.aspx", "print_purchasereturn", features);
}

function print_privacypolicy() {
    var lwidth = 700;
    var lheight = 700;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=no,resizable=no,status=yes";
    window.open("Popup/print_privacypolicy.aspx", "print_privacypolicy", features);
}

function print_terms() {
    var lwidth = screen.availWidth;
    var lheight = screen.availHeight;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=yes,resizable=yes,status=yes";
    window.open("Popup/print_terms.aspx", "print_terms", features);
}

function print_faq() {
    var lwidth = screen.availWidth;
    var lheight = screen.availHeight;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=yes,resizable=yes,status=yes";
    window.open("Popup/print_faq.aspx", "print_faq", features);
}



function send_email() {
    var lwidth = 400;
    var lheight = 210;
    var lleft = (screen.availWidth / 2) - (lwidth / 2);
    var ltop = (screen.availHeight / 2) - (lheight / 2);
    var features = "width=" + lwidth + ",height=" + lheight + ",left=" + lleft + ",top=" + ltop + ",location=no,menubar=no,toobar=no,scrollbars=no,resizable=no,status=yes";
    window.open("Popup/sendemail.aspx", "send_email", features);
}


function resize(el) {
    var height = 0;
    var i;
    if (el.childNodes.length == 0 || el.childNodes.length == 1) {
        height = el.offsetHeight;
    }
    for (i = 0; i < el.childNodes.length; i++) {
        var obj = el.childNodes[i];
        if (obj) {
            if (obj.tagName == "DIV" && obj.id != "divcontentleft") {
                var off = obj.offsetHeight;
                if (obj.id != "divcontentleft") {
                    if (obj.id == "divcontentright") {
                        if (obj.offsetHeight < 580)
                            off = 580;
                        else
                            off = obj.offsetHeight;
                    } else {
                        if (isNaN(obj.offsetHeight))
                            off = 0;
                        else
                            off = obj.offsetHeight;
                    }
                }
                height += off;
            }
        }
    }
    el.style.height = height + 'px';
}

function assign_height(objpar) {
    var i;
    for (i = 0; i < objpar.childNodes.length; i++) {
        var obj = objpar.childNodes[i];
        if (obj) {
            if (obj.tagName == "DIV") {
                //   obj.style.height=obj.offsetHeight+'px';
                resize(obj);
            }
        }
    }
}

function resize_div() {
    var divcontentmain = document.getElementById("divcontentmain");
    var divcontentleft = document.getElementById("divcontentleft");
    var divcontentright = document.getElementById("divcontentright");
    if (divcontentleft.offsetHeight < divcontentright.offsetHeight) {
        divcontentmain.style.height = divcontentright.offsetHeight + 25 + 'px';
    } else {
        divcontentmain.style.height = "580px";
    }
}