// <script type="text/javascript">/////////////////////////////////////////////////////
//  Ver 1.0 yet to be released this is a development version                         //
//  contain core functions that are commonly used throughout the site                //
//  Copyright CompleteHub IT Solutions 2002.                                         //
///////////////////////////////////////////////////////////////////////////////////////
//  written by ThiHa unless otherwise stated                                         //
///////////////////////////////////////////////////////////////////////////////////////

// Set Status Bar /////////////////////////////////////////////////////////////////////
window.status = "CompleteHub IT Solutions";

// global function calls by events ////////////////////////////////////////////////////
window.onresize=reloadWin; 
document.onmousedown = getPop;
document.onmousemove = movePop;
document.onmouseup = dropPop;

// global variables for moveable POPUPS ///////////////////////////////////////////////
var popObj = null;
var popMove = false; // moving control by mouse over and out events
var popX=0, popY=0;

// global variables for timer /////////////////////////////////////////////////////////
var timerID  =  null;

///////////////////////////////////////////////////////////////////////////////////////
// Ultimate client-side JavaScript client sniff. Version 3.03                        //
// (C) Netscape Communications 1999-2001.  Permission granted to reuse and distribute./
// This is not a full version                                                        //
///////////////////////////////////////////////////////////////////////////////////////
var agt       = navigator.userAgent.toLowerCase();
var is_major  = parseInt(navigator.appVersion);
var is_minor  = parseFloat(navigator.appVersion);
var is_nav    = ((agt.indexOf("mozilla") != -1) && (agt.indexOf("spoofer") == -1) && 
                 (agt.indexOf("compatible") == -1) && (agt.indexOf("opera") == -1) && 
                 (agt.indexOf("webtv") == -1) && (agt.indexOf("hotjava") == -1));
var is_nav6up = (is_nav && (is_major >= 5));
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4") != -1));
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
// Above script have been chopped /////////////////////////////////////////////////////


// define color scheme ////////////////////////////////////////////////////////////////
// ** remember to update style.css.php as well ////////////////////////////////////////
var TXT0 = "#66cc33";
var TXT1 = "#333333";
var TXT2 = "#333399";
var TXT3 = "#666666";
var BGN0 = "#000000";
var BGN1 = "#ffffff";
var BGN2 = "#cccccc";
var BGN3 = "#e9e9e9";

// centerWidth (aka canvas width) /////////////////////////////////////////////////////
// ** remember to update style.css.php as well ////////////////////////////////////////
var centerWidth = 750;

// define mouse cursor style for pointer (ies below 6 do not recognize pointer) ///////
var cursorPtr = (is_ie6up || is_nav6up) ? "pointer" : "hand"; 

// define array for Top Menu Parent /////////////////////////////////////////////////// 
var aTM   = [ "sub::Domain Name",
              "sub::Web Hosting",
              "sub::eCommerce"];

// define array for Top Menu Child 0 //////////////////////////////////////////////////
var aTM0  = [ "Register Domain",
              "Transfer Domain",
              "DNS Services"];

// define array for Top Menu Child 1 //////////////////////////////////////////////////
var aTM1  = [ "email hosting",
              "hosting plan::S",
              "hosting plan::M",
              "hosting plan::L",
              "reseller plan::XL",
              "reseller plan::XXL"];

// define array for Top Menu Child 2 //////////////////////////////////////////////////
var aTM2  = [ "Site Builder",
              "Product Listings",
              "Product Catalogues",
              "Appointment Maker",
              "Store Front",
              "SSL Certificate",
              "Online Payment",
              "Custom Applications"];

// define array for Side Menu A Parent ////////////////////////////////////////////////
var aSMA  = [ "sub::About Us",
              "Contact Us"];

// define array for Side Menu A Child 0 ///////////////////////////////////////////////
var aSMA0 = [ "Our Profile",
              "Our Mission",
              "Our Servers"];

// define array for Side Menu B Parent ////////////////////////////////////////////////
var aSMB  = [ "News",
              "Promotions"];

