var link = '';

  isDOM=document.getElementById?true:false
  isOpera=isOpera5=window.opera && isDOM
  isOpera6=isOpera && window.print
  isOpera7=isOpera && document.readyState
  isMSIE=isIE=document.all && document.all.item && !isOpera
  isStrict=document.compatMode=='CSS1Compat'
  isNN=isNC=navigator.appName=="Netscape"
  isNN4=isNC4=isNN && !isDOM
  isMozilla=isNN6=isNN && isDOM


function KL_getBody(w){
  if(!w) w=window;
  if(isStrict){
    return w.document.documentElement;
  }else{
    return w.document.body;
  }
}

function getDocumentWidth(w){
  if(!w) w=window;
  if(isMSIE || isOpera7) return KL_getBody(w).clientWidth;
  if(isNN) return w.document.width;
  if(isOpera) return w.document.body.style.pixelWidth;
}

function getDocumentHeight(w){
  if(!w) w=window;
  if(isMSIE || isOpera7) return KL_getBody(w).clientHeight;
  if(isNN) return w.document.height;
  if(isOpera) return w.document.body.style.pixelHeight;
}

function getScrollX(w){
  if(!w) w=window
  if(isMSIE || isOpera7) return KL_getBody(w).scrollLeft
  if(isNN || isOpera) return w.pageXOffset
}

function getScrollY(w){
  if(!w) w=window
  if(isMSIE || isOpera7) return KL_getBody(w).scrollTop
  if(isNN || isOpera) return w.pageYOffset
}

var pheight = 500,
	pwidth  = 350;
	
function friends(plink){
	//alert(link);
	 //popup = window.open ("/friends/", "mywindow","status=0,toolbar=0,scrollbars=0,width="+pwidth+",height="+pheight);
	 //popup.moveTo((screen.width-pwidth)/2,(screen.height-pheight)/2);
	 //popup.focus();

	 wwidth  = getDocumentWidth(false),
	 wheight = getDocumentHeight(false);

	 getE('sframe').src='./contacts.php?mod=friends';
	// getE('sframe').
	 getE('friends').style.height=pheight;
	 getE('friends').style.width=pwidth;
	 getE('friends').style.top=getScrollY(false)+(wheight-pheight)/3;
	 getE('friends').style.left=getScrollX(false)+(wwidth-pwidth)/2.3;
	 getE('friends').style.display='';
	 
	 link=plink;
	 
	 //	 mywindow.forms[1].'messagetosend').innerHTML=link;
}

function getE(name){
	return document.getElementById(name);
}
    
function checkform(){
   	if(false) return false;
   	document.forms[1].submit
}