//
// getPageScroll()
// Returns array with x,y page scroll values.
//
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 
		// Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {
		// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}



//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

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

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
  
  function getLeftVals() {
	  //alert("here");
	  //alert("homebox left="+getObjectLeft("homeBox"));
	  //alert("homebox top="+getObjectTop("homeBox"));
	  //alert("newsbox left="+getObjectLeft("newsBox"));
	  //alert("newsbox top="+getObjectTop("newsBox"));
	  //alert("musicBox left="+getObjectLeft("musicBox"));
	  //alert("musicBox top="+getObjectTop("musicBox"));
	  //alert("picsbox left="+getObjectLeft("picsBox"));
	  //alert("picsbox top="+getObjectTop("picsBox"));
	  //alert("blogBox left="+getObjectLeft("blogBox"));
	  //alert("blogBox top="+getObjectTop("blogBox"));
	  //alert("contactBox left="+getObjectLeft("contactBox"));
	  //alert("contactBox top="+getObjectTop("contactBox"));
	  //var leftVal2 = getObjectLeft("newsBox");
	  //alert(leftVal1);
	  //alert(leftVal2);
	  
	  xL = findPosX("rightArea1");
	  xT = findPosY("rightArea1");

	var placeHolder = document.getElementById('iecenterdiv2');
	var curLeft = findPosX(placeHolder);
	var curTop = findPosY(placeHolder);
	var rightContentBox = document.getElementById('rightArea1');
	var curLeft1 = findPosX(rightContentBox);
	var curTop1 = findPosY(rightContentBox);
	var homBox = document.getElementById('homeBox');
	var curLeft2 = findPosX(homBox);
	var curTop2 = findPosY(homBox);
	/*
	alert("rightArea1 left "+curLeft1);
	alert("rightArea1 top "+curTop1);
	alert("iecenterdiv2 left "+curLeft);
	alert("iecenterdiv2 top "+curTop);
	alert("home box left "+curLeft2);
	alert("home box top "+curTop2);
	*/

  }
