//version 2.0.2.1
var isDebugEnabledWMP=false;

var initcount = 0;
var initvolume = 50;
var lengthslider=-1;

wmpCommands = new Array();     

/**
    @See AbstractMediaPlayer constructor
*/
function WindowsMediaPlayer(objectIdParam, urlParam, parametersArray, typeOfPlayer) {
	if (typeOfPlayer == "pluginFireFox") {
		wmpCommands = wmpCommandsFirefox;
	}
	else {
		wmpCommands = wmpCommandsClassic;
	}

    WindowsMediaPlayer.baseConstructor.call(this, objectIdParam, urlParam, parametersArray);
}
/**
    WindowsMediaPlayer extends AbstractMediaPlayer
*/
UtilCommon.extend(WindowsMediaPlayer, AbstractMediaPlayer);

/**
 * Accessors
 */
WindowsMediaPlayer.prototype.getCurrentPosition = function () {
    return eval(wmpCommands["ie-currentPosition"]);
};
WindowsMediaPlayer.prototype.setCurrentPosition = function (newPos) {
    eval(wmpCommands["ie-currentPosition"] + " = " + newPos);
};
WindowsMediaPlayer.prototype.getCurrentDateTime = function () {
    return new Date(this.datetimeOfVideo.getTime() + getCurrentPosition() * 1000);
};
WindowsMediaPlayer.prototype.getAudioLanguageCount = function () {

	if (this.getStatus()==9 || this.getStatus()==6 || this.getStatus()==3 || this.getStatus()==undefined){
    	return eval(wmpCommands["ie-audioLanguageCount"]);
    }
    return 1;
};
WindowsMediaPlayer.prototype.getCurrentAudioLanguage = function () {
	 if (this.getAudioLanguageCount() !=1  ){
	    return eval(wmpCommands["ie-currentAudioLanguage"]);
	 }
	 return "";
};
WindowsMediaPlayer.prototype.setCurrentAudioLanguage = function (newLng) {
    eval(wmpCommands["ie-currentAudioLanguage"] + " = " + newLng);
};
WindowsMediaPlayer.prototype.getUrl = function () {
    return eval(wmpCommands["ie-url"]);
};
WindowsMediaPlayer.prototype.setUrl = function (newUrl) {
    return eval(wmpCommands["ie-url"] + " = '" + newUrl + "'");
};
WindowsMediaPlayer.prototype.getAudioLanguageID = function (index) {
    return eval(wmpCommands["ie-getAudioLanguageID"] + "(" + index + ")");
};
WindowsMediaPlayer.prototype.getControls = function () {
    return eval(wmpCommands["ie-controls"]);
};
WindowsMediaPlayer.prototype.getCurrentMedia = function () {
    return eval(wmpCommands["ie-currentMedia"]);
};
WindowsMediaPlayer.prototype.play = function () {
	eval(wmpCommands["ie-play"]);
};
WindowsMediaPlayer.prototype.pause = function (bouttonImageDivId, startPosition) {
	eval(wmpCommands["ie-pause"]);
};
WindowsMediaPlayer.prototype.getVolume = function() {
    if (this.getStatus() != 9){
    	return initvolume ;
    }
	return eval(wmpCommands["ie-volume"]);
};
WindowsMediaPlayer.prototype.setVolume = function(vol) {

	if (eval(wmpCommands["ie-settings"]) == null){
		return;
	}
	eval(wmpCommands["ie-volume"] + " = " + vol);
};
WindowsMediaPlayer.prototype.getDuration = function() {
	return eval(wmpCommands["ie-duration"]);
};
WindowsMediaPlayer.prototype.getActiveUrl = function () {
	return this.getUrl();
};

/**
    Return the video playState (0 = stop, 1 = play, 2 = pause)
*/
WindowsMediaPlayer.prototype.getStatus = function () {
    return eval(wmpCommands["ie-playState"]);
};
/**
    Return true if the video is loading ...
*/
WindowsMediaPlayer.prototype.isLoading = function () {
    if (this.getStatus() == 6) {
        return true;
    }
    else {
        return false;
    }
};


WindowsMediaPlayer.prototype.isBuffering = function () {
    if (this.getStatus() == 9 || this.getStatus() == 6) {
        return true;
    }
    else {
        return false;
    }
};

