var xmlHttp

function getIcon(url)
{
//alert("getIcon");
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	} 
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

function stateChanged() {
	if (xmlHttp.readyState==4) {
		//alert(xmlHttp.responseText);
		//alert("stateChanged");
		var xmlDoc=xmlHttp.responseXML.documentElement;
		objLink = new Object;
		try { objLink.img=xmlDoc.getElementsByTagName("img")[0].childNodes[0].nodeValue; } catch(e) { objLink.img = ''; }
		try { objLink.embed=xmlDoc.getElementsByTagName("embed")[0].childNodes[0].nodeValue; } catch(e) { objLink.embed=''; }
		try { objLink.desc=xmlDoc.getElementsByTagName("desc")[0].childNodes[0].nodeValue; } catch(e) { objLink.desc=''; }
		try { objLink.loc=xmlDoc.getElementsByTagName("loc")[0].childNodes[0].nodeValue; } catch(e) { objLink.loc=''; }
		showLightbox(objLink);
	}
}

function GetXmlHttpObject() {
	var xmlHttp=null;
	try {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
	  // Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}


function goNA() {
	map.setCenter(new GLatLng(53.01478, -106.34765),3); 	
}
function goSA() {
	map.setCenter(new GLatLng(-32.39851, -53.61328),3); 	
}
function goEuro() {
	map.setCenter(new GLatLng(50.23315, 10.54687),4); 	
}
function goAsia() {
	map.setCenter(new GLatLng(22.59372, 118.125),4); 	
}
function goAustralia() {
	map.setCenter(new GLatLng(-26.27371, 134.56054), 4); 	
}
function goAntarctica() {
	map.setCenter(new GLatLng(-80.70399, 58.00781), 2); 	
}

function showNMonthes(i) {
	all = 0;
	switch(i) {
		case 2:n=6; break;
		case 3:n=3; break;
		case 4:n=2; break;
		case 5:n=1; break;
		default:n=0;all=1;
	}
	map.clearOverlays();
	d = new Date();
	d.setMonth(d.getMonth()-n);
	base = parseInt(d.getFullYear().toString() + (d.getMonth()<9 ? '0'+(d.getMonth()+1) : d.getMonth()+1) + '00');
	for(i=0; i<pointers.length; i++) {
		if(all || pointers[i].date >= base) {
			map.addOverlay(pointers[i].mark);
		}
	}
}

function openSubmit() {
	window.open("http://www.otterbox.com/planet_otterbox/submit_photo.php", "submit", "height=550,width=450,toolbar=no,top=10,left=10,directories=no,fullscreen=no,location=no,scrollbars=yes");
}
