// JK_langChange.js
// Copyright 2003 Internad Ltd. All rights reserved.
// Switching different language
// JK_langChange ('en')
// 21 August, 2003

function JK_langChange(lang) {
	re1 = /\/(en|entxt|b5|b5txt|gb|gbtxt)\//;
	var str = document.location.href;
	var found = str.match(re1);

	if(found[1] && found[1] != lang) { // found, and not the same language

		//~ var f = top.window.frames;
		//~ if(f.length) { // frameset
			//~ alert("frameset")
			//~ for (var i=0; i<f.length; i++) {
				//~ var temp_loc = top.frames[i].document.location.toString();
				//~ var new_loc = temp_loc.replace(found[1], lang);
				//~ top.frames[i].document.location = new_loc;
			//~ }
		//~ }
		//~ else { // no frameset
			var temp_loc = top.document.location.toString();
			var new_loc = temp_loc.replace(found[1], lang);
			top.document.location = new_loc;
		//~ }
	}
}