/**
    method changes the current audio language
*/
WindowsMediaPlayer.prototype.changeLanguage = function (newLngCode, oldLngCode) {
    var newLanguageLCID = this.giveLanguageLCID(newLngCode);
    
    // sometimes the test "this.getAudioLanguageCount()" doesn't work because video is not initialized yet.
    // So we set the "CurrentAudioLanguage" every time, even if this is a belgacom video with only one audio
    // In case of Belgacom video (or any 1 audio canal video), an error can ccure, so we catch this error and do nothing
	try {
    	this.setCurrentAudioLanguage(newLanguageLCID);
    } catch(ex) {   }
    
    // if no language are present, this is because it's not initialized yet, we do nothing more
    if (this.getAudioLanguageCount() == 0) 
	    return;
	    
    if (this.getAudioLanguageCount() > 1) {	
    //alert("this.getAudioLanguageCount():" + this.getAudioLanguageCount());
        if (this.hasLanguage(newLanguageLCID)) {
            this.setCurrentAudioLanguage(newLanguageLCID);
            currentMediaObjectLanguage = currentDiffusionLanguage;
        }
    } else {
        //alert("this.getAudioLanguageCount()2:" + this.getAudioLanguageCount());
          //var newUrl = this.getUrl().replace("_" + oldLngCode.toUpperCase() , "_" + newLngCode.toUpperCase() );
          var newUrl = this.getUrl().replace("_" + oldLngCode.toLowerCase() , "_" + newLngCode.toLowerCase() );
        if(newUrl == this.getUrl()){//this allow to force change language if old and newlanguage are the same and url different exx: en -> en and fr in the url
        	//newUrl = this.getUrl().replace(/_\D\D/  , "_" + newLngCode.toUpperCase() );
        	newUrl = this.getUrl().replace(/_\D\D/  , "_" + newLngCode.toLowerCase() );
        }
        var temp = this.getCurrentPosition();
        this.setUrl(newUrl);
        this.setCurrentPosition(temp); 
        currentMediaObjectLanguage = currentDiffusionLanguage;
    }
};
/**
    Method returns true if the given language is present in the current video
*/
WindowsMediaPlayer.prototype.hasLanguage = function (languageLCID) {
    for (var i = 1; i <= this.getAudioLanguageCount(); i++) {
        if (this.getAudioLanguageID(i) == languageLCID) {
            return true;
        }
    }
    return false;
};


WindowsMediaPlayer.prototype.isMultiLanguage = function () {
     if (this.getControls() && this.getAudioLanguageCount() > 1) {
    	return true;
     }
    return false;
};

/**
    Return the language (en,fr,es,...)
*/
WindowsMediaPlayer.prototype.getLanguageName = function () {
   return this.giveLanguageIDLC(this.getCurrentAudioLanguage());
};




/**
    Methods pause or play the video, in function of its current status
*/
WindowsMediaPlayer.prototype.playOrPause = function (bouttonImageDivId, startPosition) {
    if (this.getStatus() != 3) {
        document.getElementById(bouttonImageDivId).innerHTML = "<img onclick ='javascript:" + this.variableNameOfThis + ".playOrPause(\"" + bouttonImageDivId + "\")' border='0' src='/wps-europarl-internet/vod/illustration/player_bouton_stop.gif'/>";
        if (startPosition && startPosition != null) {
            this.setCurrentPosition(startPosition);
        }
        play();
    } else {
        document.getElementById(bouttonImageDivId).innerHTML = "<img onclick ='javascript:" + this.variableNameOfThis + ".playOrPause(\"" + bouttonImageDivId + "\")' border='0' src='/wps-europarl-internet/vod/illustration/player_bouton_play.gif'/>";
        pause();
    }
};
/**
    Method decrease the MediaPlayer volume, and change the volume image
*/
WindowsMediaPlayer.prototype.decreaseVolume = function (volumeImageDivId) {
   WindowsMediaPlayer.superClass.decreaseVolume.call(this, volumeImageDivId);
    this.setVolume(this.volumePlayer);
};
/**
    Method increase the MediaPlayer volume, and change the volume image
*/
WindowsMediaPlayer.prototype.increaseVolume = function (volumeImageDivId) {
    WindowsMediaPlayer.superClass.increaseVolume.call(this, volumeImageDivId);
    this.setVolume(this.volumePlayer);
};
/**
    Build the Player code and add it to the html document.
    Keep a reference on this player to control it (this.playerObject).
*/
WindowsMediaPlayer.prototype.addPlayerToDocument = function (playerDivId, initialLanguageCode) {
    if (isDebugEnabledWMP)
	    alert("[addPlayerToDocument] replace div content, divId = " + playerDivId);
    var element = document.getElementById(playerDivId);
    element.innerHTML = this.buildPlayerCode();

    this.playerObject = document.getElementById(this.objectId);
    this.volumePlayer = this.getVolume();

    
};

