
window.name = "hummerOpener";
if(typeof queryString == "undefined"){
	var queryString = location.search.substring(1);
}
/**
 *	function launchHummerSite
 *		Pops open a new window with a localized version of the HUMMER.com site.
 *		Called by countrySelector.swf.
 *	params
 *		country  - [required] countryCode (lowercase)
 *		language - [required] languageCode (lowercase)
 *	returns
 *		nothing
*/
function launchHummerSite(country,language) {
	var loc = "/intl/home.jsp?";
	// pass the countrySelector page's query string along to the home page popup
	if(typeof queryString == "undefined"){
		queryString = location.search.substring(1);
	}
    if (queryString) {
      if(queryString.indexOf("&")>=0){
		  var tempArray = queryString.split("&");
		  var i;
		  var spliceLanguage = -1;
		  var spliceCountry = -1;
		  for(i in tempArray){
			if(tempArray[i].indexOf("language=")>=0){
				spliceLanguage = i;
			} else if(tempArray[i].indexOf("country=")>=0){
				spliceCountry = i;
			}
		  }
		  if(spliceLanguage!=-1){
		  	tempArray.splice(spliceLanguage,1);
		  }
		  if(spliceCountry!=-1){
		  	tempArray.splice(spliceCountry,1);
		  }
		  if(tempArray.length>1){
		  	queryString = tempArray.join("&");
		  } else {
		 	queryString = tempArray.join("");
		  }
	  } else if(queryString.indexOf("language=")>=0){
	  	queryString = "";
	  }
	  loc += queryString;
	}
	if(country){
		loc += (queryString) ? "&" : "";
		loc += "country=" + country;
	}
	if(language){
		loc += (queryString || country) ? "&" : "";
		loc += "language=" + language;
	}
    var h=window.open(loc,'hummer','width=780,height=560,scrollbars=no,resizable=no,screenX=0,screenY=0,left=0,top=0');
	if(h){
		h.focus();
	}
}
/**
 *	function launchExternalSite
 *		Pops open a new window with a localized version of the HUMMER.com site.
 *		Called by countrySelector.swf.
 *	params
 *		url  - [required] url of site to open
 *		target - [optional] name of target window.  If it's "hummer," open in a HUMMER.com-sized pop-up.
 *	returns
 *		nothing
*/
function launchExternalSite(url,target){
    // make external sites use a different popup window from the one we use for our site
	var h;
    if((target=="hummer")){
		// pass the countrySelector page's query string along to the home page popup
		if(typeof queryString == "undefined"){
			queryString = location.search.substring(1);
		}
		h = window.open(url+queryString,'hummer','width=780,height=560,scrollbars=no,resizable=no,screenX=0,screenY=0,left=0,top=0')
	} else {
		h = window.open(url,'hummer_international');
	}
	if(h){
		h.focus();
	}
}

function launchMacromediaSite() {
    window.open('http:\/\/www.macromedia.com\/go\/getflashplayer','flash');
}