function add_file_name(file_src){
      document.page_form.video_src.value=file_src;
}

function hide_div(div_id){
document.getElementById(div_id).style.display='none';
}

function setLyr(obj,lyr){
	var newX = findPosX(obj)+150;
	var newY = findPosY(obj)-35;
	if (lyr == 'testP') newY -= 50;
	var x = new getObj(lyr);
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
    document.getElementById(lyr).style.display='block';
}

function findPosX(obj){
	var curleft=0;
	if (obj.offsetParent)
	{
		while(obj.offsetParent)
		{
			curleft=curleft+obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	var printstring = '';
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	window.status = printstring;
	return curtop;
}


function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}


function view_pic(caption,imgpath,width,height){
  
  var new_width=30+Number(width);
  var new_height=25+Number(height);
  
  fereastra=window.open("", "newwin", "width="+new_width+",height="+new_height+",toolbar=no,menubar=no, scrollbars=yes");
  fereastra.document.write("<title>"+caption+"<\/title>");
  fereastra.document.write('<body style="background-color:#EFEDE4;overflow:auto;margin:10px;padding:0px">');
  fereastra.document.write('<img src="'+imgpath+'" width="'+width+'" height="'+height+'" alt="photo"><br \/>');
  fereastra.document.write("<\/body>");
  fereastra.document.write("<\/html>");
}