/**
    Method builds and returns the needed HTML code which build the player.
*/
WindowsMediaPlayer.prototype.buildPlayerCode =  function (initialLanguageCode, wantedUrl, startTime) {
    if (wantedUrl == undefined)
    	wantedUrl = this.url;
    
    	
    var WMP7;
    var result = "";
	if (isDebugEnabledWMP)
		alert("[buildPlayerCode] ... ");
	
	// code for Firefox 3.01, Safari 3.1.2, Chrome, Opera 9.60b1	
	if (browser.browserName != "Microsoft Internet Explorer") {
		result += "<div id='videocontainer' style='visibility:hidden'><OBJECT ID=\"" + this.objectId + "\"  NAME=\"" + this.objectId + "\" ";
	    result += " standby=\"Loading Microsoft Windows Media Player components...\"";
	    result += " type=\"application/x-ms-wmp\" width=\"" + this.playerWidth + "\" height=\"" + this.playerHeight + "\" >";
	    
	    result += "<PARAM NAME=\"border\" VALUE=\"0\">";
	    result += "<PARAM NAME=\"url\" VALUE=\"" + wantedUrl + "\">";
	    result += "<PARAM NAME=\"AutoStart\" VALUE=\"true\">";
	    result += "<PARAM NAME=\"stretchToFit\" VALUE=\"" + this.isToStrecthToFit + "\">";
	    result += "<PARAM NAME=\"ShowControls\" VALUE=\"1\">";
	    result += "<PARAM NAME=\"uiMode\" VALUE=\"none\">";
	    result += "<PARAM NAME=\"currentPosition\" VALUE=\"" + this.startPosition +"\">";
	    result += "</OBJECT></div>";
	   
	    
	    
	}
	// code for IE
	else {
		result += "<div id='videocontainer'  style='visibility:hidden'><OBJECT ID=\"" + this.objectId + "\"  NAME=\"" + this.objectId + "\" ";
        result += " CLASSID=\"CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6\"";
        result += " standby=\"Loading Microsoft Windows Media Player components...\"";
        result += " TYPE=\"application/x-oleobject\" width=\"" + this.playerWidth + "\" height=\"" + this.playerHeight + "\">";
        result += "<PARAM NAME=\"border\" VALUE=\"0\">";
        result += "<PARAM NAME=\"url\" VALUE=\"" + wantedUrl + "\">";
        result += "<PARAM NAME=\"AutoStart\" VALUE=\"true\">";
        result += "<PARAM NAME=\"stretchToFit\" VALUE=\"" + this.isToStrecthToFit + "\">";
        result += "<PARAM NAME=\"ShowControls\" VALUE=\"false\">";
        result += "<PARAM NAME=\"uiMode\" VALUE=\"none\">";
        result += "<PARAM NAME=\"currentPosition\" VALUE=\"" + this.startPosition +"\">";
 //Netscape code
        result += "    <Embed type=\"application/x-mplayer2\"";
        result += "        pluginspage=\"http://www.microsoft.com/windows/windowsmedia/\"";
        result += "        filename=\"" + wantedUrl + "\"";
        result += "        src=\"" + wantedUrl + "\"";
        result += "        Name=\"" + this.objectId + "\"";
        result += "        ShowControls=0";
        result += "        ShowDisplay=0";
        result += "        ShowStatusBar=0";
        result += "        autostart=1";
        if(this.isToStrecthToFit){result += "stretchToFit=0";}
        else {result += "stretchToFit=0";}
        result += "        currentPosition=" + this.startPosition;
        result += "        width=" + this.playerWidth;
        result += "        height=" + this.playerHeight + ">";
        result += "    </embed>";
        result += "</OBJECT></div>";
        
        if(this.format == 'audio'){
        	result += '<img src="/wps-europarl-internet/vod/img/cont/eplive/navigation/picto_audio_short.gif" border="0" vspace="140"/>';	
        }
    }
	if (isDebugEnabledWMP)
		alert("[buildPlayerCode] result = " + result);
    return result;
};

/**
    Method builds and returns an html text containing several Player technical data.
*/
WindowsMediaPlayer.prototype.buildTechnicaleData = function () {
    var html = "";

    if (this.playerObject) {
        html += "<span class='vod_texte'>";
        html += "<b>MediaPlayer data :</b>";
        html += "<li /> URL = " + this.getUrl();
        html += "<li /> versionInfo = " + this.playerObject.versionInfo;
        html += "<li /> playState = " + this.getStatus();
        html += "<li /> status = " + this.playerObject.status;
        html += "<li /> volume = " + this.getVolume();
        html += "<li /> Controls.currentAudioLanguage = " + this.getCurrentAudioLanguage();
        html += "<li /> Controls.audioLanguageCount = " + this.getAudioLanguageCount();
        html += "<li /> Controls.currentPosition = " + this.getCurrentPosition();
        html += "</span>";
    } else {
        html += "No video";
    }
    return html;
};
WindowsMediaPlayer.prototype.updateCurrentStatusDiv = function () {
    if (this.playerObject) {
        document.getElementById(this.divNameForCurrentStatus).innerHTML = this.playerObject.status;
    }
};
/**
    Method change the currentPosition according to the given date (in function of the startingDatetime of the video)
*/
WindowsMediaPlayer.prototype.changeVideoCurrentDateTime = function (newPositionDate) {
    var startTime = this.datetimeOfVideo.getTime();
    var wantedTime = newPositionDate.getTime();
    var delta = (wantedTime - startTime) / 1000;
    this.setCurrentPosition(delta);
};