// define array for Side Menu C Parent ////////////////////////////////////////////////
var aSMC  = [ "Sign Up",
              "Sign In"];

// define array for Side Menu D Parent ////////////////////////////////////////////////
var aSMD = [ "sub::My Assets",
             "sub::My Account"];

// define array for Side Menu D Child 0 ///////////////////////////////////////////////
var aSMD0 = [ "Account Overview"];

// define array for Side Menu D Child 1 ///////////////////////////////////////////////
var aSMD1 = [ "Update Profile",
              "Update Contact",
              "Change Password"];

// define array for Side Menu E Parent ////////////////////////////////////////////////
var aSME = [ "Sign Out"];

// define array for Side Icons A //////////////////////////////////////////////////////
var SIA = [ "Check Out", 
            "Domain Search",
            "Help"];

// define array for bottom menus //////////////////////////////////////////////////////
var BM        = [ "terms and conditions", "disclaimer", "privacy policy"];

// create top and side menu objects ///////////////////////////////////////////////////
var oTM   = new mkoMenu(new mkoLTWH(205,45,170,20),aTM,"TMP","H","oTM");
var oTM0  = new mkoMenu(new mkoLTWH(205,70,170,20),aTM0,"TMC","V");
var oTM1  = new mkoMenu(new mkoLTWH(375,70,170,20),aTM1,"TMC","V");
var oTM2  = new mkoMenu(new mkoLTWH(545,70,170,20),aTM2,"TMC","V");
var oSMA  = new mkoMenu(new mkoLTWH(30,120,140,20),aSMA,"SMP","V","oSMA");
var oSMA0 = new mkoMenu(new mkoLTWH(175,120,140,20),aSMA0,"SMC","V");
var oSMB  = new mkoMenu(new mkoLTWH(30,170,140,20),aSMB,"SMP","V","oSMB");
var oSMC  = new mkoMenu(new mkoLTWH(30,220,140,20),aSMC,"SMP","V","oSMC");
var oSMD  = new mkoMenu(new mkoLTWH(30,220,140,20),aSMD,"SMP","V","oSMD");
var oSMD0 = new mkoMenu(new mkoLTWH(175,220,170,20),aSMD0,"SMC","V");
var oSMD1 = new mkoMenu(new mkoLTWH(175,240,170,20),aSMD1,"SMC","V");
var oSME  = new mkoMenu(new mkoLTWH(30,270,140,20),aSME,"SMP","V","oSME");

// create global BgFgBd properties objects ////////////////////////////////////////////
var oMenuBgFg = new mkoBgFgBd(BGN1,TXT0,TXT0,TXT2);
var oPopWinBgFg = new mkoBgFgBd(TXT3,BGN2);








// METHOD to change Bg and Fg color of a document obj (e.g div, td)////////////////////
// argument (object) //////////////////////////////////////////////////////////////////
function chBgFg(o,state)
{
    o = o.style; // object to be changed
    o.color = (state == 0) ? this.fg0 : this.fg1;
    o.backgroundColor = (state == 0) ? this.bg0 : this.bg1;
}


// METHOD to change border color //////////////////////////////////////////////////////
// argument (object) //////////////////////////////////////////////////////////////////
function chBd(o,state)
{
    o = o.style;
    o.borderColor = (state == 0) ? this.bd0 : this.bd1;
}

// change (swap) image (default _0 image with _1 image) ///////////////////////////////
// argument (image object), (image object,image url) ////////////////////////////////// 
function chImg()
{
    var a = chImg.arguments;
    o = a[0];

    if (a.length == 1) { // replace _0 with _1 or _1 with _0
        o.src = (o.src.indexOf("_0") != -1) ? o.src.replace(/_0/i, "_1") : o.src.replace(/_1/i, "_0");
    } else { // replace any image provided
        o.src = a[1];
    }
}


// chk HTML Codes returned by a function (for debugging only) /////////////////////////
// argument (HTML code string) ////////////////////////////////////////////////////////
function chkHTML(code)
{
    var win = window.open();
    win.document.write(code);
}


