function thumb_zoom(src)
{
	if(src=="")
	{
	document.getElementById('thumb_zoom').style.display = "none";
	}
	else
	{
	document.getElementById('thumb_zoom').style.display = "block";
	document.getElementById('thumb_zoom_img').src = src;
	}
	
}
var ip_location_gmap2_init = false;
var ip_location_gmap2_w    = 640;
var ip_location_gmap2_h    = 400;
var ip_location_gmap2_box_pad = 20;

function ip_location_gmap2_close()
{
	document.getElementById('ip_location_gmap2_box').style.display = "none";
}
function ip_location_gmap2_show()
{
	deadcenterdiv(ip_location_gmap2_w,ip_location_gmap2_h,'ip_location_gmap2_box');
	document.getElementById('ip_location_gmap2_box').style.display = "block";
}
function ip_location_gmap2(label, coord)
{
	if(ip_location_gmap2_init)
	{
		ip_location_gmap2_show();
	}
	else{
	
	ip_location_gmap2_init = true;
	
	var w_ = ip_location_gmap2_w;
	var h_ = ip_location_gmap2_h;
	var gmap2_box = document.getElementById('ip_location_gmap2_box');
	var divimg = document.createElement('div');
	var divnav = document.createElement('div');
	var newimg = document.createElement('img');
		
	newimg.src = 'http://maps.google.com/maps/api/staticmap?center='+label+'&zoom=13&size='+w_+'x'+h_+'&maptype=roadmap&markers=color:blue|label:|'+coord+'&sensor=false';
	
	newimg.onclick = ip_location_gmap2_close;
	newimg.onmouseover = "style.cursor='hand'";
	
	label = unescape(label);
	label = label.replace(/\+/gi, " ");
	label = label.replace(/,/gi, ", ");
	
	divnav.innerHTML = "<center><table cellspacing=0 cellpadding=0 width=96% border=0><tr><td align=left>"+label+"</td><td align=right><a href='javascript://' onclick='ip_location_gmap2_close()'>close</a></td></tr></table></center>";
	divnav.style.paddingTop    = '8px';
	divnav.style.paddingBottom = '8px';
	
	divimg.appendChild(newimg);
	divimg.style.width  = w_+'px';
	divimg.style.height = h_+'px';
		
	gmap2_box.appendChild(divnav);
	gmap2_box.appendChild(divimg);
	//gmap2_box.style.width  = w_+ip_location_gmap2_box_pad+'px';
	//gmap2_box.style.height = h_+ip_location_gmap2_box_pad+'px';
			
	ip_location_gmap2_show();
	
	}
	
}
function deadcenterdiv(Xwidth,Yheight,divid) {
	// First, determine how much the visitor has scrolled

	var scrolledX, scrolledY;
	if( self.pageYOffset ) {
	scrolledX = self.pageXOffset;
	scrolledY = self.pageYOffset;
	} else if( document.documentElement && document.documentElement.scrollTop ) {
	scrolledX = document.documentElement.scrollLeft;
	scrolledY = document.documentElement.scrollTop;
	} else if( document.body ) {
	scrolledX = document.body.scrollLeft;
	scrolledY = document.body.scrollTop;
	}

	// Next, determine the coordinates of the center of browser's window

	var centerX, centerY;
	if( self.innerHeight ) {
	centerX = self.innerWidth;
	centerY = self.innerHeight;
	} else if( document.documentElement && document.documentElement.clientHeight ) {
	centerX = document.documentElement.clientWidth;
	centerY = document.documentElement.clientHeight;
	} else if( document.body ) {
	centerX = document.body.clientWidth;
	centerY = document.body.clientHeight;
	}

	// Xwidth is the width of the div, Yheight is the height of the
	// div passed as arguments to the function:
	var leftOffset = scrolledX + (centerX - Xwidth) / 2;
	var topOffset = scrolledY + (centerY - Yheight) / 2;
	// The initial width and height of the div can be set in the
	// style sheet with display:none; divid is passed as an argument to // the function
	var o=document.getElementById(divid);
	var r=o.style;
	r.position='absolute';
	r.top = topOffset + 'px';
	r.left = leftOffset + 'px';	
	} 
