var url_after_hide_param="";

function Param_Window_Out()
{
	
	
	axis_param="";
	
	Get_Obj('container-div-param').style.display='none';

	Get_Obj('fond-param').style.display='none';
	
		
	
	if(url_after_hide_param!="")
	{
		window.location.replace(url_after_hide_param);
		url_after_hide_param="";
	}
	
	
}

function Clear_Fond_Param()
{
	
	
	if(Get_Obj('container-div-param'))
	{
		Get_Obj('container-div-param').outerHTML="";
	}
	

}

function Close_Ajax_Photo()
{
	Get_Obj('div-absolute').innerHTML='';
}



function Fond_Param_Only()
{
	
	Get_Obj('fond-param').style.height=''+Get_Total_Height()+'px';
	Get_Obj('fond-param').style.display="block"; 

}


function Get_Total_Height()
{

  // firefox is ok
  var height = document.documentElement.scrollHeight;

  // now IE 7 + Opera with "min window"
  if(document.documentElement.clientHeight > height ) {
    height  = document.documentElement.clientHeight;
  }
  // last for safari
  if(document.body.scrollHeight > height) {
    height = document.body.scrollHeight;
  }
  return height;
}

var mode_showtrail;

function Showtrail(width,height,file,mode)
{
	mode_showtrail=mode;
		
	if(mode!="ajax")
	{
		flag_wait_ajax=0;
	}
	
	if(mode==undefined || mode=='img' || mode=='ajax' || mode=='kdo')
	{
		
		
		
		
		if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
		{
			w=width
			h=height
			
			Get_Obj('ttimg').src=file;
			
			if(mode=="ajax")
			{
				Get_Obj('ttimg').style.top="-30px";
				Get_Obj('ttimg').style.left="-10px";

			}
			
			if(mode=='kdo')
			{
				Get_Obj('ttimg').style.border='solid';
				Get_Obj('ttimg').style.borderWidth='1px';
			}
			else
			{
				Get_Obj('ttimg').style.border='none';
			}
			
			document.onmousemove=followmouse;
			//document.onmouseover=Hidetrail;
			document.onclick=Hidetrail;
			
			gettrailobj().visibility="visible"
			
			gettrailobj().width=w+"px"
			gettrailobj().height=h+"px"
	
	
		}
		
		
	}
	
	if(mode=='div')
	{
		
		
		
		
		
		
		
		if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
		{
			w=width
			h=height
		
		
			Get_Obj('trail_content').innerHTML=file
			document.onmousemove=followmouse
			document.onclick=Hidetrail;
			
			gettrailobj().visibility="visible"
			
			
			
			if(w!='')
			{
				gettrailobj().width=w+"px"
				gettrailobj().height=h+"px"
			}
	
		}
	}
}


function followmouse(e)
{

	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
	{

		var xcoord=10
		var ycoord=14

		if (typeof e != "undefined")
		{
			xcoord+=e.pageX
			ycoord+=e.pageY
		}
		else if (typeof window.event !="undefined")
		{
			xcoord+=truebody().scrollLeft+event.clientX
			ycoord+=truebody().scrollTop+event.clientY
		}

		var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
		var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
			
		if (xcoord+w+3>docwidth)
		xcoord=xcoord

		if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
		ycoord=ycoord;

		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"
		
		if(mode_showtrail=='div')
		{
			Get_Obj('trail_content').style.display="block";
			Get_Obj('ttimg').style.display="none";
		}
		else
		{
			Get_Obj('trail_content').style.display="none";
			Get_Obj('ttimg').style.display="block";
		}

	}

}


var w=1
var h=1



function gettrailobj()
{
	if (Get_Obj) return Get_Obj("trailimageid").style
	else if (document.all) return document.all.trailimagid.style
}

function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function Hidetrail(mode)
{
	document.onmousemove="";
	document.onmouseover="";
	document.onclick="";
	
	Get_Obj('trail_content').style.display="none";
	Get_Obj('ttimg').style.display="none";
		
	if(mode==undefined)
	{
		Get_Obj('ttimg').src='/imgages/spacer.gif'
	}
	gettrailobj().visibility="hidden"
	gettrailobj().left=-1000
	gettrailobj().top=0
	
	flag_wait_ajax=1;
	
}

