function beginRequest(sender, args) {
    // show the popup
    $find('mdlPopup').show();
}

function endRequest(sender, args) {
    //  hide the popup
    $find('mdlPopup').hide();
    window.scrollTo(0, 180);
}
function endRequest_Grand(sender, args) {
    //  hide the popup
    $find('mdlPopup').hide();
    window.scrollTo(0, 999999);
}

function endRequest_News(sender, args) {
    //  hide the popup
    $find('mdlPopup').hide();
    //window.scrollTo(0, 430);
}
function endRequest_Products(sender, args) {
    //  hide the popup
    $find('mdlPopup').hide();
    //window.scrollTo(0, 300);
}
function showElement(elementId) {
    $content = document.getElementById(elementId).innerHTML;

    if ($content.length > 163) {// have images then display; 163 = lenght of the table cell
        var element;
        if (document.all)
            element = document.all[elementId];
        else if (document.getElementById)
            element = document.getElementById(elementId);
        if (element && element.style)
            element.style.display = '';    
                
    } 
}
function hideElement(elementId) {
    var element;
    if (document.all)
        element = document.all[elementId];
    else if (document.getElementById)
        element = document.getElementById(elementId);
    if (element && element.style)
        element.style.display = 'none';
}
function ShowImage() {
    document.getElementById('txtSearch').style.backgroundImage = 'url(../images/ajax-loader-small.gif)';
    document.getElementById('txtSearch').style.backgroundRepeat = 'no-repeat';
    document.getElementById('txtSearch').style.backgroundPosition = 'right';
}
function HideImage() {
    document.getElementById('txtSearch').style.backgroundImage = 'none';
}
function clearText(theText) {
    if (theText.value == theText.defaultValue) {
        theText.value = "";
        theText.style.backgroundColor = '#FFFFC1';
    }
    else if (theText.value == "") {
    theText.value = theText.defaultValue;
    theText.style.backgroundColor = '#FFFFDF';
    }
    
}

