﻿// JScript File
var tm=0

function ShowSpecs()
{
    if(xDOM("dvSpecsOuter").style.display=="none")
    {
        xDOM("dvSpecsOuter").style.display="inline"
        setInnerText("aSpecsClick","(hide)")
    }
    
    else
    {
        xDOM("dvSpecsOuter").style.display="none"
        setInnerText("aSpecsClick","+ Detailed Specs")
    }
    
    
}

function SetupPage()
{
    //document.getElementById("Form1").action="ItemNoM.aspx"
    tm=2
    //window.setTimeout("ItemNoM.WriteVisit('" + INVID + "', " + tm + ", retVisit)",2000)
}


function retVisit(ret)
{

tm+=2
if(tm<120)
{
    window.setTimeout("ItemNoM.WriteVisit('" + INVID + "', " + tm + ", retVisit)",2000)
}
//alert(ret.value)


}

function LoadCaption()
{

    setInnerText("dvMainCaption","...loading caption...")
    
    ItemNoM.GetCaption(INVID, retSetCaption)
    
}


function retSetCaption(ret)
{

setInnerText("dvMainCaption",ret.value)
}

function setInnerText(lbl, txt)
{
if(mozDOM)
    {
    xDOM(lbl,0).innerHTML=txt
    
    
    
    
    
    }
else
    {
    xDOM(lbl,0).innerHTML=txt
    }
}


function removeAllChildNodes(node) {
if (node && node.hasChildNodes && node.removeChild) {
while (node.hasChildNodes()) {
    if(node.childNodes.length==1)
        {
            return
        }
node.removeChild(node.lastChild);
}
}
} // removeAllChildNodes()

function getInnerText(lbl)
{
if(mozDOM)
    {
    
    return xDOM(lbl,0).firstChild.nodeValue
    }
else
    {
    return xDOM(lbl,0).innerText
    }
}


function ExpandCompatatItems()
    {
    xDOM("CompatatItems").style.height="300px"
    }


function ShowQty() 
    {
        setInnerText("QTYDISCOUNTS","retrieving...")
        //ItemNoM.GetDiscounts("688632","130314441", cbShowQty)
        ItemNoM.GetCaption("688632", cbShowQty)
        
    }
    
function cbShowQty(ret)
{
    setInnerText("QTYDISCOUNTS",ret.value)
}