﻿// JScript File

function search_product()
{
    var v=document.getElementById('ctl00_stext');
    
    location.href = '/loading.aspx?s=' + v.value;
}


function affOpen(url)
{
    
    window.open(url,null);

}

function showDiv(whichLayer)
    {
        if (document.getElementById)
        {
            // this is the way the standards work
            var style2 = document.getElementById(whichLayer).style;
            style2.display = style2.display? "":"block";
        }
        else if (document.all)
        {
            // this is the way old msie versions work
            var style2 = document.all[whichLayer].style;
            style2.display = style2.display? "":"block";
        }
        else if (document.layers)
        {
            // this is the way nn4 works
            var style2 = document.layers[whichLayer].style;
            style2.display = style2.display? "":"block";
        }
     }
    
    function forceClick(e, elemId) {
        var elem = document.getElementById(elemId);
        var evt = (e) ? e : window.event;
        var intKey = (evt.which) ? evt.which : evt.keyCode;
        
        if(intKey == 13) {
            elem.click();
            return false;
        }

        return true;
    }
    
function sendtofriend(url)
{
    
    window.open(url,null);

}

function OpenDialogWindow(url,width,height,id)
    {
        //open a new dialog window
        var sFeatures="dialogHeight: " + height + "px;";
        sFeatures += "dialogWidth: " + width + "px;";
        sFeatures += "center: yes;";
        sFeatures += "edge: sunken;";
        sFeatures += "scroll: no;";
        sFeatures += "status: yes;";
        sFeatures += "resizeable: no;";        
        
        //url = _server + '/activity/' + url;
        
        var returnValueFromChild = window.showModalDialog(url, id, sFeatures);                    
    }
    
    function onImgErrorSmall(source)
{
    source.src = "/images/image_not_avail.gif";
    // disable onerror to prevent endless loop
    source.onerror = "";
    return true;
}
