var hScrollBarHeight=18;var vScrollBarWidth=18;var tbGridList_isOverflow=false;var isIE=false;var isIE6=false;var isIE7=false;var isIE8=false;var isIE9=false;if(navigator.userAgent.indexOf("MSIE")>0){isIE=true;if(navigator.userAgent.indexOf("MSIE 6.0")>0){isIE6=true};if(navigator.userAgent.indexOf("MSIE 7.0")>0){isIE7=true};if(navigator.userAgent.indexOf("MSIE 8.0")>0){isIE8=true};if(navigator.userAgent.indexOf("MSIE 9.0")>0){isIE9=true}};function inittbGridList(){var tbGridLists=$(".tbGridList-header");var tbGridListBodies=$(".tbGridList-body");tbGridList_alignTable(tbGridLists,tbGridListBodies);tbGridLists.each(function(){var tbGridListID=$(this).attr("id");var ckb_selectAll=$(this).find(":checkbox");ckb_selectAll.click(function(){tbGridList_selectAll(tbGridListID,this.checked)})});tbGridListBodies.each(function(){var tbHeader=$("#"+$(this).attr("tbHeader"));$(":checkbox").click(function(event){if(this.checked==false){tbHeader.find(":checkbox")[0].checked=false};var trObj=$(this).parent().parent();tbGridList_selectTR(this.checked,trObj);event.stopPropagation()})});tbGridListBodies.each(function(){$(this).find("tr").each(function(){$(this).mouseover(function(){$(this).addClass("row_mouseover")}).mouseout(function(){$(this).removeClass("row_mouseover")}).click(function(){var checkboxObj=$(this).find(":checkbox")[0];var checked=checkboxObj.checked;if(checked==false){checkboxObj.checked=true}else{checkboxObj.checked=false};tbGridList_selectTR(checkboxObj.checked,$(this))})})})};function tbGridList_alignTable(tbGridLists,tbGridListBodies){var totalWidth=0;tbGridListBodies.each(function(){var tbHeader=$("#"+$(this).attr("tbHeader"));var tds=$(this).find("tr:eq(0) td");tds.each(function(){var colIndex=$(this).index();var width=tbHeader.find("tr:eq(0) td").eq(colIndex)[0].style.width;var widthFinal=parseInt(width.toString().toLowerCase().replace("px",""));if(isNaN(widthFinal)){widthFinal=100};totalWidth+=widthFinal})});var windowWidth=$(window).outerWidth();if(totalWidth>windowWidth){tbGridLists.css("width",totalWidth);$(".tbGridList-bodyContainer").css("width",totalWidth);$("#tbGridList_container").css("overflow","scroll");$("#tbGridList_container").css("overflow-y","hidden");tbGridList_isOverflow=true}else{tbGridLists.css("width","100%");$(".tbGridList-bodyContainer").css("width","");$("#tbGridList_container").css("overflow","");tbGridList_isOverflow=false};tbGridListBodies.each(function(){var tbHeader=$("#"+$(this).attr("tbHeader"));var tbHeaderWidth=tbHeader.outerWidth();var tbBodyWidth=tbHeaderWidth;if(isIE6){tbBodyWidth=tbHeaderWidth-vScrollBarWidth;tbGridListBodies.width(tbBodyWidth)};var tds=$(this).find("tr:eq(0) td");tds.each(function(){var colIndex=$(this).index();var width=tbHeader.find("tr:eq(0) td").eq(colIndex)[0].style.width;var widthFinal=parseInt(width.toString().toLowerCase().replace("px",""));if(isNaN(widthFinal)){widthFinal=100};if(colIndex!=tds.size()-1){$(this).css("width",widthFinal)}})})};function tbGridList_selectAll(tbGridListID,checked){$("table[tbHeader="+tbGridListID+"]").each(function(){$(this).find(":checkbox").each(function(){this.checked=checked;var trObj=$(this).parent().parent();tbGridList_selectTR(checked,trObj)})})};function tbGridList_selectTR(checkboxState,trObj){if(checkboxState){$(trObj).addClass("row_selected")}else{$(trObj).removeClass("row_selected")}}