function findLivePageHeight() {
         return screen.height
}

function findLivePageWidth() {
         return screen.width
}

function findScrollLeft() {
	if (window.pageXOffset != null)
		return window.pageXOffset; 
	if (document.body.scrollHeight != null)
		return document.body.scrollLeft;
	return (null);
}

function findScrollTop() {
	if (window.pageYOffset != null)
		return window.pageYOffset;
	if (document.body.scrollWidth != null)
		return document.body.scrollTop;
	return (null);
}

var sArea
var origWidth
var origHeight
var chatBoxSize
var origLeft
var origTop

	enlarge=new Image(16,16)
reduce=new Image(16,16)
reduce.src="http://easygome.com/icons/closeview1.gif"
enlarge.src="http://easygome.com/icons/enlargeview1.gif"

function setTheValues5(){
	chatBoxSize=1
	sArea=document.getElementById("shoutArea")
	origWidth=parseInt(sArea.offsetWidth)
	origHeight=parseInt(sArea.offsetHeight)
	origLeft=sArea.offsetLeft
	origTop=sArea.offsetTop
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


	function toggleShoutBox5() {
	
	if (chatBoxSize==1) {
	sArea.style.width=origWidth + "px"
	sArea.style.height=origHeight + "px"
	sArea.style.position="absolute"
	sArea.style.zIndex=1000
	chatBoxSize=2
	// findDOM("enlargeNow",0).src=reduce.src
	growUp(35,100)

	} else {
	
	chatBoxSize=1
	growDown(35,100)
	// findDOM("enlargeNow",0).src=enlarge.src
	}
	return true;

	}
	
	function swapTheTrick() {
	var imgTrick
	imgTrick=findDOM("enlargeNow",0)
	if (chatBoxSize==2) {
	imgTrick.src=reduce.src
	
	}else {
	
	imgTrick.src=enlarge.src
	}
	
	}
	
function growDown(hh,ww) {
		var hAdd
		var wAdd
		hAdd=0
		wAdd=0
	
		// alert("width: " + origWidth + "  height" + origHeight)
		if (sArea.offsetWidth<=origWidth) {
		
			sArea.style.width=origWidth + 'px'
			wAdd=0
		} else {
			var zMin=parseInt(sArea.offsetWidth-ww)
			if (zMin<1) {
				zMin=1
				ww=0
			}
			sArea.style.width=zMin + 'px'
			wAdd=ww
			if (wAdd<0) {
				wAdd=0
			}
		}
		
		if (parseInt(sArea.offsetHeight)<=parseInt(origHeight)) {
			sArea.style.height=parseInt(origHeight) + "px"
			hAdd=0
		} else {
			//var tMin=sArea.offsetHeight-hh
			// if (tMin<1) {
				// tMin=5
				// hh=0
			// }
			sArea.style.height=parseInt(sArea.offsetHeight-35) + "px"
			hAdd=hh
			if (hAdd<0) {
				hAdd=0
			}
		}

		if (hAdd==0 && wAdd==0) {
			// alert(sArea.style.pixelHeight)
			sArea.style.position="relative"
			sArea.style.left="5px"
			sArea.style.top="5px"
			return
		} else {
			
			setTimeout("growDown(" + hAdd + "," + wAdd + ")",10)
		}
	}
	

	
		function growUp(hh,ww) {
		var hAdd
		var wAdd
		hAdd=0
		wAdd=0
	sArea.style.left=parseInt(findLivePageWidth()*.05) + "px"
	sArea.style.top=parseInt(findScrollTop() + (findLivePageHeight()*.1)) + 'px'
		if (sArea.offsetWidth>=parseInt(findLivePageWidth()*.90)) {
			sArea.style.width=parseInt(findLivePageWidth()*.90) + "px"
			wAdd=0
		} else {
			sArea.style.width=parseInt(sArea.offsetWidth + ww) + "px"
			wAdd=ww
		}
		
		if (sArea.offsetHeight>=parseInt(findLivePageHeight()*.85)) {
			sArea.style.height=parseInt(findLivePageHeight()*.85) + "px"
			hAdd=0
		} else {
			sArea.style.height=parseInt(sArea.offsetHeight + hh) + "px"
			hAdd=hh
		}

		if (hAdd==0 && wAdd==0) {
			return
		} else {
			
			setTimeout("growUp(" + hAdd + "," + wAdd + ")",10)
		}
	}
	
	function ieAdd() {
sArea.style.height=parseInt(origHeight) + "px"
	
	}
	


