﻿// JavaScript Document

window.onload=function(){
    doFilter();
}

function doFilter(){
    document.getElementById("news_noresult").style.display="none";
    var objCompanySel = document.getElementById("cmbCompany");
    var strCompany = objCompanySel.options[objCompanySel.selectedIndex].value;

    strCompany = strCompany.replace(/&/g, "&amp;");
    
    if (strCompany > ""){
        var intCount = 0;
        for (var intI = 1; intI <= arrCompany.length; intI++){
	        var objRow = document.getElementById("news_"+intI);
	        if (objRow){
	            if (strCompany == "All" || strCompany == arrCompany[intI]) {
	                intCount++;						
			        objRow.style.display = "";
	            }
		        else {
			        objRow.style.display = "none";
		        }
	        }
        }
        if (intCount == 0){
            document.getElementById("news_noresult").style.display="";
        }	
    }
}