﻿/*****************************************************************************
Used to provide support to display Price for a Given Part
*****************************************************************************/
function showPrice(sALU)
{
    var features="";
    if(window.navigator.appName=="Microsoft Internet Explorer")
        features="dialogHeight: 295px; dialogWidth: 485px; center: Yes; help: No; resizable: Yes; status: No;";
    else
        features="dialogHeight: 239px; dialogWidth: 485px; resizable: Yes;";
    var retVal=window.showModalDialog("PriceViewer.aspx?ALU="+escape(sALU), "",features);
    if(retVal != undefined && retVal=="Yes")
        {
        var strXMLDoc="<XMLDATA><FUNCTION>AddPartsSearchToOrder</FUNCTION>";
        strXMLDoc += "<ALU>" + sALU + "</ALU>";
        strXMLDoc += "</XMLDATA>";

        //******** TEST POINT ***********
        //alert(strXMLDoc);
        //if(confirm("Continue ???")==false)
        //	return;
        //******** TEST POINT ***********
        var xmlHttpReq = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) 
            {
                xmlHttpReq = new XMLHttpRequest();
                try{
                //xmlHttpReq.overrideMimeType('text/xml');
                }catch(e){;}
            }
        // IE
        else if (window.ActiveXObject) 
            {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
            }   

        xmlHttpReq.open("POST", "services/CAPS_Support.aspx", false);
        xmlHttpReq.send(strXMLDoc);
        var strResponse = xmlHttpReq.responseText;
        if(strResponse.substr(0,5)=="ERROR")
            {
            alert(strResponse);
            }
        else
            {
            window.location.href="OrderForm/OrderForm.aspx";
            }   
        }
}

function OnlineOrder(sALU)
{
        var strXMLDoc="<XMLDATA><FUNCTION>AddPartsSearchToOrder</FUNCTION>";
        strXMLDoc += "<ALU>" + sALU + "</ALU>";
        strXMLDoc += "</XMLDATA>";

        //******** TEST POINT ***********
        //alert(strXMLDoc);
        //if(confirm("Continue ???")==false)
        //	return;
        //******** TEST POINT ***********
        var xmlHttpReq = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) 
            {
                xmlHttpReq = new XMLHttpRequest();
                try{
                //xmlHttpReq.overrideMimeType('text/xml');
                }catch(e){;}
            }
        // IE
        else if (window.ActiveXObject) 
            {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
            }   

        xmlHttpReq.open("POST", "services/CAPS_Support.aspx", false);
        xmlHttpReq.send(strXMLDoc);
        var strResponse = xmlHttpReq.responseText;
        if(strResponse.substr(0,5)=="ERROR")
            {
            alert(strResponse);
            }
        else
            {
            window.location.href="OrderForm/OrderForm.aspx";
            }   
}