function openMax(url) {
	window.open(
		url, 
		'_blank', 
		'toolbar=yes,scrollbars=yes,directories=yes,status=yes,menubar=yes,resizable=yes,location=yes,'
		+'left=0,top=0,width=' + screen.availWidth + ', height=' + screen.availHeight
	); 
	return false;
}
function get_browser()
{
var bver=null;
if(document.layers)
{bver='nn4';
}
else if(document.all)
{
if(window.opera)
	{bver='opera';
	}
else
	{bver='ie4';
	}
}
else if(document.getElementById)
{
if(navigator.userAgent.indexOf('gecko')>-1)
	{bver='mozilla';
	}
else
	{bver='nn6';
	}
}
if((window.opera)&&((navigator.appVersion.indexOf('MSIE 5.0')>-1)||(parseInt(navigator.appVersion)==6)))
{
bver='opera6';
}
return bver;
}

function replace_tags(STR,STR1,STR2)
{
var rexp,S;
S=STR;
rexp=new RegExp(STR1,"gi");
S=S.replace(rexp,STR2);
return S;
}

function preloadImg(file) {
 	img = new Image();
	img.src = file;
}

function change_image(elname, srcname) {
if (srcname=='1') {
  elname.src=replace_tags(elname.src,'\.gif','_over.gif');
}
else {
  elname.src=replace_tags(elname.src,'_over.gif','\.gif');
}
}

function NewWindow(w,v,s,d)
{
eval("window.open('"+v+"','"+w+"','height="+s+",width="+d+",status=no,location=no,toolbar=no,directories=no,menubar=no');");
}

function NewWindow2(w,v,s,d)
{
eval("window.open('"+v+"','"+w+"','height="+s+",width="+d+",status=no,location=no,toolbar=no,directories=no,menubar=yes');");
}
function NewWindow3(w,v,s,d)
{
eval("window.open('"+v+"','"+w+"','height="+s+",width="+d+",status=no,location=no,toolbar=no,directories=yes,menubar=yes');");
}
function NewWindow4(w,v,s,d)
{
var w_top=screen.height/2;
var w_left=screen.width/2;
if(s>0)
{
w_top=w_top-s/2;
}
if(d>0)
{
w_left=w_left-d/2;
}
eval("window.open('"+v+"','"+w+"','height="+s+",width="+d+",top="+w_top+",left="+w_left+"status=no,location=no,toolbar=no,directories=no,menubar=no,scrollbars=0');");
}





function CheckEmailFormat( email )
{
	var s = '[A-Za-z0-9][-\\w]*(\\.[A-Za-z0-9][-\\w]*)*'
	var re = new RegExp( '^'+s+'@'+s+'\\.[a-zA-Z]{2,4}$')
	email = email.replace( new RegExp('/\(.*?\)/'), '' )
	return re.test(email)
}


function get_document_object(ElName)
{
if((ElName=="")||(ElName==null))
	{return null;
	}
if(ElName.indexOf('-')>-1)
	{return null;
	}
var El;
if((BROWSER_ID=='ie4')||(BROWSER_ID=='opera'))
{
El=eval("document.all."+ElName);
}
else if((BROWSER_ID=='mozilla')||(BROWSER_ID=='nn6'))
{
El=document.getElementById(ElName);
}
else if(BROWSER_ID=='opera6')
{
if(OPERA_AS_IE==false)
{
El=document.getElementById(ElName);
}
else
{
El=eval("document.all."+ElName);
}
}
return El;
}



function getElementParams(CEl)
{
if(CEl==null)
	{return null;
	}
var Y=0;
var X=0;
var W=0;
var H=0;
var El;
if((BROWSER_ID=='ie4')||(BROWSER_ID=='opera')||(BROWSER_ID=='mozilla')||(BROWSER_ID=='nn6')||(BROWSER_ID=='opera6'))
{
El=CEl;
       do 
	{ Y += El.offsetTop } 
       while ((El = El.offsetParent) != null);
El=CEl;
       do 
	{ X += El.offsetLeft } 
       while ((El = El.offsetParent) != null);
}
W=CEl.offsetWidth;
H=CEl.offsetHeight;
var arr=new Array();
arr[0]=X;
arr[1]=Y;
arr[2]=W;
arr[3]=H;
arr[4]=X+W;
arr[5]=Y+H;
return arr;
}


function number_format(a, b, c, d) {
 a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
 e = a + '';
 f = e.split('.');
 if (!f[0]) {
  f[0] = '0';
 }
 if (!f[1]) {
  f[1] = '';
 }
 if (f[1].length < b) {
  g = f[1];
  for (i=f[1].length + 1; i <= b; i++) {
   g += '0';
  }
  f[1] = g;
 }
 if(d != '' && f[0].length > 3) {
  h = f[0];
  f[0] = '';
  for(j = 3; j < h.length; j+=3) {
   i = h.slice(h.length - j, h.length - j + 3);
   f[0] = d + i +  f[0] + '';
  }
  j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
  f[0] = j + f[0];
 }
 c = (b <= 0) ? '' : c;
 return f[0] + c + f[1];
}


function openTopMenu(){
	var els = document.getElementById('topPanel').getElementsByTagName('li');
	for(var i=0; i<els.length; i++){
	  if(els[i].className == "ddlevel"){
  		els[i].onmouseover = function(){
  			this.className += " hover";
  		}
  		els[i].onmouseout = function(){
  		  var el = this;
  			setTimeout(function(){
          el.className = el.className.replace(" hover", "");
        },500);
  		}
  	}
	}
}

function bookmarksite(title,url){
if (window.sidebar) // firefox
        window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
        var elem = document.createElement('a');
        elem.setAttribute('href',url);
        elem.setAttribute('title',title);
        elem.setAttribute('rel','sidebar');
        elem.click();
} 
else if(document.all)// ie
        window.external.AddFavorite(url, title);
}

function act_homepic(obj,MODE)
{
if(MODE==1)
{
document.all.homepic.src='/img/home-a.gif';obj.className='mainmenuact';
}
else
{
document.homepic.src='/img/home.gif';obj.className='mainmenu';
}
}



