ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
n6 = (document.getElementById && !document.all) ? true : false;
var agt=navigator.userAgent.toLowerCase();
var is_opera = (agt.indexOf("opera") != -1);
var is_aol = (agt.indexOf("aol") != -1);
var is_firefox = (agt.indexOf("firefox") != -1);

Bsys =''; 

c=location.href.substring(location.href.lastIndexOf('?')+1); 
if(lang){basesite=''; lUrl='o/index.htm';  
//if(lang=='uk'){ basesitex='http:\/\/www.stones7.com/metatextes/'; lUrl=basesitex+'o/index_uk.htm'; }
if(lang=='uk'){ basesitex='http:\/\/www.metatextes.com/'; lUrl=basesitex+'o/index_uk.htm'; }
} 


//if(lang!='uk'){basesite=''; lUrl='o/index.htm';  } 
//else{ basesitex='http:\/\/www.stones7.com/metatextes/'; lUrl=basesitex+'o/index_uk.htm'; } 
if(c!=null && c.length<=3){lUrl+='?'+c; } //<3 - 999
 
function preload(imgObj,imgSrc) {
	if (document.images) {eval(imgObj+' = new Image()')
						  eval(imgObj+'.src = "'+imgSrc+'"')}
}

function show(id) {  //window.status="";
        if(ns4) {document.layers[id].visibility = "show"}
        else if(ie4) {document.all[id].style.visibility = "visible"}
		else if(n6) {document.getElementById(id).style.visibility = "visible"}
}

function hide(id) { //window.status="";
        if(ns4) {document.layers[id].visibility = "hide"}
        else if(ie4) {document.all[id].style.visibility = "hidden"}
		else if(n6) {document.getElementById(id).style.visibility = "hidden"}
}

function right(e) {
if (navigator.appName == 'Netscape' && ( e.which>= 2)) return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {return false;}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;

// pour IE seulement
function nocontextmenu()  // IE4, ignored otherwise.
{ if(!is_firefox){
	event.cancelBubble = true;
	event.returnValue = false;
	return false;
}}

document.oncontextmenu = nocontextmenu;		// for IE5+
window.onmousedown = '';		// for all others


//reload
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


//pop up & go
var popItUp=0;
function ooo(URLStr, left, top, width, height)
{  if(lang!='fr'){URLStr=basesitex+URLStr; }
	if(lang>0){URLStr=basesitex+URLStr; }
	if(popItUp)
  { if(!popItUp.closed) popItUp.close(); }
  popItUp = open(URLStr, 'popItUp', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function goNew() {     
               if (ie4) {  //alert(lUrl);
                        var scw=screen.Width-10; var sch=screen.Height-27;
                        woo=window.open (lUrl, "Metatextes", "fullscreen=yes,left=0,top=0,width=" + scw + ",height=" + sch);
               }
              else if (n6 || ns4) {  woo=window.open (lUrl, "Metatextes", "fullscreen,screenX=0,screenY=0,outerWidth=" + screen.width + ",outerHeight=" + screen.height);
                }
               else { // alert('problem'); location="main.htm" 
			    }
  }