WindowsMediaPlayer.prototype.changeVideoCurrentPosition = function (streamingUrl, newPosition, endPosition, currentDiffusionLanguage, initialLanguage) {
	if (isDebugEnabledWMP)
    	alert("[changeVideoCurrentPosition] newPosition = " + newPosition + ", streamingUrl = " + streamingUrl);
    	

    streamingUrl = createVideoUrlFromLanguageCode(streamingUrl, currentDiffusionLanguage, "wmv");
    if (this.getAudioLanguageCount() == 1) {
        	streamingUrl = streamingUrl.replace("_" + initialLanguage + "_", "_" + currentDiffusionLanguage + "_");
	    }
    if (this.getUrl() != streamingUrl && streamingUrl!='') {
        this.setUrl(streamingUrl);
    }  
    this.setCurrentPosition(newPosition);
};
/**
    Method places the slider bar at the good position, in function of the video time
*/
WindowsMediaPlayer.prototype.updateSliderPosition = function () {
    if (this.sliderRef != undefined && this.playerObject && this.getControls()) {
        this.sliderRef.f_setValue(Math.round(this.getCurrentPosition()));
    }
};


WindowsMediaPlayer.prototype.updatePlayerFormat =function () {
};

WindowsMediaPlayer.prototype.sliderIsMoved = function (newValue) {
    this.setCurrentPosition(newValue);
};
/**
    Method build the Slider object
*/
WindowsMediaPlayer.prototype.initSlider = function () {
    if (this.sliderRef == undefined && this.playerObject && this.getCurrentMedia()) {
       this.reinitSlider(); 
    }
};

WindowsMediaPlayer.prototype.getLengthSlider = function () {
    return lengthslider;
};

WindowsMediaPlayer.prototype.reinitSlider = function (newValueIfNotDetectableInMediaItself) {
	    if (this.getDuration()) {
	        var videoLength = Math.round(parseInt(this.getDuration()));
	        lengthslider=videoLength;
	        WindowsMediaPlayer.superClass.initSlider.call(this, videoLength);
	    }
	    else if (newValueIfNotDetectableInMediaItself){
	    	 if (isDebugEnabledWMP)
    		alert("[reinitSlider] newValueIfNotDetectableInMediaItself = " + newValueIfNotDetectableInMediaItself );
    		lengthslider=newValueIfNotDetectableInMediaItself;
	    	WindowsMediaPlayer.superClass.initSlider.call(this, newValueIfNotDetectableInMediaItself);
	    }    
};

WindowsMediaPlayer.prototype.giveLanguageLCID = function (lngCode) {
    return LCID[lngCode];
};

WindowsMediaPlayer.prototype.giveLanguageIDLC = function (lngCode) {
    return IDLC[lngCode];
};


