
function ObjGetStyle(el,property)
{var value=null;var dv=document.defaultView;if(property=='opacity'&&el.filters)
{value=1;try{value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=el.filters.item('alpha').opacity/100;}catch(e){}}}
else if(el.style[property])
{value=el.style[property];}
else if(el.currentStyle&&el.currentStyle[property]){value=el.currentStyle[property];}
else if(dv&&dv.getComputedStyle)
{var converted='';for(var i=0,len=property.length;i<len;++i){if(property.charAt(i)==property.charAt(i).toUpperCase())
{converted=converted+'-'+property.charAt(i).toLowerCase();}else{converted=converted+property.charAt(i);}}
if(dv.getComputedStyle(el,'')&&dv.getComputedStyle(el,'').getPropertyValue(converted)){value=dv.getComputedStyle(el,'').getPropertyValue(converted);}}
return value;}
function ObjGetXY(el)
{var doc=el.ownerDocument;var parent=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+scrollLeft,box.top+scrollTop];}
else if(doc.getBoxObjectFor){box=doc.getBoxObjectFor(el);var borderLeft=parseInt(ObjGetStyle(el,'borderLeftWidth'));var borderTop=parseInt(ObjGetStyle(el,'borderTopWidth'));if(isNaN(borderLeft))
borderLeft=0;if(isNaN(borderTop))
borderTop=0;var x=box.x-borderLeft;var y=box.y-borderTop;if(x==0&&y==0)
{if(ObjGetStyle(el,'display')=='none')
{x=parseInt(ObjGetStyle(el,'left'));y=parseInt(ObjGetStyle(el,'top'));}}
pos=[x,y];}
else{pos=[el.offsetLeft,el.offsetTop];parent=el.offsetParent;if(parent!=el){while(parent){pos[0]+=parent.offsetLeft;pos[1]+=parent.offsetTop;parent=parent.offsetParent;}}
if(ua.indexOf('opera')!=-1||(ua.indexOf('safari')!=-1&&ObjGetStyle(el,'position')=='absolute')){pos[0]-=doc.body.offsetLeft;pos[1]-=doc.body.offsetTop;}}
if(el.parentNode){parent=el.parentNode;}
else{parent=null;}
while(parent&&parent.tagName!='BODY'&&parent.tagName!='HTML')
{if(parent.scrollLeft)
pos[0]-=parent.scrollLeft;if(parent.scrollTop)
pos[1]-=parent.scrollTop;if(parent.parentNode){parent=parent.parentNode;}
else{parent=null;}}
return pos;};function ObjToggleDisplay(doc,id,visiblevalue)
{var obj=doc.getElementById(id);if(!obj)
return;obj.style.display=(obj.style.display=='none')?visiblevalue:'none';}
function ShowObjById(doc,id)
{var obj=doc.getElementById(id);if(obj)
obj.style.visibility='visible';}
function HideObjById(doc,id)
{var obj=doc.getElementById(id);if(obj)
obj.style.visibility='hidden';}
function ShowObj(obj)
{if(obj)
obj.style.visibility='visible';}
function HideObj(obj)
{if(obj)
obj.style.visibility='hidden';}
function ObjDisplay(obj,display_or_not)
{if(!obj)
return;if(typeof obj.hidden=="boolean")
{obj.hidden=!display_or_not;}
else
{obj.style.display=display_or_not?'block':"none";}}
function ObjIsHidden(obj)
{if(!obj)
return;var ret=false;if(obj.hidden)
{ret=true;}
else
if(typeof obj.hidden=="boolean"&&(!obj.hidden))
{ret=false;}
else
if(obj.style&&obj.style.display=="none")
{ret=true;}
return ret;}
function ObjVisible(obj)
{if(!obj)
return false;return obj.style.visibility!='hidden';}
function RemoveObjById(doc,id)
{var parent=null;var obj=doc.getElementById(id);parent=obj.parentNode;if(parent)
parent.removeChild(obj);}
function ObjSeeable(doc,objElem)
{var obj;obj=(objElem.style)?objElem.style:objElem;var left=obj.style.pixelLeft;var width=obj.style.pixelWidth;var top=obj.style.pixelTop;var height=obj.style.pixelHeight;var docleft=doc.body.scrollLeft;var docwidth=doc.body.scrollWidth;var doctop=doc.body.clientTop;var docheight=doc.body.clientHeight;if(left+width<docleft||left>docleft+docwidth)
{return false;}
if(top+height<doctop||top>doctop+docheight)
{return false;}
return true;}
function ObjGetAllIds(doc,tagname,prefix)
{var ids=new Array();var objs=doc.getElementsByTagName(tagname);var prelen=prefix.length;for(var i=0;i<objs.length;i++)
{if(objs[i].id)
if(objs[i].id.indexOf(prefix)==0)
{var id=objs[i].id.substring(prelen);ids[id]=1;}}
return ids;}
function ObjGetX(obj)
{if(!obj)
return 0;var x=0;if(obj.boxObject)
x=obj.boxObject.x;else
{x=ObjGetXY(obj)[0];}
return x;}
function ObjGetY(obj)
{if(!obj)
return 0;var y=0;if(obj.boxObject)
y=obj.boxObject.y;else
{y=ObjGetXY(obj)[1];}
return y;}
function ObjGetW(obj)
{if(!obj)
return 0;var w=0;if(obj.boxObject)
{w=obj.boxObject.width;}
else
if(obj.clientWidth)
{w=obj.clientWidth;}
else
if(obj.style&&typeof obj.style.pixelWidth!="undefined")
{w=obj.style.pixelWidth;}
else
if(obj.style&&typeof obj.style.width!="undefined")
{w=parseInt(obj.style.width);}
return w;}
function ObjGetH(obj)
{if(!obj)
return 0;var h=0;if(obj.boxObject)
{h=obj.boxObject.height;}
else
if(obj.clientHeight)
{h=obj.clientHeight;}
else
if(obj.style&&(obj.style.pixelHeight||obj.style.height))
{h=obj.style.pixelHeight?obj.style.pixelHeight:parseInt(obj.style.height);}
if(h==0)
{}
return h;}
function ObjById(doc,id)
{var obj=id;if((typeof(id)=="string"))
{if(id=="document")
{obj=doc;}else
{obj=(doc.getElementById)?doc.getElementById(id):doc.all[id];}}
return obj;}
function ObjMoveTo(obj,x,y)
{if(!obj)return;if(obj.style.pixelLeft)
{obj.style.pixelLeft=x;obj.style.pixelTop=y;}else
{if(typeof obj.style.left=='string')
{obj.style.left=''+x+'px';obj.style.top=''+y+'px';}else
{obj.style.left=x;obj.style.top=y;}}}
function ObjResizeTo(obj,w,h)
{if(!obj)
return;if(obj.style.pixelWidth)
{if(w>=0)
obj.style.pixelWidth=w;if(h>=0)
obj.style.pixelHeight=h;}else
{if(typeof obj.style.width=='string')
{if(w>=0)
obj.style.width=''+w+'px';if(h>=0)
obj.style.height=''+h+'px';}else
{if(w>=0)
obj.style.width=w;if(h>=0)
obj.style.top=h;}}}
function ObjMoveBy(obj,dx,dy,obj2)
{if(!obj)
return;if(typeof obj2=='undefined')
obj2=obj;if(obj.style.pixelLeft)
{obj.style.pixelLeft=obj2.style.pixelLeft+dx;obj.style.pixelTop=obj2.style.pixelTop+dy;}else
{if(typeof obj.style.left=='string')
{obj.style.left=''+(parseInt(obj2.style.left)+dx)+'px';obj.style.top=''+(parseInt(obj2.style.top)+dy)+'px';}else
{obj.style.left=parseInt(obj2.style.left)+dx;obj.style.top=parseInt(obj2.style.top)+dy;}}}
function ObjResizeBy(obj,w,h)
{if(!obj)
return;if(obj.style.pixelWidth)
{if(w>=0)
obj.style.pixelWidth+=w;if(h>=0)
obj.style.pixelHeight+=h;}else
{if(w>=0)
obj.style.width+=w;if(h>=0)
obj.style.top+=h;}}
function ObjResizeChildsBy(objElem,X,Y)
{var childnum=objElem.childNodes.length;for(i=0;i<childnum;i++)
{var obj2=objElem.childNodes[i];if(obj2.tagName=="IMG")
{obj2.width+=X;obj2.height+=Y;}else
{obj2=obj2.style;if(obj2)
{obj2.pixelWidth+=X;obj2.pixelHeight+=Y;}}}}
function ObjPopup(win,obj)
{var x=obj.style.pixelLeft?obj.style.pixelLeft:parseInt(obj.style.left);var y=obj.style.pixelTop?obj.style.pixelTop:parseInt(obj.style.top);y=y-1;if(y>0)
{ObjMoveBy(obj,0,-2);}
return y;}
function ObjSetLabel(doc,id,label)
{elt=doc.getElementById(id);if(!elt)
return;if(typeof elt.value!="undefined")
{elt.value=label;}else
if(elt.setAttribute)
{elt.setAttribute("label",label);}else
if(elt.innerHTML)
{elt.innerHTML=label;}}
function ObjGetLabel(doc,id)
{var label="";elt=doc.getElementById(id);if(elt.value)
{label=elt.value;}else
if(elt.getAttribute)
{label=elt.getAttribute("label");}
return label;}
function ObjSetInnerHtmlById(doc,id,innerHtml)
{var obj=doc.getElementById(id);if(obj)
obj.innerHTML=innerHtml;}
function WinGetX(win)
{return(isIE)?win.screenLeft:win.screenX;}
function WinGetY(win)
{return(isIE)?win.screenTop:win.screenY;}
function WinGetW(win)
{var outerW=200;if(isFF)
outerW=win.outerWidth;else
if(win.document&&win.document.body)
outerW=win.document.body.clientWidth;return outerW;}
function WinGetH(win)
{var outerH=500;if(isFF)
outerH=win.outerHeight;else
if(win.document&&win.document.body)
outerH=win.document.body.clientHeight;return outerH;}
function FrameGetW(win,doc)
{if(!doc)
doc=win.document;var frameWidth=200;if(win.innerWidth)
{frameWidth=win.innerWidth;}
else if(doc.documentElement&&doc.documentElement.clientWidth)
{frameWidth=doc.documentElement.clientWidth;}
else if(doc.body)
{frameWidth=doc.body.clientWidth;}
return frameWidth;}
function FrameGetH(win,doc)
{if(!doc)
doc=win.document;var frameHeight=200;if(win.innerWidth)
{frameHeight=win.innerHeight;}
else if(doc.documentElement&&doc.documentElement.clientWidth)
{frameHeight=doc.documentElement.clientHeight;}
else if(doc.body)
{frameHeight=doc.body.clientHeight;}
return frameHeight;}
function ObjSetStyles(doc,id_s,name,value)
{if(typeof id_s=="string")
{ObjSetStyleById(doc,id_s,name,value);}else
if(typeof id_s=="array"||typeof id_s=="object")
{for(var i=0;i<id_s.length;i++)
{ObjSetStyleById(doc,id_s[i],name,value);}}}
function ObjSetStyleById(doc,id,name,value)
{var obj=doc.getElementById(id);if(obj)
{obj.style[name]=value;}
return;}
function ObjSetOpacity(obj,val)
{if(!obj)
return;if(obj.filters)
{if(obj.filters['alpha'])
{obj.filters['alpha'].opacity=val;}
else
{obj.style.filter="alpha(opacity="+val+")";}}
else
if(typeof(obj.style.MozOpacity)!="undefined")
{obj.style.MozOpacity=val/100;}
else
if(typeof(obj.style.opacity)!="undefined")
{obj.style.opacity=val;}}