// // convert a string to appropriate object/file name only [a-z0-9] //////////////////
function convertStr(os)
{
    var re = /[^A-Za-z0-9]/gi;
    var ns = os.replace(re, "");
    return ns.toLowerCase(); // return with lowercase
}


// clear timer ////////////////////////////////////////////////////////////////////////
function clrTimer()
{
    window.clearTimeout(timerID);
}


// drop the popup obj /////////////////////////////////////////////////////////////////
function dropPop()
{
    if (popMove) { // chk popMove control
        getObj("POP").style.overflow = "auto"; // note* ns has prob with auto overflow
        getObj("POP").innerHTML = popObj.temp; // restor innerHTML

        popObj = null;
        popMove = false;
    }
}


// get datum (x,y) of the canvas //////////////////////////////////////////////////////
// note can only be call from body, NOT head, of the document /////////////////////////
function getDtm(a)
{
    var r;
    switch (a) {
        case "x" :
            r = Math.ceil((getWH("clientW")-getWH("W"))/2);
            break;

        case "y" :
            if (getWH("scrH") == 600) {
                r = 15;
            } else if (getWH("scrH") <= 768) {
                r = Math.floor(0.1*getWH("clientH"));
            }
            break;

        default :
            r = false;
            break;
    }

    return r;
}


// get Objects NOT crosss frame capable ///////////////////////////////////////////////
function getObj(n)
{
    var i, x=null, d=document;
    if (!(x=d[n]) && d.all) {
        x = d.all[n];
    }
    for (i=0; !x&&i<d.forms.length; i++) {
        x = d.forms[i][n];
    }
    if (!x && d.getElementById) {
        x = d.getElementById(n);
    }
    return x;
}


// get pop layer //////////////////////////////////////////////////////////////////////
function getPop(e)
{
    if (popMove) { // chk popMove control
        popObj = getObj("popWin");

        popObj.temp = getObj("POP").innerHTML; // remember pop innerhtml
        getObj("POP").innerHTML = "&nbsp;"; // replace HTML to make it move faster
        getObj("POP").style.overflow = "visible"; // ns has prob w overflow

        if (is_nav) { // if netscape
            popX=e.layerX;
            popY=e.layerY;
        } else if (is_ie) { // if ie
            popX=event.offsetX;
            popY=event.offsetY;
        }
        return false;
    }
}


// Get widths and heights /////////////////////////////////////////////////////////////
// arguments (clientW / clientH / scrW / srcH / availW / availH/ W(canvas) / H(canvas))
function getWH (a){
    var r;
    switch (a) {

        case "clientW" : // client width
            if (is_ie) {
                r = document.body.clientWidth;
            } else if (is_nav) {
                r = window.innerWidth;
            } else {
                r=false;
            }
            break;

        case "clientH" : // client height
            if (is_ie) {
                r = document.body.clientHeight;
            } else if (is_nav) {
                r = window.innerHeight;
            } else {
                r=false;
            }
            break;

        case "scrW" : // screen width
            r = screen.width;
            break;

        case "scrH" : // screen height
            r = screen.height;
            break;

        case "availW" : // screen width
            r = screen.availWidth;
            break;

        case "availH" : // screen height
            r = screen.availHeight;
            break;

        case "W" :
            r = centerWidth;
            break;

        case "H" :
            if (getWH("scrH") == 600) {
                r = getWH("clientH")-30; // 15px each top and bottom
            } else if (getWH("scrH") <= 768) {
                r = Math.ceil(0.8*getWH("clientH")); // 10% each top and bottom
            }
            break;

        default :
            r = false;
            break;
    }

    return r;
}

// go to URI and pass session id //////////////////////////////////////////////////////
// argument(url excluding extension) //////////////////////////////////////////////////
function goURI(u)
{
    playWaitAni();
    u += (gSID == "") ? ".php" : ".php?"+gSID;
    window.location = u;
}


// hide child menu ////////////////////////////////////////////////////////////////////
function hideChildMenu()
{
    timerID = window.setTimeout("wSEC('')",1000);
}


