var cat1 = "", cat2 = "";

function doNotify(_cat1, _cat2) {

    cat1 = _cat1; cat2 = _cat2;
    
	if(!ajGetXmlRequester()) {			
		location.href = "/usr/notify/show.do?cat1="+_cat1+"cat2="+_cat2;
	} else {		
		var sUrl = "/ajx/wrk/notify/show.do";
		var pid = Math.round(Math.random() * 100);
						
		ajSendRequest(sUrl, "", 0, pid, "catchNotify");		
	}
}

function catchNotify(response) {		

	response = unescape(response);	
	
	if(response.substring(0,10).indexOf(sRedir) != -1) {	
		redir(response);
	} else {
    	var isForm = response.indexOf("<form") != -1;
    	var isVisible = checkVisibility("layerstd");
        
        if(isVisible && !isForm) {	  
    	  fadeElement('layerstd',95,900,1);
    	} else if(!isVisible && isForm) {			
    	  document.getElementById("layerstd").innerHTML = response;
    	  catInit(); initNotify(cat1, cat2);
    	  fadeElement('layerstd',95,900,1,-1,-1,380,230);	  		
    	} else {
    	  document.getElementById("layerstd").innerHTML = response;	
    	}	
    }			
}

function initNotify(cat1, cat2) {    

    var notifyForm = document.getElementById("notifyForm");
    if(cat1 != null && cat1.length > 0) {
        setSelectIndex(notifyForm.cat1, cat1);
        popNotify();        
        if(cat2 != null && cat2.length > 0) {
            setSelectIndex(notifyForm.cat2, cat2);
        }
    }
}

function popNotify() {   
     var notifyForm = document.getElementById("notifyForm");
     list = notifyForm.cat2;
     str = notifyForm.cat1.value;       
     if(str != "*") { 
        objTree.popCat2(list,str, strAll);
    }
}