﻿$(document).ready(function() {
    $('div.index a').mousedown(
        function() {
            $('a.selected').removeClass('selected');
            this.className = 'selected';
        }
    );
    $('div.index a').click(
        function() {
            return false;
        }
    );
    $('div.slider .toggler, div.slider .slideHeaderCollapseIcon, ').click(
        function() {
            var slider = $(this.parentNode.parentNode);
            var content = slider.children('.content');
            slider.toggleClass('open');
            $('div.slider .slideHeaderCollapseIcon').toggle();
            content.toggle();
            return false;
        }
    );
});

function OpenWindow(url) 
{
    var ir = window.open(url, null, 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=740,height=850,top=0,left=250'); 
    ir.focus();
}

//function cb_verify(sender ,arg) {

//    var val = window.document.getElementById( (document.getElementById(sender.id)).controltovalidate);
//   
//    var col = val.getElementsByTagName("*");

//  
//    if ( col != null )
//    {
//        for ( i = 0; i < col.length; i++ ) 
//        {
//           
//            if (col[i].tagName == "INPUT") 
//            {
//                if (col[i].checked) {

//                    arg.IsValid = true;
//                    return true;
//                }
//            }
//        }

//        arg.IsValid = false; 
//        return false;

//    }
//}


///************** UPDATE PROCESS *******************/

//function getUpdatePanelId(sender) {

//    return sender._updatePanelClientIDs[0];
//}


//Sys.Application.add_load(applicationLoadHandler);
//function applicationLoadHandler() {    
//    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
//    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);
//}

//function beginRequest(sender, args) {
//    var panelId = getUpdatePanelId(sender);

//    var updatePanel = $get(panelId);
//    updatePanel.setAttribute('updated', 'false');

//    var ajaxTimeOut = window.setTimeout("updateProcess('" + panelId + "',true);", 200);
//}

//function pageLoaded(sender, args) {   
//    var panelId = getUpdatePanelId(sender);
//    updateProcess(panelId, false);
//}

//if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded();

//function updateProcess(panelId,  bStart) {

//    var updatePanel = $get(panelId);
//    var pid = updatePanel.getAttribute('updateProcessId')
//    if (!pid) {
//        return;
//    }
//    var updateProcess = $get(pid);
//    var updateProcessBg = updateProcess.getElementsByTagName('div')[0];
//    
//    var location = Sys.UI.DomElement.getBounds(updatePanel);

//    updateProcess.style.top = location.y + "px";
//    updateProcess.style.left = location.x + "px";
//    updateProcess.style.width = updateProcessBg.style.width = location.width + "px";
//    updateProcess.style.height = updateProcessBg.style.height = location.height + "px";

//    if (bStart) {
//        if (updatePanel.getAttribute('updated') !== 'true') {
//            updateProcess.style.display = "block";
//        }
//       
//    }
//    else {
//        updateProcess.style.display = "none";
//        updatePanel.setAttribute('updated', 'true');
//    }
//    ///alert(updatePanel.getAttribute('updated'));
//}
