﻿function microAjax(B, A) { this.bindFunction = function(E, D) { return function() { return E.apply(D, [D]) } }; this.stateChange = function(D) { if (this.request.readyState == 4) { this.callbackFunction(this.request.responseText) } }; this.getRequest = function() { if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP") } else { if (window.XMLHttpRequest) { return new XMLHttpRequest() } } return false }; this.postBody = (arguments[2] || ""); this.callbackFunction = A; this.url = B; this.request = this.getRequest(); if (this.request) { var C = this.request; C.onreadystatechange = this.bindFunction(this.stateChange, this); if (this.postBody !== "") { C.open("POST", B, true); C.setRequestHeader("X-Requested-With", "XMLHttpRequest"); C.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); C.setRequestHeader("Connection", "close") } else { C.open("GET", B, true) } C.send(this.postBody) } };


function ViewDesc(I) {

        toggleT('IMGDIV', 'POI'+I);
        toggleT('MAINTITLEDIV', 'POT'+I);
        toggleT('BRIEFDIV', I);

    }


    function ShowCoupon(CP) {

        if (document.getElementById)
            document.getElementById(CP).style.display = 'inline';
        else if (document.all)
            document.all[CP].style.display = 'inline';

    }

function toggle(showHideDiv, switchTextDiv) {
    var ele = document.getElementById(showHideDiv);
    var text = document.getElementById(switchTextDiv);
    if (ele.style.display == "block") {
        ele.style.display = "none";
        text.style.display = "block";
    }
    else {
        ele.style.display = "block";
        text.style.display = "none";
    }
}

function toggleT(showHideDiv, switchTextDiv) {
    var ele = document.getElementById(showHideDiv);
    var text = document.getElementById(switchTextDiv);

    if (showHideDiv == 'BRIEFDIV')
        ele.innerHTML = document.getElementById('POD' + switchTextDiv).innerHTML;
    else
        ele.innerHTML = text.innerHTML;
}

function toggleTWithPriceTable(showHideDiv, switchTextDiv) {
    var ele = document.getElementById(showHideDiv);
    var text = document.getElementById(switchTextDiv);

    if (showHideDiv == 'BRIEFDIV') {
        var ptab = document.getElementById('POSx');
        var f = '';


        for (var x = 1; x < ptab.rows.length; x++) {
            if (ptab.rows[x].id == 'PO_' + switchTextDiv) {
                f = '<table style="border-style:solid; border-width:thin;width:99%;"><tr>' + ptab.rows[0].innerHTML + '</tr><tr>' + ptab.rows[x].innerHTML + '</tr></table><br />';
                x = 1000000;
            }
        }

        ele.innerHTML = f + document.getElementById('POD' + switchTextDiv).innerHTML;
    }
    else
        ele.innerHTML = text.innerHTML;
}


function Sort(Type) {

    __doPostBack('SORT', Type)
}

function GotoPage(Type) {

    __doPostBack('daPage', Type);
}

function Expand(QuickSite) {
    if (document.getElementById) {
        var iframeElement = parent.document.getElementById(QuickSite);
        iframeElement.style.height = "768";
        iframeElement.style.width = "100%";
    }
    else {
        if ((document.all || document.getElementById) && iframehide == "no") {
            var tempobj = document.all ? document.all[iframeids[QuickSite]] : document.getElementById(iframeids[QuickSite])
            tempobj.style.height = "768";
            tempobj.style.width = "100%";
        }
    }
}