// make object to store background, foreground and boder colors ///////////////////////
// arguments (bg0,bg1) or (bg0,bg1,fg0,fg1) or (bg0,bg1,fg0,fg1,bd0,bd1) //////////////
function mkoBgFgBd()
{
    var a = mkoBgFgBd.arguments;
    this.bg0 = a[0]; 
    this.bg1 = a[1];
    this.fg0 = (a.length == 2) ? a[1] : a[2];
    this.fg1 = (a.length == 2) ? a[0] : a[3];
    this.bd0 = (a.length == 4) ? a[0] : a[4];
    this.bd1 = (a.length == 4) ? a[1] : a[5];
    this.chBgFg = chBgFg;
    this.chBd = chBd;
}


// make object to store icon info /////////////////////////////////////////////////////
// arguments (LTWH object,contents array) ///////////////////////////////////////////// 
function mkoMenu(o,a)
{
    this.LTWH = o;
    this.values = a;
    this.rtnIcon = rtnIcon;
}


// make object to store left, top, width and height value /////////////////////////////
// arguments (left,top,width,height) or (width,height) //////////////////////////////// 
function mkoLTWH()
{
    var a = mkoLTWH.arguments;
    this.left   = (a.length == 4) ? a[0] : null;
    this.top    = (a.length == 4) ? a[1] : null;
    this.width  = (a.length == 4) ? a[2] : a[0];
    this.height = (a.length == 4) ? a[3] : a[1];
    this.rtnStyLTWH = rtnStyLTWH;
}


// make object to store menu info /////////////////////////////////////////////////////
// arguments (LTWH object,contents array,css,orientation) 
// or (LTWH object,contents array,css,orientation,child) ////////////////////////////// 
function mkoMenu()
{
    var a = mkoMenu.arguments;
    this.LTWH = a[0];
    this.values = a[1];
    this.css = a[2];
    this.orientation = a[3];
    this.child = (a.length > 4) ? a[4] : null;
}


// move the popup obj /////////////////////////////////////////////////////////////////
function movePop(e) {
    if (popObj) {
        if (is_nav) {
            popObj.style.left = e.pageX-popX;
            popObj.style.top = e.pageY-popY;
        } else if (is_ie) {
            popObj.style.left = event.clientX-popX + document.body.scrollLeft;
            popObj.style.top = event.clientY-popY + document.body.scrollTop;
            return false;
        }
    }
}


// play wait animation ////////////////////////////////////////////////////////////////
function playWaitAni()
{
    // no of bars segments
    var m = 20;

    if ((o=getObj("dCOUNT")) == null) {
        wWaitAni(m);
        document.dCOUNT = 1;
        window.setInterval("playWaitAni()",500);
    } else {
        if(o < m) {
            getObj("AniBar"+o).style.backgroundColor = TXT0;
            document.dCOUNT = o+1;
        } else {
            document.dCOUNT = 1; // reset counter
            for (x=1; x<m; x++) { // reset all bar colors
                getObj("AniBar"+x).style.backgroundColor = "transparent";
            }
        } 
    }
}


// preload images /////////////////////////////////////////////////////////////////////
// argument (url of the image) ////////////////////////////////////////////////////////
function preloadImg(u)
{
    var o;
    if((o = getObj("preloadImg")) == null) {
        document.preloadImg = new Array();
        x = 0
    } else {
        x = o.length;
    }
    document.preloadImg[x] = new Image;
    document.preloadImg[x].src = u;
}


// reload window //////////////////////////////////////////////////////////////////////
function reloadWin()
{
    history.go(0);
}


