// JavaScript Document
window.onload=initMouseEvents;
function initMouseEvents(){
if(document.layers){
	//document.captureEvents(Event.MOUSEDOWN)
	//document.captureEvents(Event.MOUSEDOWN)	
	document.captureEvents(Event.MOUSEMOVE)	
	}
	//document.onmousedown=captureMousedown;
	//document.onmousedown=captureMousemove;
	document.onmousemove=captureMousemove;	
	
}
function captureMousedown(evt){
	
	if(evt){
		mouseClick=evt.which;
		
	}
	else{
		mouseClick=window.event.button;
		
		
	}
	
	if(mouseClick==1 || mouseClick==2 || mouseClick==3){
		
		
		alert('Meniu dezactivat')
		return false
	}
}

function captureMousemove(evt){
	
	if(document.all)
	{
		
		mousex=window.event.clientX;
		mousey=window.event.clientY;
		
	}else
	{
		
		mousex=evt.pageX;
		mousey=evt.pageY;
	}
	
	
}
	

function ShowPanel(panel,continut, latime,inaltime)
{
	
	
	
	if(document.getElementById){
	panel1=document.getElementById(panel);
	}else{
	panel1=eval(document+"."+panel);	
	}
	//------------------
w=(latime!=null)?latime:800;
h=(inaltime!=null)?inaltime:'auto';
//alert(latime);
h='auto';
bc='#000000';
bgc='#000000';
lkc='#bbcccc';


if(document.all){
maxh=document.body.clientHeight;
maxw=document.body.clientWidth;
}
else{
maxh=window.innerHeight;
maxw=window.innerWidth;//sau window.outerWidth
}

if(maxw/2 >=400)
leftpos=maxw/2-400;
else
leftpos=10;

//topNew=(mousey!=null)?mousey:10;
topNew=10;//Math.abs(mousey-maxh)/2;

/*
leftpos=0;
topNew=0;
w=maxw;
h='100%';*/
if(panel1)
{
	
    //if(panel1.style.visibility=='hidden')
       // {
        
        // panel1.innerText=sursa;//asta afiseaza sursa doar sub forma de text pe ecran,
        // chiar daca bag taguri in sursa
        panel1.innerHTML='<div width=100% hight=10px style="text-align:right;background-color:'+bc+
        '"  ><a href="#" onclick="panel1.style.visibility=\'hidden\';" style="color:'+lkc+
        ';  font-weight:bold; text-decoration:none;" >INCHIDE</a></div>'+ continut;
		//ajaxpage(continut, 'divPozamare');
		//continut;
		//document.write(continut);
		panel1.style.position='absolute';
		panel1.style.top=topNew;;
		//panel1.style.visibility='hidden';
		//position:absolute; top:10;  visibility:hidden
        panel1.style.width=w;
        panel1.style.height=h;
        panel1.style.border=bc+ ' thick solid';
        panel1.style.backgroundColor=bgc;
        panel1.style.visibility='visible';
        panel1.style.zIndex =800;
        panel1.style.left=leftpos;
		//panel1.style='text-align:center';
		panel1.style.cursor='pointer';
		//alert(panel1.style.width);
        //panel1.attachEvent("onblur",HidePanel);
        //panel1.addEventListener("ondblclick",HidePanel(),true);
		panel1.onclick=function(){
			panel1.innerHTML='';
			panel1.style.width=0;
			panel1.style.height=0;
			panel1.style.border='none';
			panel1.style.backgroundColor='transparent';
			panel1.style.color='#ff0000';
			panel1.style.visibility='hidden';
		}
        
        
        /*}
        else
        {
        panel1.innerHTML='<div width=100% hight=10px style="text-align:right;background-color:'+bc+
        '"  ><a href="#" onclick="panel1.style.visibility=\'hidden\';" style="color:'+lkc+
        ';  font-weight:bold; text-decoration:none;" >INCHIDE</a></div>'+ continut;
        // panel1.innerText=sursa;//asta afiseaza sursa doar sub forma de text pe ecran,
        // chiar daca bag taguri in sursa
       /* panel1.innerHTML='';
        panel1.style.width=0;
        panel1.style.height=0;
        panel1.style.border='none';
        panel1.style.backgroundColor='transparent';
        panel1.style.visibility='hidden';*/
        //}
          
}
}

//-------------
function SetImage(sursa){//utilizata in pozemici.php
panel1=document.getElementById('divPozapp');
panel2=document.getElementById('divPozamare');
if(panel2.style.visibility=='visible'){
		panel2.innerHTML='';
        panel2.style.width=0;
        panel2.style.height=0;
        panel2.style.border='none';
        panel2.style.backgroundColor='transparent';
        panel2.style.visibility='hidden';
}
var img1='<img width=800  src='+sursa+' >';
var img2='<img   width=414 alt="Click pentru a mari imaginea" title="Click pentru a mari imaginea" src='+sursa+'  onclick="ShowPanel(\'divPozamare\',\''+img1+'\')" >';
panel1.innerHTML=img2;
}