var LCID = new Array(
"or","es", "cs", "da", "de", "et", "el", "en", "fr", "it",  
"lv","lt", "hu", "mt", "nl", "pl", "pt", "sk", "sl", "fi",  
"sv","ro", "bg", "af", "sq", "am", "ar", "hy", "as", "en-gb", 
"ar-dz", "ar-bh", "ar-eg", "ar-iq", "ar-jo", "ar-kw", "ar-lb", "ar-ly", "ar-ma", "ar-om",
"ar-qa", "ar-sy", "ar-tn", "ar-ae", "ar-ye", "az", "az-az", "eu", "be",
"bs", "my", "ca", "zh", "zh-sg", "zh-tw", "zh-hk", "zh-mo", "hr", "bs",
"dv", "nl-be", "en-au", "en-bz", "en-ca", "en-cb", "en-ie", "en-jm", "en-ph", "en-za",
"en-za", "fo", "fa", "fr-be", "fr-ca", "fr-lu", "fr-ch", "ff", "mk", "ga",
"gd", "gl", "ka", "de-at", "de-li", "de-lu", "de-ch", "gn", "gu", "ha",
"he", "hi", "is", "id", "iu", "it-ch", "ja", "kn", "ks", "kk",
"km", "ko", "lo", "la", "ms-my", "ms-bn", "ml", "mr", "mn", "ne",
"no-nn", "no-nb",  "om", "ps", "pt-br", "pa", "qu", "rm", "ro-mo",
"ru", "ru-mo", "sa", "sr", "sd", "si", "so", "es-ar", "es-bo", "es-cl",
"es-co", "es-cr", "es-do", "es-ec" , "es-gt" , "es-hn", "es-mx" , "es-ni" , "es-pa", "es-pe",
"es-pr", "es-py", "es-sv", "es-uy", "es-ve", "st", "sw", "tg", "ta", "tt",
"te", "th", "bo", "ti", "ts", "tn", "tr", "tk", "ug", "uk",
"ur", "uz", "ve", "vi", "cy", "xh", "yi", "yo");
LCID["or"] = 1077;LCID["es"] = 1034;LCID["cs"] = 1029;LCID["da"] = 1030;LCID["de"] = 1031;
LCID["et"] = 1061;LCID["el"] = 1032;LCID["en"] = 2057;LCID["fr"] = 1036;LCID["it"] = 1040;
LCID["lv"] = 1062;LCID["lt"] = 1063;LCID["hu"] = 1038;LCID["mt"] = 1082;LCID["nl"] = 1043;
LCID["pl"] = 1045;LCID["pt"] = 2070;LCID["sk"] = 1051;LCID["sl"] = 1060;LCID["fi"] = 1035;
LCID["sv"] = 1053;LCID["ro"] = 1048;LCID["bg"] = 1026;
LCID["af"] = 1078;			//Afrikaans
LCID["sq"] = 1052;			//Albanian
LCID["am"] = 1118;			//Amharic - Ethiopia
LCID["hy"] = 1067;			//Armenian - Armenia
LCID["as"] = 1101;			//Assamese
LCID["en-us"] = 1033;		//English - United States
LCID["ar"] = 1025;			//Arabic - Algeria 
LCID["ar-dz"] = 5121;		//Arabic - Saudi Arabia
LCID["ar-bh"] = 15361;		//Arabic - Bahrain
LCID["ar-eg"] = 3073;		//Arabic - Egypt
LCID["ar-iq"] = 2049;		//Arabic - Iraq
LCID["ar-jo"] = 11265;		//Arabic - Jordan
LCID["ar-kw"] = 13313;		//Arabic - Kuwait
LCID["ar-lb"] = 12289;		//Arabic - Lebanon
LCID["ar-ly"] = 4097;		//Arabic - Libya
LCID["ar-ma"] = 6145;		//Arabic - Morocco
LCID["ar-om"] = 8193;		//Arabic - Oman
LCID["ar-qa"] = 16385 ;		//Arabic - Qatar
LCID["ar-sy"] = 10241;		//Arabic - Syria
LCID["ar-tn"] = 7169;		//Arabic - Tunisia
LCID["ar-ae"] = 14337;		//Arabic - U.A.E.(Arabic - United Arab Emirate))
LCID["ar-ye"] = 9217;		//Arabic - Yemen
LCID["az"] = 1068;			//Azeri (Latin)
LCID["az-az"] = 2092;		//Azeri (Cyrillic)
LCID["eu"] = 1069;			//Basque
LCID["be"] = 1059;			//Belarusian
LCID["bn"] = 1093;			//Bengali (India)
LCID["bs"] = 5146;			//Bosnian (Bosnia/Herzegovina)
LCID["my"] = 1109;			//Birman (burmese))
LCID["ca"] = 1027;			//Catalan
LCID["zh"] = 2052;			//Chinese - China
LCID["zh-sg"] = 4100;		//Chinese - Singapore
LCID["zh-tw"] = 1028;		//Chinese - Taiwan
LCID["zh-hk"] = 3076;		//Chinese - Hong Kong SAR
LCID["zh-mo"] = 5124;		//Chinese - Macao SAR
LCID["hr"] = 1050;			//Croatian
LCID["bs"] = 5146;			//Croatian (Bosnia/Herzegovina)
LCID["dv"] = 1125;			//Div�hi (Maldivien)
LCID["nl-be"] = 2067;		//Dutch - Belgium
LCID["en-au"] = 3081;		//English - Australia
LCID["en-bz"] = 10249;		//English - Belize
LCID["en-ca"] = 4105;		//English - Canada
LCID["en-cb"] = 9225;		//English - Caribbean
LCID["en-ie"] = 6153;		//English - Ireland
LCID["en-jm"] = 8201;		//English - Jamaica
LCID["en-nz"] = 5129;		//English - New Zealand
LCID["en-ph"] = 13321;		//English - Phillippines
LCID["en-za"] = 7177; 		//English - Southern Africa
LCID["en-tt"] = 11273; 		//English - Trinidad
LCID["fo"] = 1080;			//Faroese (F�ro�en)
LCID["fa"] = 1065;			//Farsi
LCID["fr-be"] = 2060;		//French - Belgium
LCID["fr-ca"] = 3084;		//French - Canada
LCID["fr-lu"] = 5132;		//French - Luxembourg
LCID["fr-ch"] = 4108;		//French - Switzerland
LCID["ff"] = 1127;			//Fulfulde - Nigeria
LCID["mk"] = 1071;			//F.Y.R.O. Macedonia
LCID["ga"] = 2108;		    //Gaelic - Ireland
LCID["gd"] = 1084;			//Gaelic - Scotland
LCID["gl"] = 1110;			//Galician
LCID["ka"] = 1079;			//Georgian
LCID["de-at"] = 3079;		//German - Austria
LCID["de-li"] = 5127;		//German - Liechtenstein
LCID["de-lu"] = 4103;		//German - Luxembourg
LCID["de-ch"] = 2055;		//German - Switzerland
LCID["gn"] = 1140;			//Guarani - Paraguay
LCID["gu"] = 1095;			//Gujarati
LCID["he"] = 1037;			//Hebrew
LCID["hi"] = 1081;			//Hindi
LCID["is"] = 1039;			//Icelandic
LCID["id"] = 1057;			//Indonesian
LCID["iu"] = 1117;			//Inuktitut (esquimau)
LCID["it-ch"] = 2064;		//Italian - Switzerland
LCID["ja"] = 1041;			//Japanese
LCID["kn"] = 1099;			//Kannada, Canara
LCID["ks"] = 2144;			//Kashmiri, Cachemiri
LCID["kk"] = 1087;			//Kazakh
LCID["km"] = 1107;			//Khmer
LCID["ko"] = 1042;			//Korean
LCID["lo"] = 1108;			//Lao
LCID["la"] = 1142;			//Latin
LCID["ms-my"] = 1086;		//Malay - Malaysia
LCID["ms-bn"] = 2110;		//Malay - Brunei
LCID["ml"] = 1100;			//Malayalam
LCID["mr"] = 1102;			//Marathi
LCID["mn"] = 2128;			//Mongolian (Mongolian)
LCID["ne"] = 1121;			//Nepali
LCID["no-nn"] = 1044;		//Norwegian Nynorsk
LCID["no-nb"] = 2068;		//Norwegian Bokmal
//LCID["or"] = 1096;			//Oriya
LCID["om"] = 1138;			//Oromo, Galla
LCID["ps"] = 1123;			//Pashto (Pachtou)
LCID["pt-br"] = 1046;		//Portuguese - Brazil
LCID["pa"] = 1094;			//Punjabi(Pendjabi)
LCID["qu"] = 3179;			//Qu�chua (Kitchoua) perou
LCID["rm"] = 1047;			//Raeto-Romance
LCID["ro-mo"] = 2072;		//Romanian - Republic of Moldova
LCID["ru"] = 1049;			//Russian
LCID["ru-mo"] = 2073;		//Russian - Republic of Moldova
LCID["sa"] = 1103;			//Sanskrit
LCID["sr"] = 3098;			//Serbian
LCID["sd"] = 2137;			//Sindhi - Pakistan
LCID["si"] = 1115;			//Sinhalese - Sri Lanka
LCID["so"] = 1143;			//Somali
LCID["es-ar"] = 11274;		//Spanish - Argentina
LCID["es-bo"] = 16394;		//Spanish - Bolivia
LCID["es-cl"] = 13322;		//Spanish - Chile
LCID["es-co"] = 9226;		//Spanish - Colombia
LCID["es-cr"] = 5130;		//Spanish - Costa Rica
LCID["es-do"] = 7178;		//Spanish - Dominican Republic
LCID["es-ec"] = 12298;		//Spanish - Ecuador
LCID["es-gt"] = 4106;		//Spanish - Guatemala
LCID["es-hn"] = 18442;		//Spanish - Honduras
LCID["es-mx"] = 2058;		//Spanish - Mexico
LCID["es-ni"] = 19466;		//Spanish - Nicaragua
LCID["es-pa"] = 6154;		//Spanish - Panama
LCID["es-pe"] = 10250;		//Spanish - Peru
LCID["es-pr"] = 20490;		//Spanish - Puerto Rico
LCID["es-py"] = 15370;		//Spanish - Paraguay
LCID["es-sv"] = 17418;		//Spanish - El Salvador
LCID["es-uy"] = 14346;		//Spanish - Uruguay
LCID["es-ve"] = 8202;		//Spanish - Venezuela
LCID["st"] = 1072;			//Sotho, Southern
LCID["sw"] = 1089;			//Swahili
LCID["tg"] = 1064;			//Tajik
LCID["ta"] = 1097;			//Tamil
LCID["tt"] = 1092;			//Tatar
LCID["te"] = 1098;			//Telugu
LCID["th"] = 1054;			//Thai
LCID["bo"] = 2129;			//Tibetan
LCID["ti"] = 2163;			//Tigrinya
LCID["ts"] = 1073;			//Tsonga
LCID["tn"] = 1074;			//Tswana
LCID["tr"] = 1055;			//Turkish
LCID["tk"] = 1090;			//Turkmen
LCID["ug"] = 1152;			//Uighur - China
LCID["uk"] = 1058;			//Ukrainian
LCID["ur"] = 1056;			//Ukrainian
LCID["uz"] = 2115;			//Uzbek
LCID["ve"] = 1075;			//Venda
LCID["vi"] = 1066;			//Vietnamese
LCID["cy"] = 1106;			//Welsh (gallois)
LCID["xh"] = 1076;			//Xhosa
LCID["yi"] = 1085;			//Yiddish
LCID["yo"] = 1130;			//Yoruba

