//  COPYRIGHT � 2009 APACHE CORP
//
//  TRADE SECRETS: APACHE CORP PROPRIETARY AND CONFIDENTIAL
//  Copyright Laws of the United States and applicable international
//  laws, treaties, and conventions.
// 
//  For additional information, contact:
//  Apache Corporation
//  email: carlos.sosa@apachecorp.com

	// GLOBAL DIRECTORY CONFIG VARIABLES (end slash) //
	var kml_url = "http://www.apachecorp.com/Resources/kml/";

	// VARIABBLES TO HANDLE KML FOR EACH REGION //
	var argXml;
	var egyXml;
	var nsXml;
	var ausXml;
	var centralXml;
	var gcXml;
	var canXml;

	// LAT AND LONG OF EACH REGION TO CENTER MAP //

	var argPt = new GLatLng(-44.611781,-62.617309);
	var egyPt = new GLatLng(29.67850809103362, 27.685546875);
	var nsPt = new GLatLng(57.70414723434193, 0.46142578125);
	var ausPt = new GLatLng(-25.324166525738384, 133.9453125);
	var centralPt = new GLatLng(32.24997445586331, -99.228515625); // Same for Gulf Coast
	var canPt = new GLatLng(55.24997445586331, -109.228515625);

	//FUNCTION TO HANDLE EACH REGION //
	function showArg(){
	   if (argXml == null){
		argXml =  new EGeoXml("argXml", map,  kml_url + "Argentina_Basins.kml",{elabelclass:"label",elabelopacity:100,elabeloffset:new GSize(20,-10)});
		GEvent.addListener(argXml, "parsed", function() {
	   			map.setCenter(argPt, 4);
		});
	        argXml.parse(); 
	   }
	}

	function showEgy(){
	   if (egyXml == null){
		egyXml =  new EGeoXml("egyXml", map,  kml_url + "Egypt_Concessions.kml",{elabelclass:"label",elabelopacity:80,elabeloffset:new GSize(20,-10)});
		GEvent.addListener(egyXml, "parsed", function() {
	   		map.setCenter(egyPt, 6);
		});
	        egyXml.parse(); 
	   }
	}


	function showNS(){
	   if (nsXml == null){
		nsXml =  new EGeoXml("nsXml", map,  kml_url + "North_Sea.kml",{elabelclass:"label",elabelopacity:80,elabeloffset:new GSize(20,-10)});
		GEvent.addListener(nsXml, "parsed", function() {
	   		map.setCenter(nsPt, 6);
		});
	        nsXml.parse(); 
	   }
	}

	function showAus(){
	   if (ausXml == null){
		ausXml =  new EGeoXml("ausXml", map,  kml_url + "Australia_Basins.kml",{elabelclass:"label",elabelopacity:80,elabeloffset:new GSize(20,-10)});
		GEvent.addListener(ausXml, "parsed", function() {
	   		map.setCenter(ausPt, 3);
		});
	        ausXml.parse(); 
	   }
	}

	function showCentral(){
	   if (centralXml == null){
		centralXml =  new EGeoXml("centralXml", map,  kml_url + "Central_Region_Polygon.kml",{elabelclass:"label",elabelopacity:80,elabeloffset:new GSize(20,-10)});
		GEvent.addListener(centralXml, "parsed", function() {
			map.setCenter(centralPt, 4);
		});
	        centralXml.parse(); 
	   }
	}

	function showGC(){
	   if (gcXml == null){
		gcXml =  new EGeoXml("gcXml", map,  kml_url + "Gulf_Coast_Region_Polygon.kml",{elabelclass:"label",elabelopacity:80,elabeloffset:new GSize(20,-10)});
		GEvent.addListener(gcXml, "parsed", function() {
		   map.setCenter(centralPt, 4);
		});
	        gcXml.parse(); 
	   }
	}
	function showCan(){
	   if (canXml == null){
		canXml =  new EGeoXml("canXml", map,  kml_url + "Canada_Areas.kml",{elabelclass:"label",elabelopacity:80,elabeloffset:new GSize(20,-10)});
		GEvent.addListener(canXml, "parsed", function() {
	   		map.setCenter(canPt, 4);
		});
	        canXml.parse(); 
	   }
	}
