// Always clear an option list from the last entry to the first
for (x = OptionList.length; x >= 0; x = x - 1) {
OptionList[x] = null;
}
}
function AddToOptionList(OptionList, OptionValue, OptionText) {
// Add option to the bottom of the list
OptionList[OptionList.length] = new Option(OptionText, OptionValue);
}
function getArraylength( arrName )
{
return arrName.length;
}
function GetCountryAndLangName(arrName, index)
{
return eval(arrName)[index];
}
function GetCountryNameAndLangCode(index)
{
var strCountryName = gCountryArraySorted[index];
var strLangCode = GetLangCodeFromCountryName ( strCountryName );
return ( strCountryName + "$" + strLangCode );
}
function CreateUnsortedCountryArray ()
{
var nCount = gCountryArray.length;
gCountryArrayUnSorted = new Array(nCount);
for ( i = 0; i < nCount; i++)
gCountryArrayUnSorted[i] = gCountryArray[i];
}
function SortArray ( SourceArray, DestinationArray )
{
CreateUnsortedCountryArray();
gCountryArraySorted = gCountryArray.sort();
}
function GetLangCodeFromCountryName ( strCountryName )
{
var strLangCode = gDefaultLangCode;
var nLength = gCountryArray.length;
for ( nCtr = 0; nCtr < nLength; nCtr++ )
{
if ( strCountryName == gCountryArrayUnSorted[nCtr] )
{
strLangCode = gLangCode[nCtr];
break;
}
}
return strLangCode;
}
function GetLangCodeForPrivacyPolicy( langCode )
{
var strLangCode = langCode;
if ( -1 == gPrivacyPolicyLangCode.indexOf("|"+langCode+"|") )
strLangCode = gDefaultLangCode;
return strLangCode;
}
function openNoScrollWindow(url,title,width,height)
{
var strFeatures = "toolbar=no,scrollbars=yes,menubar=no,location=no,directories=no,status=yes,resizable=yes";
var x = screen.width;
var y = screen.height;
var top = parseInt((y-height)/2);
var left = parseInt((x-width)/2);
// open new window and use the variables to position it
window.parent.closed
var objWindow = window.open(url,title,'width='+width+',height='+height+',left='+left+',top='+top+',scrollbars=yes,resize=yes,resizable=yes,menubar=no,toolbar=no,directories=no');