/**
This is the List of Locale ID (LCID) Values as Assigned by Microsoft
*/
var IDLC = new Array(
"1077", "1034", "1029", "1030", "1031", "1061", "1032", "2057", "1036", "1040", 
"1062", "1063", "1038", "1082", "1043", "1045", "2070", "1051", "1060", "1035", 
"1053", "1048", "1026", "1078", "1052", "1118", "1025", "1067", "1101", "1033",
"5121", "15361", "3073", "2049", "11265", "13313", "12289", "4097", "6145", "8193",
"16385", "10241", "7169", "14337", "9217", "1068", "2092", "1069", "1059", "1093",
"5146", "1109", "1027", "2052", "4100", "1028", "3076", "5124", "1050", "5146",
"1125", "2067", "3081", "10249", "4105", "9225", "6153", "8201", "13321", "7177",
"11273", "1080", "1065", "2060", "3084", "5132", "4108", "1127", "1071", "2108",
"1084", "1110", "1079", "3079", "5127", "4103", "2055", "1140", "1095", "1128",
"1037", "1081", "1039", "1057", "1117", "2064", "1041", "1099", "2144", "1087",
"1107", "1042", "1108", "1142", "1086", "2110", "1100", "1102", "2128", "1121",
"1044", "2068", "1138", "1123", "1046", "1094", "3179", "1047", "2072",
"1049", "2073", "1103", "3098", "2137", "1115", "1143", "11274", "16394", "13322",
"9226", "5130",  "7178", "12298" , "4106", "18442", "2058", "19466", "6154", "10250",
"20490", "15370", "17418", "14346", "8202", "1072", "1089", "1064", "1097", "1092",
"1098", "1054", "2129", "2163", "1073", "1074", "1055", "1090", "1152", "1058",
"1056", "2115", "1075", "1066", "1106", "1076", "1085", "1130");


