<!--//
/* Common Function Library - 05/31/2009 */
var LIB = {
getElements:function(){
var _v1=new Array();for(var _v2=0;_v2<arguments.length;_v2++){
var _v3=arguments[_v2];if(typeof _v3==="string"||typeof _v3==="number"){
_v3=this.getElementById(_v3);
}
if(arguments.length==1){
return _v3;
}
_v1.push(elem);
}
return _v1;
}
,getElementById:function(_p1){
if(document.getElementById){
return document.getElementById(_p1);
}
else if(document.all){
return document.all[_p1];
}
else if(document.layers&&document.layers[_p1]!=null){
return this.getLayerById(document,_p1);
}
else{
return false;
}
}
,getLayerById:function(_p1,_p2){
var _v1=_p1.layers;var _v2;for(var i=0;i<_v1.length;i++){
if(_v1[i].id==_p2){
_v2=_v1[i];
}
else if(_v1[i].layers.length){
var _v3=this.getLayerById(_v1[i],_p2);
}
if(_v3){
_v2=_v3;
}
}
if(_v2){
return _v2;
}
else{
return false;
}
}
,addEvent:function(_p1,_p2,_p3,_p4){
if(_p1.addEventListener){
_p1.addEventListener(_p2,_p3,_p4);return true;
}
else if(_p1.attachEvent){
var _v1=_p1.attachEvent("on"+_p2,_p3);return _v1;
}
else{
_p1["on"+_p2]=_p3;
}
}
,toggleElement:function(_p1,_p2){
var _v1=this.getElements(_p1);if(_v1){
var _v2=this.getStyle(_p1);if(typeof _p2==="undefined"){
_p2="block";
}
if(_v2.display=="none"){
_v2.display=_p2;
}
else{
_v2.display="none";
}
}
}
,getStyle:function(_p1){
if(document.getElementById){
return document.getElementById(_p1).style;
}
else if(document.all){
return document.all[_p1].style;
}
else if(document.layers){
return this.getLayerById(document,_p1);
}
}
,addLoadEvent:function(_p1){
var _v1=window.onload;if(typeof window.onload!=="function"){
window.onload=_p1;
}
else{
window.onload=function(){
_v1();_p1();
}
}
}
,insertElement:function(_p1,_p2){
var _v1=this.getElements(_p1);if(_v1){
_v1.appendChild(_p2);
}
}
,removeElement:function(_p1){
var _v1=this.getElements(_p1);if(_v1){
var _v2=_v1.parentNode;_v2.removeChild(_v1);
}
},insertContent:function(_p1,_p2){
if(_p1){
if(typeof _p2==="string"){
var _v1=document.createTextNode(_p2);
this.insertElement(_p1,_v1);
}else{
if(_p2){
this.insertElement(_p1,_p2);
}else{
alert("could not insert content.");
}
}
}
}
}

//-->
