function getObj(id){
   return document.getElementById(id);
}

function setLayerVis(id,styl){
   obj = getObj(id);
   if(obj)
	obj.style.display = styl;
}


function getX(o) {
	var x = 0;

	while (o && o.offsetParent) {
		x += o.offsetLeft
		o = o.offsetParent
	}
	return x;
}






var currentMapDiv = false;
var currentHideDiv = false;
var currentMapDivTimer = false;

function resizeMapDiv(){
   divName = 'mapDiv'+currentMapDiv;
   tableName = 'mapTable'+currentMapDiv;

   divObj = getObj(divName);

   if(!divObj)
	   return;

   ancorObj = document.images['mapDivAncor'];
   ancorObj2 = getObj(tableName);


   x = getX(ancorObj) + ancorObj.offsetWidth - ancorObj2.offsetWidth - 20;

   divObj.style.left = x+'px';
   
}


var currentTimer = false;

function touchConsul(){
	if(currentTimer){
		clearTimeout(currentTimer);
	}
}

function showConsul(){
	touchConsul();
	currentTimer = window.setTimeout("consultant.style.display = 'block'", 700);
}

function hideConsul(){
	touchConsul();
	currentTimer = window.setTimeout("consultant.style.display = 'none'", 1500);
}


//http://www.fontstuff.com/frontpage/fptut17.htm
//$array_size = getimagesize("locationofimage");
//$array_size[0] = width, $array_size[1] = height


function popImg(picURL,picWidth,picHeight,picTitle){
	newWindow=window.open(picURL,'newWin','top=50, left=200', 'toolbar=no,width='+picWidth+',height='+picHeight)
	newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'" onclick="javascript:window.close()"><\/body><\/html>')
	newWindow.resizeBy(picWidth-newWindow.document.body.clientWidth,picHeight-newWindow.document.body.clientHeight)
//	newWindow.focus()
}




/*
function popImg(url) {

    var win = window.open(url, '', 'top=50,left=50,width=0,height=0,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
    if (win) {
        win.document.writeln(
        '<html><head><title>Kekava</title></head>' +
        '<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor=white onLoad="self.focus()">' +
        '<img src="'+url+'" onclick="javascript:window.close()" onLoad="window.resizeTo(this.clientWidth+10, this.clientHeight+35)">' + 
		'</body></html>'
        );
    }
    return true;
}
*/
//  onLoad="window.resizeTo(this.clientWidth, this.clientHeight)"
//normal     "javascript: window.moveTo(85,0); window.resizeTo(screen.availWidth-100,screen.availHeight-20)"

//fullscreen "javascript: window.moveTo(0,0); window.resizeTo(screen.availWidth,screen.availHeight)"
