
  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) {
		if (w.innerWidth) {
  			return w.innerWidth;
	  	}  else {
		  return w.document.width;
		}
	}
  if(isNN) return
  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) {
		if (w.innerHeight) {
  			return w.innerHeight;
	  	}  else {
		  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 = 380;
var pwidth  = 380;

function sendlink(plink, src){
	wwidth  = getDocumentWidth(false),
	wheight = getDocumentHeight(false);

	//frame = document.getElementById('sframe');
	//frame.src = src;
		
//	div = document.getElementById('sendlink');
	
	if(window.innerWidth){
		theight = window.innerHeight;
	}   else if(document.documentElement && document.documentElement.clientWidth){
		theight = document.documentElement.clientHeight;
	}   else if(document.body && document.body.clientWidth){
		theight = document.body.clientHeight;
	}
	
	//div.style.height	= pheight + 'px';
	//div.style.width		= pwidth + 'px';
	/*div.style.*/top		= (getScrollY(false)+(theight-pheight-770)/2) + 'px';
	/*div.style.*/left		= (getScrollX(false)+(wwidth-pwidth+120)/2) + 'px';
//	div.style.display 	= '';
	popupWin = window.open("/emotions/send_link/"+plink+"/", "contacts", "location,width="+pwidth+",height="+pheight+",top="+top+",left="+left+",menubar=0,scrollbars=auto,toolbar=0,status=0,location=0");
	popupWin.focus();
	
//	link = plink;
}

function setLink(plink) {
	document.getElementById('link2c') = plink;
}
function getE(name){
	return document.getElementById(name);
}

function checkform(){
   	if(false) return false;
   	document.forms[1].submit
}
