// Common
var d=document;
var BASE_URL='http://www.bepperaso.com/';
var IMAGES_URL=BASE_URL+'images/';
var SECTION_URL='';
var XH=null;
function removeAllChild(obj)
{
if(typeof(obj)=='string')
{obj=d.getElementById(obj);}
while(obj.firstChild)
{obj.removeChild(obj.firstChild);}
}
function setEvent(obj,ev,fnc)
{
if(typeof(obj)=='string')
{obj=d.getElementById(obj);}
if(BROWSER=='Internet Explorer')
{obj[ev]=new Function(fnc);}
else
{obj.setAttribute(ev,fnc);}
}
function setVisibility(e,f,v)
{
if(typeof(e)=='string')
{e=d.getElementById(e);}
if(e)
{
if(f=='visibility')
{e.style.visibility=v;}
else if(f=='display')
{e.style.display=v;}
}
}
function getVisibility(e,f)
{
if(typeof(e)=='string')
{e=d.getElementById(e);}
if(e)
{
if(f=='visibility')
{return e.style.visibility;}
else if(f=='display')
{return e.style.display;}
}
}
function getXPos(obj)
{
if(typeof(obj)=='string')
{obj=d.getElementById(obj);}
if(obj)
{
var curleft=0;
if(obj.offsetParent)
{
while(obj.offsetParent)
{
curleft+=obj.offsetLeft
obj=obj.offsetParent;
}
}
else if (obj.x)
curleft+=obj.x;
return curleft;
}
else
{return -1;}
}
function getYPos(obj)
{
if(typeof(obj)=='string')
{obj=d.getElementById(obj);}
if(obj)
{
var curtop=0;
if(obj.offsetParent)
{
while(obj.offsetParent)
{
curtop+=obj.offsetTop
obj=obj.offsetParent;
}
}
else if (obj.y)
curtop+=obj.y;
return curtop;
}
else
{return -1;}
}
function getInnerWindowWidth()
{
if (!window.innerWidth)
{return d.documentElement.clientWidth;}
else
{return window.innerWidth;}
}
function getInnerWindowHeight()
{
if(!window.innerHeight)
{return d.documentElement.clientHeight;}
else
{return window.innerHeight;}
}
function windowCenterX()
{
if(d.documentElement.scrollLeft>=0)
{return getInnerWindowWidth()/2+d.documentElement.scrollLeft;}
else
{return getInnerWindowWidth()/2+window.pageXOffset;}
}
function windowCenterY()
{
return getInnerWindowHeight()/2+pageScrollTop();
}
function pageScrollTop()
{
if(d.documentElement.scrollTop>=0)
{return d.documentElement.scrollTop;}
else
{return window.pageYOffset;}
}
function setFullScreenHeight(obj)
{
if(typeof(obj)=='string')
{obj=d.getElementById(obj);}
obj.style.height=(d.getElementById('dBody').offsetHeight>getInnerWindowHeight())?d.getElementById('dBody').offsetHeight+'px':getInnerWindowHeight()+'px';
}
function loadArray(s,d)
{
return s.split(d);
}
function createXMLHttpRequest()
{
if (window.ActiveXObject)
{return new ActiveXObject("Microsoft.XMLHTTP");}
else if (window.XMLHttpRequest)
{return new XMLHttpRequest();}
}
var autoOpenCatId=0;
function openCatMenu(id)
{
if(!id>0 && autoOpenCatId>0)
{id=autoOpenCatId;}
if(id>0)
{
var ul=d.getElementById('catMenu'+id)
if(ul.style.display=='none')
{ul.style.display='block';}
else
{ul.style.display='none';}
}
}
function open_pills_photo(id)
{
window.open('images/pills/'+id+'_big.jpg','','location=no,menubar=no,toolbar=no,status=no,scrollbars=no,width=1050,height=790');
}
function open_references()
{
window.open('references.php','','location=no,menubar=no,toolbar=no,status=no,scrollbars=yes,width=400,height=400');
}