﻿// JScript File

function check(strItemsName,value){
    try{    
        //alert(value); return;
        var listItems=document.getElementsByName(strItemsName);
        
        if(!listItems) return;
        
        for(iIndex=0;iIndex<listItems.length;iIndex++){
            var item=listItems[iIndex];
            if(!listItems[iIndex]) continue;
            item.checked=value;
            //alert(item.value);
        }
        return true;
    }catch(e){
        return false;
    }
}
function ShowHide(name){
    var obj=document.getElementById(name);
    if(!obj){
    alert(name+' is null or not an object');
     return;
     }
    obj.style.display=(obj.style.display==''?'none':'');
}
function PopUp(url,name,feature){
    try{
        if(url=="")return;
        if(!feature||feature=='')feature="width=700";
        window.open(url,name,feature);
    }catch(e){
        alert(e.message);
    }
}
function PopUpNoOption(url){
    try{
        if(url=="")return;
        window.open(url,"","");
    }catch(e){
        alert(e.message);
    }
}

function show(t){
		var obj=document.getElementById(t);
		if(!obj) return;
		obj.style.display='';
		
		iWidth=screen.availWidth*0.55;
		obj.style.width=iWidth-155;
	}

	function hide(t){
		var obj=document.getElementById(t);
		if(!obj) return;
		obj.style.display='none';
	}
	
	
	function searchUrl(a,url,strtextid){
	    try{
	        
	        
	        var obj=document.getElementById(strtextid);
	        
	        //alert(strtextid+':'+(!obj?'null':'not null'));
	        
	        if(!obj) return;
	        urlvalue=url.replace("[text]",obj.value);
	        window.location=urlvalue;
	        window.submit();
	        
	    }catch(ex){
	        //alert(ex.message);
	    }
	}
	
	