// Return menu html string ////////////////////////////////////////////////////////////
function rtnMenu()
{
    var a = rtnMenu.arguments;
    var sR = "",v,mv,mo,mk;
    for (x=0; x<a.length; x++) {
        var M = a[x].values.length;
        var W = (a[x].orientation == "H") ? a[x].LTWH.width*M : a[x].LTWH.width;
        var H = (a[x].orientation == "V") ? a[x].LTWH.height*M : a[x].LTWH.height;
        var oLTWH = new mkoLTWH(a[x].LTWH.left+"px",a[x].LTWH.top+"px",W+"px",H+"px");
        var oWH =  new mkoLTWH(a[x].LTWH.width,a[x].LTWH.height);

        sR  += "<table class=\"LY1 BG1\" style=\""+oLTWH.rtnStyLTWH()+"\" "+rtnTableSPB(1)+">\n";
        sR += (a[x].orientation == "H") ? "\t<tr>\n" : "";
        for (y=0; y<M; y++) {
            v  = a[x].values[y];
            mv = "oMenuBgFg.chBgFg(this,1); clrTimer(); ";
            mu = "oMenuBgFg.chBgFg(this,0); hideChildMenu(); ";
            mk = "goURI('"+convertStr(v)+"');"

            if (v.substring(0,5) == "sub::") {
                v = v.substring(5,v.length);
                mv += "showChildMenu("+a[x].child+y+");";
                mk = null; // reset mk handler
            } else if (a[x].child != null) {
                mv += "wSEC('');";
            }

            sR += (a[x].orientation == "V") ? "\t<tr>\n" : "";
            sR += "\t\t<td class=\"HT0 "+a[x].css+"\" style=\"cursor:"+cursorPtr+";"+oWH.rtnStyLTWH()+"\" "+rtnMouseEvent(mv,mu,mk)+">"+v+"</td>";
            sR += (a[x].orientation == "V") ? "\t</tr>\n" : "";
        }
        sR += (a[x].orientation == "H") ? "\t</tr>\n" : "";
        sR += "</table>\n";
    }
    return sR; 
}


// return mouse event handlers html code string ///////////////////////////////////////
// argument (mouseover,mouseout,click) ////////////////////////////////////////////////
function rtnMouseEvent(mo,mu,mk)
{
    var sR  = "";
    sR += (mo) ? "onmouseover =\""+mo+"\" " : "";
    sR += (mu) ? "onmouseout  =\""+mu+"\" " : "";
    sR += (mk) ? "onclick     =\""+mk+"\" " : ""; 
    return sR;
}


// METHOD returning css properties left, top, width and height string ///////////////// 
function rtnStyLTWH()
{
    var sR = "";
    sR += (this.left)   ? "left:"+this.left+";" : "";
    sR += (this.top)    ? "top:"+this.top+";" : "";
    sR += (this.width)  ? "width:"+this.width+";" : "";
    sR += (this.height) ? "height:"+this.height+";" : "";
    return sR; 
}


// return table attributes for cellspacing cellpadding and border /////////////////////
// argument (cellspacing) or  (cellspacing,cellpadding,border) ////////////////////////
function rtnTableSPB()
{
    var a = rtnTableSPB.arguments;
    var sR  = "";
    sR += "cellspacing ="; 
    sR += (a.length > 0) ? "\""+a[0]+"\" " : "\"0\" "; 
    sR += "cellpadding ="; 
    sR += (a.length > 1) ? "\""+a[1]+"\" " : "\"0\" ";
    sR += "border =";
    sR += (a.length > 2) ? "\""+a[2]+"\" " : "\"0\" ";
    return sR;
}


// show child menu ////////////////////////////////////////////////////////////////////
// argument(menu object) ////////////////////////////////////////////////////////////// 
function showChildMenu(o)
{
    wSEC(rtnMenu(o));
}


