
function DOMManipII()
{var v;this.isIE=/*@cc_on!@*/false;if(this.isIE){v=parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]);this.ancientIE=(v<6);this.legacyIE=(v<7);}else{this.ancientIE=false;this.legacyIE=false;}
this.isSupported=!!(document.getElementById&&document.createElement);this.dommanipVersion=2;}
DOMManipII.prototype.emptyElement=function(el)
{while(el.firstChild){el.removeChild(el.firstChild);}};DOMManipII.prototype.appendE=DOMManipII.prototype.appendElement=function(pnt,tag,id)
{var nel=false;if(pnt&&tag){nel=document.createElement(tag);if(nel){if(id&&!document.getElementById(id)){nel.setAttribute('id',id);}
pnt.appendChild(nel);}}
return nel;};DOMManipII.prototype.appendElementBefore=function(sib,tag,id)
{var nel=false;var pnt;if(sib&&sib.parentNode&&tag){pnt=sib.parentNode;nel=document.createElement(tag);if(nel){if(id&&!document.getElementById(id)){nel.setAttribute('id',id);}
pnt.insertBefore(nel,sib);}}
return nel;};DOMManipII.prototype.appendText=function(pnt,text)
{if(pnt&&text){pnt.appendChild(document.createTextNode(text));}};DOMManipII.prototype.appendLText=function(pnt,text)
{var i;var lt;if(text.split){lt=text.split("\n");}
if(lt&&lt.length>1){this.appendText(pnt,lt[0]);for(i=1;i<lt.length;i++){this.appendE(pnt,'br');this.appendText(pnt,lt[i]);}}else{this.appendText(pnt,text);}};DOMManipII.prototype.appendDiv=function(pnt,id)
{return this.appendE(pnt,'div',id);};DOMManipII.prototype.appendSpan=function(pnt,id)
{return this.appendE(pnt,'span',id);};DOMManipII.prototype.appendLink=function(pnt,dest,id)
{var a=this.appendE(pnt,'a',id);if(a){a.setAttribute('href',dest);}
return a;};DOMManipII.prototype.appendLabel=function(pnt,t)
{var nel;if(this.isIE){nel=this.appendE(pnt,'<label for="'+t+'">');}else{nel=this.appendE(pnt,'label');if(nel){nel.setAttribute('for',t);}}
return nel;};DOMManipII.prototype.appendInputText=function(pnt,id,defaultValue)
{var nel;nel=document.createElement('input');nel.setAttribute('type','text');nel.setAttribute('id',id);nel.setAttribute('name',id);if(pnt&&nel){pnt.appendChild(nel);if(defaultValue){nel.value=defaultValue;}}
return nel;};DOMManipII.prototype.appendCheckbox=function(pnt,id,chk)
{var nel;nel=document.createElement('input');nel.setAttribute('type','checkbox');nel.setAttribute('id',id);nel.setAttribute('name',id);if(chk){nel.setAttribute('defaultChecked',true);nel.setAttribute('checked',true);}
if(pnt&&nel){pnt.appendChild(nel);}
return nel;};DOMManipII.prototype.appendRadio=function(pnt,gid,va)
{var nel;var id=gid+'_'+va;if(this.isIE){nel=this.appendE(pnt,'<input type="radio" name="'+gid+'" value="'+va+'">',id);}else{nel=document.createElement('input');if(pnt&&nel){nel.setAttribute('type','radio');nel.setAttribute('name',gid);nel.setAttribute('id',id);nel.setAttribute('value',va);pnt.appendChild(nel);}}
return nel;};DOMManipII.prototype.appendSelect=function(pnt,id)
{var nel=document.createElement('select');nel.setAttribute('name',id);nel.setAttribute('id',id);pnt.appendChild(nel);return nel;};DOMManipII.prototype.appendOption=function(pnt,va,la)
{var nel=this.appendE(pnt,'option');nel.setAttribute('value',va);this.appendText(nel,la);return nel;};DOMManipII.prototype.appendButton=function(pnt,tp,id)
{var nel;nel=document.createElement('button');nel.setAttribute('type',(tp=='submit'||tp=='cancel')?tp:'button');nel.setAttribute('id',id);nel.setAttribute('name',id);if(pnt&&nel){pnt.appendChild(nel);}
return nel;};DOMManipII.prototype.setOpacity=function(p,opacity)
{var obj=this.ele(p);if(!obj){return false;}
if(isNaN(opacity)||opacity>100){opacity=100;}else if(opacity<0){opacity=0;}
if(this.isIE){obj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+opacity+")";}else{obj.style.KHTMLOpacity=obj.style.MozOpacity=obj.style.opacity=opacity/100;}
return true;};DOMManipII.prototype.isDOM=function(obj)
{return(obj&&typeof(obj)=='object'&&obj.nodeType);};DOMManipII.prototype.ele=function(p)
{if(typeof(p)=='string'&&document.getElementById){return document.getElementById(p);}else{return(this.isDOM(p))?p:false;}};