IDLC["1077"] = "or";IDLC["1034"] = "es";IDLC["1029"] = "cs";IDLC["1030"] = "da";IDLC["1031"] = "de";
IDLC["1061"] = "et";IDLC["1032"] = "el";IDLC["2057"] = "en";IDLC["1036"] = "fr";IDLC["1040"] = "it";
IDLC["1062"] = "lv";IDLC["1063"] = "lt";IDLC["1038"] = "hu";IDLC["1082"] = "mt";IDLC["1043"] = "nl";
IDLC["1045"] = "pl";IDLC["2070"] = "pt";IDLC["1051"] = "sk";IDLC["1060"] = "sl";IDLC["1035"] = "fi";
IDLC["1053"] = "sv";IDLC["1048"] = "ro";IDLC["1026"] = "bg";IDLC["1078"] = "af";IDLC["1052"] = "sq";
IDLC["1118"] = "am";IDLC["1067"] = "hy";IDLC["1101"] = "as";IDLC["1033"] = "en-us";IDLC["1025"] = "ar";
IDLC["5021"] = "ar-dz";IDLC["15361"] = "ar-bh";IDLC["3073"] = "ar-eg";IDLC["2049"] = "ar-iq";IDLC["11265"] = "ar-jo";
IDLC["13313"] = "ar-kw";IDLC["12289"] = "ar-lb";IDLC["4097"] = "ar-ly";IDLC["6145"] = "ar-ma";IDLC["8193"] = "ar-om";
IDLC["16385"] = "ar-qa";IDLC["10241"] = "ar-sy";IDLC["7169"] = "ar-tn";IDLC["14337"] = "ar-ae";IDLC["9217"] = "ar-ye";
IDLC["1068"] = "az";IDLC["2092"] = "az-az";IDLC["1069"] = "eu";IDLC["1059"] = "be";IDLC["1093"] = "bn";
IDLC["5146"] = "bs";IDLC["1109"] = "my";IDLC["1027"] = "ca";IDLC["2052"] = "zh";IDLC["4100"] = "zh-sg";
IDLC["1028"] = "zh-tw";IDLC["3076"] = "zh-hk";IDLC["5124"] = "zh-mo";IDLC["1050"] = "hr";IDLC["5146"] = "bs";
IDLC["1125"] = "dv";IDLC["2067"] = "nl-be";IDLC["3081"] = "en-au";IDLC["10249"] = "en-bz";IDLC["4105"] = "en-ca";
IDLC["9225"] = "en-cb";IDLC["6153"] = "en-ie";IDLC["8201"] = "en-jm";IDLC["13321"] = "en-ph";IDLC["7177"] = "en-za";
IDLC["11273"] = "en-tt";IDLC["1080"] = "fo";IDLC["1065"] = "fa";IDLC["2060"] = "fr-be";IDLC["3084"] = "fr-ca";
IDLC["5132"] = "fr-lu";IDLC["4108"] = "fr-ch";IDLC["1127"] = "ff";IDLC["1071"] = "mk";IDLC["2108"] = "ga";
IDLC["1084"] = "gd";IDLC["1110"] = "gl";IDLC["1079"] = "ka";IDLC["3079"] = "de-at";IDLC["5127"] = "de-li";
IDLC["4103"] = "de-lu";IDLC["2055"] = "de-ch";IDLC["1140"] = "gn";IDLC["1095"] = "gu";IDLC["1128"] = "ha";
IDLC["1037"] = "he";IDLC["1081"] = "hi";IDLC["1039"] = "is";IDLC["1057"] = "id";IDLC["1117"] = "iu";
IDLC["2064"] = "it-ch";IDLC["1041"] = "ja";IDLC["1099"] = "kn";IDLC["2144"] = "ks";IDLC["1087"] = "kk";
IDLC["1107"] = "km";IDLC["1042"] = "ko";IDLC["1108"] = "lo";IDLC["1142"] = "la";IDLC["1086"] = "ms-my";
IDLC["2110"] = "ms-bn";IDLC["1100"] = "ml";IDLC["1102"] = "mr";IDLC["2128"] = "mn";IDLC["1121"] = "ne";
IDLC["1044"] = "no-nn";IDLC["2068"] = "no-nb";
//IDLC["1096"] = "or";
IDLC["1138"] = "om";IDLC["1123"] = "ps";
IDLC["1046"] = "pt-br";IDLC["1094"] = "pa";IDLC["3079"] = "qu";IDLC["1047"] = "rm";IDLC["2072"] = "ro-mo";
IDLC["1049"] = "ru";IDLC["2073"] = "ru-mo";IDLC["1103"] = "sa";IDLC["3098"] = "sr";IDLC["2137"] = "sd";
IDLC["1115"] = "si";IDLC["1143"] = "so";IDLC["11274"] = "es-ar";IDLC["16394"] = "es-bo";IDLC["13322"] = "es-cl";
IDLC["9226"] = "es-co";IDLC["5130"] = "es-cr";IDLC["7178"] = "es-do";IDLC["12298"] = "es-ec";IDLC["4106"] = "es-gt";
IDLC["18442"] = "es-hn";IDLC["2058"] = "es-mx";IDLC["19466"] = "es-ni";IDLC["6154"] = "es-pa";IDLC["10250"] = "es-pe";
IDLC["20490"] = "es-pr";IDLC["15370"] = "es-py";IDLC["17418"] = "es-sv";IDLC["14346"] = "es-uy";IDLC["8202"] = "es-ve";
IDLC["1072"] = "st";IDLC["1089"] = "sw";IDLC["1064"] = "tg";IDLC["1097"] = "ta";IDLC["1092"] = "tt";
IDLC["1098"] = "te";IDLC["1054"] = "th";IDLC["2129"] = "bo";IDLC["2163"] = "ti";IDLC["1073"] = "ts";
IDLC["1074"] = "tn";IDLC["1055"] = "tr";IDLC["1090"] = "tk";IDLC["1152"] = "ug";IDLC["1058"] = "uk";
IDLC["1056"] = "ur";IDLC["2115"] = "uz";IDLC["1075"] = "ve";IDLC["1066"] = "vi";IDLC["1106"] = "cy";
IDLC["1076"] = "xh";IDLC["1085"] = "yi";IDLC["1130"] = "yo";