// write layers and framework to body of the document /////////////////////////////////
function wBody()
{
    // LTWH definitions for PRImary, SECondary, TERitiary and FooTeR layers 
    var oPRI = new mkoLTWH(getDtm("x")+"px",getDtm("y")+"px",getWH("W")+"px",getWH("H")+"px");
    var oSEC = new mkoLTWH(getDtm("x")+"px",getDtm("y")+"px","1px",getWH("H")+"px");
    var oTER = new mkoLTWH("0px","0px","1px","100%");
    var oFTR = new mkoLTWH(getDtm("x")+"px",(getDtm("y")+getWH("H"))+"px",getWH("W")+"px","15px");
    var oINF = new mkoLTWH(null,(getWH("H")-150)+"px");
    var oICN = new mkoLTWH((getDtm("x")+30)+"px",(getDtm("y")+getWH("H")-60)+"px", "150px", "1px");

    // information layer
    var sINF = "";
    sINF += "<table class=\"WH0\" "+rtnTableSPB()+">\n";
    sINF += "  <tr>";
    sINF += "    <td id=\"PRI\" class=\"WO2\">&nbsp;</td>";
    sINF += "    <td style=\"width:10px\">&nbsp;</td>";
    sINF += "  </tr>\n";
    sINF += "</table>\n";
    
    // icons
    var sICN = "";
    sICN += "<table class=\"WH0\" "+rtnTableSPB()+">\n";
    sICN += "  <tr>";
    for (x=0; x<SIA.length; x++) {
        mv = "chImg(this); ";
        mu = "chImg(this); ";
        mk = "goURI('"+convertStr(convertStr(SIA[x]))+"');";

        sICN += "<td><img class=\"BD0\" src=\"images/i_"+convertStr(SIA[x])+"_0.gif\" style=\"width:38px; height:38px; cursor:"+cursorPtr+"\" alt=\""+SIA[x]+"\" "+rtnMouseEvent(mv,mu,mk)+"></td>";
        preloadImg("images/i_"+convertStr(SIA[x])+"_1.gif");
        sICN += "<td style=\"width:10px\">&nbsp;</td>";
    }
    sICN += "  </tr>\n";
    sICN += "</table>\n";

    // terms and condtions
    var sTNC   = "";
    for (x=0; x<BM.length; x++) {
        if(x > 0) { // add divider
            sTNC += " | ";
        }
        sTNC += "\t<a href=\"javascript:goURI('"+convertStr(BM[x])+"')\" class=\"FT0\">"+BM[x]+"</a>\n";
    }

    // copyright
    var sCPR  = "Copyright &copy;2002 CompleteHub. All Rights Reserved";

    // footer copyright + terms and conditions
    var sFTR  = "";
    sFTR += "<table class=\"WH0 FT0\" "+rtnTableSPB()+">";
    sFTR += " <tr>";
    sFTR += "    <td style=\"width:"+(getWH("W")-270)+"px\">"+sTNC+"</td>";
    sFTR += "    <td style=\"width:270px\">"+sCPR+"</td>";
    sFTR += "  </tr>";
    sFTR += "</table>";

    // logo and title images
    var sPRI = "";
    sPRI += "<div class=\"WH0\" style=\"";
    sPRI += "  background-image : url(images/t_"+convertStr(document.title)+".gif);";
    sPRI += "  background-position : bottom right;";
    sPRI += "  background-repeat : no-repeat\">";
    sPRI += "<img src=\"images/logo.gif\" />";
    sPRI += "</div>";
    // scrollable info layer  
    sPRI += "<div class=\"LYI SB0 WO1\" style=\""+oINF.rtnStyLTWH()+"\">\n"+sINF+"\n</div>";
    // top and side menus
    sPRI += rtnMenu(oTM,oSMA,oSMB);
    sPRI += (gUSER == "guest") ? rtnMenu(oSMC) : rtnMenu(oSMD,oSME);

    // assemble string of HTML for writing and then write to document
    var sW = "";
    sW += "<div class=\"BGI BG0 LY0\" style=\""+oPRI.rtnStyLTWH()+"\">"+sPRI+"</div>\n";
    sW += "<div class=\"LY1\" style=\""+oSEC.rtnStyLTWH()+"\" id=\"SEC\"></div>";
    sW += "<div class=\"LY2\" style=\""+oTER.rtnStyLTWH()+"\" id=\"TER\"></div>";
    sW += "<div class=\"LY0\" style=\""+oFTR.rtnStyLTWH()+"\">"+sFTR+"</div>";
    sW += "<div class=\"LY0\" style=\""+oICN.rtnStyLTWH()+"\">"+sICN+"</div>"
    document.write(sW);
}


