// JavaScript Document

function changeLan(currentLan, targetLan) {
	
	
	var newDomain;
	// Domain Switch
	if (targetLan == "fr") {
		newDomain = "http://www.analystik.ca/";
	} else if (targetLan == "en") {
		newDomain = "http://www.analystik.com/";
	}
	currentLoc 	= new String(window.location);
	
	// Development exception
	devCheck = currentLoc.indexOf("dev.analystik");
	if(devCheck > 0) {
		newDomain = "http://dev.analystik.quattrocento.ca/";
	}
	// Development exception

	
	// remove QueryString
	currentLoc	= currentLoc.split("?");
	currentLoc	= currentLoc[0];
	LocArray 	= currentLoc.split("/" + currentLan + "/");
	newLoc		= newDomain + targetLan + "/" + LocArray[1];
	
	
	// Home Page
	indexCheck = currentLoc.indexOf("index_");
	if(indexCheck > 0) {
		newLoc		= newDomain + "index_" + targetLan + ".asp";
	}
	// Development exception
	
	//alert(newLoc)
	document.location = newLoc;
}