var curDiv="";
var sTimer="";
var cTimer="";
var h=0;
var sINT="";
function changeBG(bgObj,chex){

}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function expandPix(imgObj,divID){
	//alert(divID);
cancelStimer();
	imgObj.height=10;
	imgObj.width=105;
	curDiv=divID;
	document.getElementById("popcontent").innerHTML=document.getElementById(divID).innerHTML;
	var post=findPos(imgObj);
	var ospace=getSpace();
	var sleft=post[0]
	//alert(sleft);
	if(post[0]+375>ospace[0]){
		
		//sleft=ospace[0]-375;
		
document.getElementById("pointerDiv").innerHTML=
"<div style='padding-left:-150px;'><img src='http://www.har.com/servicedirectory/images/pointer.png' /></div>";
	}else{
		document.getElementById("pointerDiv").innerHTML="<div ><img src='http://www.har.com/servicedirectory/images/pointer.png' /></div>";
	}

	
	document.getElementById("popcontent2").style.left=sleft+10+"px";
	document.getElementById("popcontent2").style.top=post[1]+10+"px";
	
	setTimeout(showDiv,60);
	
//	SNAP_COM.shot_main_js();
}
function cancelStimer(){

	clearTimeout(cTimer);
}

function collapsePix(imbObj){
	
	imbObj.height=105;
	imbObj.width=100;

cTimer=setTimeout(hideDiv,600);

}


function getSpace(){	
	var d=document;
	if(d.getElementById){
	 if(d.documentElement&&d.documentElement.clientHeight){
	  xMax=d.documentElement.clientWidth;
	  yMax=d.documentElement.clientHeight;
	 }else{
	  xMax=(d.all)?d.body.clientWidth:window.innerWidth;
	  yMax=(d.all)?d.body.clientHeight:window.innerHeight;
	 }
	}else if(d.layers){
	 xMax=window.innerWidth;
	 yMax=window.innerHeight;
	}
	return[xMax,yMax];
}

function showDiv(){
	var dobj=document.getElementById("popcontent");
	document.getElementById("popcontent").style.width=330+"px";
	document.getElementById("popcontent").style.height=210+"px";
	h=0;
	document.getElementById("popcontent2").style.display='';


}
	

function slowExpand(){
	var g=document.getElementById("popcontent");

		g.style.width=200+h+"px";
		g.style.height=100+h+"px";

		h=h+25;
		if(h>150){
			clearInterval(sINT);
		
		}
		
}


function hideDiv(){
	

	document.getElementById("popcontent2").style.display='none';

}

function hideDiv2(){

	setTimeout( hideDiv,3000);
}