// write to html object (aka element, e.g div, td etc) ////////////////////////////////
// argument (object name/id, html string)
function wObj(o,s)
{
    if ((o=getObj(o)) != null) {
        o.innerHTML = s;
    }
}


// write Popup window /////////////////////////////////////////////////////////////////
// argument(LTWH object, innerHTML) ///////////////////////////////////////////////////
function wPopWin(title,LTWH,sHTML)
{
    var sW = "";
    var oPop   = new mkoLTWH(LTWH.left+"px",LTWH.top+"px",LTWH.width+"px",LTWH.height+"px");
    var oTitle = new mkoLTWH((LTWH.width-20)+"px","20px");
    var oClose = new mkoLTWH("20px","20px");
	var oPane  = new mkoLTWH(null,(LTWH.height-20)+"px");
    var mv = "oPopWinBgFg.chBgFg(this,1); ";
    var mu = "oPopWinBgFg.chBgFg(this,0); ";
    var mk = "wTER('')";

    sW += "<div id=\"popWin\" class=\"WH0 LY2\" style=\""+oPop.rtnStyLTWH()+"\">";
    sW += "<table class=\"BG1\" "+rtnTableSPB(1)+">\n";
    sW += "  <tr>";
    sW += "    <td cLass=\"HT1\" style=\""+oTitle.rtnStyLTWH()+"color:"+oPopWinBgFg.fg0+"; cursor:move\" "+rtnMouseEvent("popMove=true;","popMove=false;",null)+">&nbsp;&nbsp;"+title+"</td>";
    sW += "    <td class=\"HT1 ALC\" style=\"color:"+oPopWinBgFg.fg0+"; cursor:"+cursorPtr+";"+oClose.rtnStyLTWH()+"\" "+rtnMouseEvent(mv,mu,mk)+">X</td>";
    sW += "  </tr>\n";
    sW += "  <tr>";
    sW += "    <td class=\"BG0\" style=\""+oPane.rtnStyLTWH()+" padding:5px\" colspan=\"2\">";
    sW += "      <div id=\"POP\" class=\"WH0 LYP SB1\">"+sHTML+"</div>";
    sW += "    </td>";
    sW += "  </tr>\n";
    sW += "</table>\n";
    sW += "</div>";

    wTER(sW);
}


// write to PRI ///////////////////////////////////////////////////////////////////////
// argument (html string) /////////////////////////////////////////////////////////////
function wPRI(sHTML)
{
    wObj("PRI",sHTML);
}


// write to SEC ///////////////////////////////////////////////////////////////////////
// argument (html string) /////////////////////////////////////////////////////////////
function wSEC(sHTML)
{
    wObj("SEC",sHTML);
}


// write to TER ///////////////////////////////////////////////////////////////////////
// argument (html string) /////////////////////////////////////////////////////////////
function wTER(sHTML)
{
    wObj("TER",sHTML);
}


// write wait animation html string to SEC ////////////////////////////////////////////
// agrguments (no of bars segments) ///////////////////////////////////////////////////
function wWaitAni(m) 
{
    var oWH = new mkoLTWH(getWH("W"),"100%");
    var sBAR = "";
    var sCTR = "";

    sBAR += "Processing";
    sBAR += "<table "+rtnTableSPB(1)+">";
    sBAR += "  <tr>";
    sBAR += "    <td class='ANI BG2'>&nbsp;</td>";
    for (x=1; x<m; x++) {
        sBAR += "<td id='AniBar"+x+"' class='ANI'>&nbsp;</td>";
    }
    sBAR += "  </tr>";
    sBAR += "</table>";
    sBAR += "Please Wait !";

    sCTR += "<table class='WH0'>";
    sCTR += "<tr><td align='center' valign='middle' class='HT1'>"+sBAR+"</td></tr>";
    sCTR += "</table>";

    wSEC("<div class='BGI BG0 LY2'  style='"+oWH.rtnStyLTWH()+"'>"+sCTR+"</div>");
}


///////////////////////////////////////////////////////////////////////////////////////
// END OF SCRIPT //////////////////////////////////////////////////////////////////////
