// JavaScript Document

<!--
var Drop = new Array ();
var Drop_r = new Array ();
var Drop_com = new Array ();
var Drop_com_r = new Array ();

Drop[1]='ls1';
Drop[2]='ls2';
Drop[3]='ls3';
Drop[4]='ls4';
Drop[5]='ls5';

Drop_r[1]='ls-live-r1';
Drop_r[2]='ls-live-r2';
Drop_r[3]='ls-live-r3';
Drop_r[4]='ls-live-r4';
Drop_r[5]='ls-live-r5';


Drop_com[1]='ls_com6';
Drop_com[2]='ls_com7';
Drop_com[3]='ls_com8';
Drop_com[4]='ls_com9';
Drop_com[5]='ls_com10';

Drop_com_r[1]='ls_com-r6';
Drop_com_r[2]='ls_com-r7';
Drop_com_r[3]='ls_com-r8';
Drop_com_r[4]='ls_com-r9';
Drop_com_r[5]='ls_com-r10';


function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}
 
function show_popup_photo(UID, obj_ID) {
	var Left, Top;
	winWidth=0;
	winHeight=0;
//  	pos=getElementPosition(obj_ID);

	
	
	obj=findObj('popupwin', '');
	//obj.style.top=-10;	
	//obj.style.left=-10;

	obj.innerHTML="<iframe src='"+"/show_popup_photo.php?UID="+UID+"&obj_ID="+obj_ID+"'  width="+winWidth+"  height="+winHeight+" scrolling=no frameBorder=no id='popupframe'>";
	obj.style.width=winWidth;
	obj.style.height=winHeight;
	obj.style.visibility='visible';

}


function hide_phones() {

	obj=findObj('popupwin', '');
	obj.style.visibility='hidden';
	obj.style.top=1;	
	obj.style.left=1;
	

}

function getElementPosition(elemId)
{
    var elem = document.getElementById(elemId);
	
    var w = elem.offsetWidth;
    var h = elem.offsetHeight;
	
    var l = 0;
    var t = 0;
	
    while (elem)
    {
        l += elem.offsetLeft;
        t += elem.offsetTop;
        elem = elem.offsetParent;
    }

    return {"left":l, "top":t, "width": w, "height":h};
}


function show_phones(num_z,place,type, expertid, obj_ID)
{
	var Left, Top;
	winWidth=500;
	winHeight=330;
	pos=getElementPosition(obj_ID);

	obj=findObj('popupwin', '');
	obj.innerHTML="<iframe src='"+"/show_phones.php?num_z="+num_z+"&place="+place+"&type="+type+"&expertid="+expertid+"' width="+winWidth+" height="+winHeight+" scrolling=no frameBorder=no>";
	obj.style.width=winWidth;
	obj.style.height=winHeight;
	absoluteleft=pos.left-document.body.scrollLeft;
	if (absoluteleft<winWidth) Left=pos.left+pos.width;
	else 	Left=pos.left-winWidth;
	absolutetop=pos.top-document.body.scrollTop;
//	if (absolutetop<winHeight) Top=pos.top+pos.height;
//	else Top=pos.top-winHeight;
	if (absolutetop<winHeight) {
		 Top=pos.top+pos.height;
		 acsessHeight=top.document.body.clientHeight-absolutetop-pos.height;
		 if (acsessHeight<winHeight) Top=pos.top+pos.height-(winHeight-acsessHeight)-5; 
//		 alert(acsessHeight);
	} 	else Top=pos.top-winHeight;


	obj.style.top=Top;	
	obj.style.left=Left;
	obj.style.visibility='visible';
}

function show_form($num_z,$place,$type)
{
	window.open("/show_bcf.php?num_z="+$num_z+"&place="+$place+"&type="+$type, "Multydom", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=406");
}
-->
