﻿function EnsureElementHeight(BodyId)
{
	$(window).resize(function(e){
		SetElementHeight(BodyId);
	});
	$(document).ready(function(){
		SetElementHeight(BodyId);
	});
}

function SetElementHeight(BodyId){
	var hmfh = 0;
	var sibCnt = $('#'+BodyId).siblings().length;
	for(var i = 0;i<sibCnt;i++)
		hmfh += ObjectSize($('#'+BodyId).siblings()[i],true)[0];
	var parh = ObjectSize($('#'+BodyId).parent(),true)[0];
	var bodyh = ObjectSize(BodyId)[0];
	var size = bodyh>(parh-hmfh)?bodyh:(parh-hmfh);
	$('#'+BodyId).height(size);
}


function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function ObjectPosition(obj) {
    var curleft = 0;
      var curtop = 0;
      if (obj.offsetParent) {
            do {
                  curleft += obj.offsetLeft;
                  curtop += obj.offsetTop;
            } while (obj = obj.offsetParent);
      }
      return [curleft,curtop];
}

function ObjectSize(objId, isDOMobject) {
	objId = isDOMobject?objId:'#'+objId;
    var jqObj = $(objId);
    var height = 0;
    height += jqObj.margin().top + jqObj.margin().bottom;
    height += jqObj.border().top + jqObj.border().bottom;
    height += jqObj.padding().top + jqObj.padding().bottom;
    height += jqObj.height();
    var width = 0;
    width += jqObj.margin().left + jqObj.margin().right;
    width += jqObj.border().left + jqObj.border().right;
    width += jqObj.padding().left + jqObj.padding().right;
    width += jqObj.width();
    return new Array(height,width);
}

function presistTextBoxValue(TextBoxElementId,presistedVal)
{
	$('#'+TextBoxElementId).attr('presistedVal',presistedVal)
	$('#'+TextBoxElementId).addClass('DefaultPresistedText');
	//$('#'+TextBoxElementId).val( $('#'+TextBoxElementId).attr('presistedVal'));
	$('#'+TextBoxElementId).focus(function(){
		if(this.value == $(this).attr('presistedVal')) {
			this.value = '';
			$(this).removeClass('DefaultPresistedText');
		}
	});
	$('#'+TextBoxElementId).blur(function(){
		if(this.value == '') {
			this.value = $(this).attr('presistedVal');
			$(this).addClass('DefaultPresistedText');
		}
	});
}

function CommentBoxValidation(max,CommentBoxElement,LabelID){
	var box = CommentBoxElement;
	var lbl = document.getElementById(LabelID);
	var boxVal = box.value;
	if(boxVal.length > max){
		boxVal = boxVal.substring(0,max);
		box.value = boxVal;
	}
	lbl.style.color = (boxVal.length >= max ? "#f00" : "#bbb");
	lbl.innerText = boxVal.length + " / " + max+" Karakters"
}

function GetShortLanguageAndCountry(){
	var langShort = navigator.browserLanguage.substr(0,2);
	var cunShort = navigator.browserLanguage.substr(3,2)
	return new Array(langShort,cunShort);
}

function GetLongLanguage(shortLan)
{	
	shortLan = shortLan.toUpperCase();
	if(shortLan=='AA')return "Afar";
	if(shortLan=='AB')return "Abkhazian";
	if(shortLan=='AF')return "Afrikaans";
	if(shortLan=='AM')return "Amharic";
	if(shortLan=='AR')return "Arabic";
	if(shortLan=='AS')return "Assamese";
	if(shortLan=='AY')return "Aymara";
	if(shortLan=='AZ')return "Azerbaijani";
	if(shortLan=='BA')return "Bashkir";
	if(shortLan=='BE')return "Byelorussian";
	if(shortLan=='BG')return "Bulgarian";
	if(shortLan=='BH')return "Bihari";
	if(shortLan=='BI')return "Bislama";
	if(shortLan=='BN')return "Bengali";
	if(shortLan=='BO')return "Tibetan";
	if(shortLan=='BR')return "Breton";
	if(shortLan=='CA')return "Catalan";
	if(shortLan=='CO')return "Corsican";
	if(shortLan=='CS')return "Czech";
	if(shortLan=='CY')return "Welsh";
	if(shortLan=='DA')return "Danish";
	if(shortLan=='DE')return "German";
	if(shortLan=='DZ')return "Bhutani";
	if(shortLan=='EL')return "Greek";
	if(shortLan=='EN')return "English";
	if(shortLan=='EO')return "Esperanto";
	if(shortLan=='ES')return "Spanish";
	if(shortLan=='ET')return "Estonian";
	if(shortLan=='EU')return "Basque";
	if(shortLan=='FA')return "Persian";
	if(shortLan=='FI')return "Finnish";
	if(shortLan=='FJ')return "Fiji";
	if(shortLan=='FO')return "Faeroese";
	if(shortLan=='FR')return "French";
	if(shortLan=='FY')return "Frisian";
	if(shortLan=='GA')return "Irish";
	if(shortLan=='GD')return "Gaelic";
	if(shortLan=='GL')return "Galician";
	if(shortLan=='GN')return "Guarani";
	if(shortLan=='GU')return "Gujarati";
	if(shortLan=='HA')return "Hausa";
	if(shortLan=='HI')return "Hindi";
	if(shortLan=='HR')return "Croatian";
	if(shortLan=='HU')return "Hungarian";
	if(shortLan=='HY')return "Armenian";
	if(shortLan=='IA')return "Interlingua";
	if(shortLan=='IE')return "Interlingue";
	if(shortLan=='IK')return "Inupiak";
	if(shortLan=='IN')return "Indonesian";
	if(shortLan=='IS')return "Icelandic";
	if(shortLan=='IT')return "Italian";
	if(shortLan=='IW')return "Hebrew";
	if(shortLan=='JA')return "Japanese";
	if(shortLan=='JI')return "Yiddish";
	if(shortLan=='JW')return "Javanese";
	if(shortLan=='KA')return "Georgian";
	if(shortLan=='KK')return "Kazakh";
	if(shortLan=='KL')return "Greenlandic";
	if(shortLan=='KM')return "Cambodian";
	if(shortLan=='KN')return "Kannada";
	if(shortLan=='KO')return "Korean";
	if(shortLan=='KS')return "Kashmiri";
	if(shortLan=='KU')return "Kurdish";
	if(shortLan=='KY')return "Kirghiz";
	if(shortLan=='LA')return "Latin";
	if(shortLan=='LN')return "Lingala";
	if(shortLan=='LO')return "Laothian";
	if(shortLan=='LT')return "Lithuanian";
	if(shortLan=='LV')return "Latvian";
	if(shortLan=='MG')return "Malagasy";
	if(shortLan=='MI')return "Maori";
	if(shortLan=='MK')return "Macedonian";
	if(shortLan=='ML')return "Malayalam";
	if(shortLan=='MN')return "Mongolian";
	if(shortLan=='MO')return "Moldavian";
	if(shortLan=='MR')return "Marathi";
	if(shortLan=='MS')return "Malay";
	if(shortLan=='MT')return "Maltese";
	if(shortLan=='MY')return "Burmese";
	if(shortLan=='NA')return "Nauru";
	if(shortLan=='NE')return "Nepali";
	if(shortLan=='NL')return "Dutch";
	if(shortLan=='NO')return "Norwegian";
	if(shortLan=='OC')return "Occitan";
	if(shortLan=='OM')return "Oromo";
	if(shortLan=='OR')return "Oriya";
	if(shortLan=='PA')return "Punjabi";
	if(shortLan=='PL')return "Polish";
	if(shortLan=='PS')return "Pashto";
	if(shortLan=='PT')return "Portuguese";
	if(shortLan=='QU')return "Quechua";
	if(shortLan=='RM')return "Rhaeto-Romance";
	if(shortLan=='RN')return "Kirundi";
	if(shortLan=='RO')return "Romanian";
	if(shortLan=='RU')return "Russian";
	if(shortLan=='RW')return "Kinyarwanda";
	if(shortLan=='SA')return "Sanskrit";
	if(shortLan=='SD')return "Sindhi";
	if(shortLan=='SG')return "Sangro";
	if(shortLan=='SH')return "Serbo-Croatian";
	if(shortLan=='SI')return "Singhalese";
	if(shortLan=='SK')return "Slovak";
	if(shortLan=='SL')return "Slovenian";
	if(shortLan=='SM')return "Samoan";
	if(shortLan=='SN')return "Shona";
	if(shortLan=='SO')return "Somali";
	if(shortLan=='SQ')return "Albanian";
	if(shortLan=='SR')return "Serbian";
	if(shortLan=='SS')return "Siswati";
	if(shortLan=='ST')return "Sesotho";
	if(shortLan=='SU')return "Sudanese";
	if(shortLan=='SV')return "Swedish";
	if(shortLan=='SW')return "Swahili";
	if(shortLan=='TA')return "Tamil";
	if(shortLan=='TE')return "Tegulu";
	if(shortLan=='TG')return "Tajik";
	if(shortLan=='TH')return "Thai";
	if(shortLan=='TI')return "Tigrinya";
	if(shortLan=='TK')return "Turkmen";
	if(shortLan=='TL')return "Tagalog";
	if(shortLan=='TN')return "Setswana";
	if(shortLan=='TO')return "Tonga";
	if(shortLan=='TR')return "Turkish";
	if(shortLan=='TS')return "Tsonga";
	if(shortLan=='TT')return "Tatar";
	if(shortLan=='TW')return "Twi";
	if(shortLan=='UK')return "Ukrainian";
	if(shortLan=='UR')return "Urdu";
	if(shortLan=='UZ')return "Uzbek";
	if(shortLan=='VI')return "Vietnamese";
	if(shortLan=='VO')return "Volapuk";
	if(shortLan=='WO')return "Wolof";
	if(shortLan=='XH')return "Xhosa";
	if(shortLan=='YO')return "Yoruba";
	if(shortLan=='ZH')return "Chinese";
	if(shortLan=='ZU')return "Zulu";
	return "?";			
}

function GetLongCountry(shortCountry)
{
	shortCountry = shortCountry.toUpperCase();
	if(shortCountry=='AC')return 'Ascension Island';
	if(shortCountry=='AD')return 'Andorra';
	if(shortCountry=='AE')return 'United Arab Emirates';
	if(shortCountry=='AF')return 'Afghanistan';
	if(shortCountry=='AG')return 'Antigua and Barbuda';
	if(shortCountry=='AI')return 'Anguilla';
	if(shortCountry=='AL')return 'Albania';
	if(shortCountry=='AM')return 'Armenia';
	if(shortCountry=='AN')return 'Netherlands Antilles';
	if(shortCountry=='AO')return 'Angola';
	if(shortCountry=='AQ')return 'Antarctica';
	if(shortCountry=='AR')return 'Argentina';
	if(shortCountry=='AS')return 'American Samoa';
	if(shortCountry=='AT')return 'Austria';
	if(shortCountry=='AU')return 'Australia';
	if(shortCountry=='AW')return 'Aruba';
	if(shortCountry=='AX')return 'Aland Islands';
	if(shortCountry=='AZ')return 'Azerbaijan';
	if(shortCountry=='BA')return 'Bosnia and Herzegovina';
	if(shortCountry=='BB')return 'Barbados';
	if(shortCountry=='BD')return 'Bangladesh';
	if(shortCountry=='BE')return 'Belgium';
	if(shortCountry=='BF')return 'Burkina Faso';
	if(shortCountry=='BG')return 'Bulgaria';
	if(shortCountry=='BH')return 'Bahrain';
	if(shortCountry=='BI')return 'Burundi';
	if(shortCountry=='BJ')return 'Benin';
	if(shortCountry=='BM')return 'Bermuda';
	if(shortCountry=='BN')return 'Brunei Darussalam';
	if(shortCountry=='BO')return 'Bolivia';
	if(shortCountry=='BR')return 'Brazil';
	if(shortCountry=='BS')return 'Bahamas';
	if(shortCountry=='BT')return 'Bhutan';
	if(shortCountry=='BV')return 'Bouvet Island';
	if(shortCountry=='BW')return 'Botswana';
	if(shortCountry=='BY')return 'Belarus';
	if(shortCountry=='BZ')return 'Belize';
	if(shortCountry=='CA')return 'Canada';
	if(shortCountry=='CC')return 'Cocos (Keeling) Islands';
	if(shortCountry=='CD')return 'Congo, Democratic Republic';
	if(shortCountry=='CF')return 'Central African Republic';
	if(shortCountry=='CG')return 'Congo';
	if(shortCountry=='CH')return 'Switzerland';
	if(shortCountry=='CI')return 'Cote D\'Ivoire (Ivory Coast)';
	if(shortCountry=='CK')return 'Cook Islands';
	if(shortCountry=='CL')return 'Chile';
	if(shortCountry=='CM')return 'Cameroon';
	if(shortCountry=='CN')return 'China';
	if(shortCountry=='CO')return 'Colombia';
	if(shortCountry=='CR')return 'Costa Rica';
	if(shortCountry=='CS')return 'Czechoslovakia (former)';
	if(shortCountry=='CU')return 'Cuba';
	if(shortCountry=='CV')return 'Cape Verde';
	if(shortCountry=='CX')return 'Christmas Island';
	if(shortCountry=='CY')return 'Cyprus';
	if(shortCountry=='CZ')return 'Czech Republic';
	if(shortCountry=='DE')return 'Germany';
	if(shortCountry=='DJ')return 'Djibouti';
	if(shortCountry=='DK')return 'Denmark';
	if(shortCountry=='DM')return 'Dominica';
	if(shortCountry=='DO')return 'Dominican Republic';
	if(shortCountry=='DZ')return 'Algeria';
	if(shortCountry=='EC')return 'Ecuador';
	if(shortCountry=='EE')return 'Estonia';
	if(shortCountry=='EG')return 'Egypt';
	if(shortCountry=='EH')return 'Western Sahara';
	if(shortCountry=='ER')return 'Eritrea';
	if(shortCountry=='ES')return 'Spain';
	if(shortCountry=='ET')return 'Ethiopia';
	if(shortCountry=='FI')return 'Finland';
	if(shortCountry=='FJ')return 'Fiji';
	if(shortCountry=='FK')return 'Falkland Islands (Malvinas)';
	if(shortCountry=='FM')return 'Micronesia';
	if(shortCountry=='FO')return 'Faroe Islands';
	if(shortCountry=='FR')return 'France';
	if(shortCountry=='FX')return 'France, Metropolitan';
	if(shortCountry=='GA')return 'Gabon';
	if(shortCountry=='GB')return 'Great Britain (UK)';
	if(shortCountry=='GD')return 'Grenada';
	if(shortCountry=='GE')return 'Georgia';
	if(shortCountry=='GF')return 'French Guiana';
	if(shortCountry=='GG')return 'Guernsey';
	if(shortCountry=='GH')return 'Ghana';
	if(shortCountry=='GI')return 'Gibraltar';
	if(shortCountry=='GL')return 'Greenland';
	if(shortCountry=='GM')return 'Gambia';
	if(shortCountry=='GN')return 'Guinea';
	if(shortCountry=='GP')return 'Guadeloupe';
	if(shortCountry=='GQ')return 'Equatorial Guinea';
	if(shortCountry=='GR')return 'Greece';
	if(shortCountry=='GS')return 'S. Georgia and S. Sandwich Isls.';
	if(shortCountry=='GT')return 'Guatemala';
	if(shortCountry=='GU')return 'Guam';
	if(shortCountry=='GW')return 'Guinea-Bissau';
	if(shortCountry=='GY')return 'Guyana';
	if(shortCountry=='HK')return 'Hong Kong';
	if(shortCountry=='HM')return 'Heard and McDonald Islands';
	if(shortCountry=='HN')return 'Honduras';
	if(shortCountry=='HR')return 'Croatia (Hrvatska)';
	if(shortCountry=='HT')return 'Haiti';
	if(shortCountry=='HU')return 'Hungary';
	if(shortCountry=='ID')return 'Indonesia';
	if(shortCountry=='IE')return 'Ireland';
	if(shortCountry=='IL')return 'Israel';
	if(shortCountry=='IM')return 'Isle of Man';
	if(shortCountry=='IN')return 'India';
	if(shortCountry=='IO')return 'British Indian Ocean Territory';
	if(shortCountry=='IQ')return 'Iraq';
	if(shortCountry=='IR')return 'Iran';
	if(shortCountry=='IS')return 'Iceland';
	if(shortCountry=='IT')return 'Italy';
	if(shortCountry=='JE')return 'Jersey';
	if(shortCountry=='JM')return 'Jamaica';
	if(shortCountry=='JO')return 'Jordan';
	if(shortCountry=='JP')return 'Japan';
	if(shortCountry=='KE')return 'Kenya';
	if(shortCountry=='KG')return 'Kyrgyzstan';
	if(shortCountry=='KH')return 'Cambodia';
	if(shortCountry=='KI')return 'Kiribati';
	if(shortCountry=='KM')return 'Comoros';
	if(shortCountry=='KN')return 'Saint Kitts and Nevis';
	if(shortCountry=='KP')return 'Korea (North)';
	if(shortCountry=='KR')return 'Korea (South)';
	if(shortCountry=='KW')return 'Kuwait';
	if(shortCountry=='KY')return 'Cayman Islands';
	if(shortCountry=='KZ')return 'Kazakhstan';
	if(shortCountry=='LA')return 'Laos';
	if(shortCountry=='LB')return 'Lebanon';
	if(shortCountry=='LC')return 'Saint Lucia';
	if(shortCountry=='LI')return 'Liechtenstein';
	if(shortCountry=='LK')return 'Sri Lanka';
	if(shortCountry=='LR')return 'Liberia';
	if(shortCountry=='LS')return 'Lesotho';
	if(shortCountry=='LT')return 'Lithuania';
	if(shortCountry=='LU')return 'Luxembourg';
	if(shortCountry=='LV')return 'Latvia';
	if(shortCountry=='LY')return 'Libya';
	if(shortCountry=='MA')return 'Morocco';
	if(shortCountry=='MC')return 'Monaco';
	if(shortCountry=='MD')return 'Moldova';
	if(shortCountry=='ME')return 'Montenegro';
	if(shortCountry=='MG')return 'Madagascar';
	if(shortCountry=='MH')return 'Marshall Islands';
	if(shortCountry=='MK')return 'F.Y.R.O.M. (Macedonia)';
	if(shortCountry=='ML')return 'Mali';
	if(shortCountry=='MM')return 'Myanmar';
	if(shortCountry=='MN')return 'Mongolia';
	if(shortCountry=='MO')return 'Macau';
	if(shortCountry=='MP')return 'Northern Mariana Islands';
	if(shortCountry=='MQ')return 'Martinique';
	if(shortCountry=='MR')return 'Mauritania';
	if(shortCountry=='MS')return 'Montserrat';
	if(shortCountry=='MT')return 'Malta';
	if(shortCountry=='MU')return 'Mauritius';
	if(shortCountry=='MV')return 'Maldives';
	if(shortCountry=='MW')return 'Malawi';
	if(shortCountry=='MX')return 'Mexico';
	if(shortCountry=='MY')return 'Malaysia';
	if(shortCountry=='MZ')return 'Mozambique';
	if(shortCountry=='NA')return 'Namibia';
	if(shortCountry=='NC')return 'New Caledonia';
	if(shortCountry=='NE')return 'Niger';
	if(shortCountry=='NF')return 'Norfolk Island';
	if(shortCountry=='NG')return 'Nigeria';
	if(shortCountry=='NI')return 'Nicaragua';
	if(shortCountry=='NL')return 'Netherlands';
	if(shortCountry=='NO')return 'Norway';
	if(shortCountry=='NP')return 'Nepal';
	if(shortCountry=='NR')return 'Nauru';
	if(shortCountry=='NT')return 'Neutral Zone';
	if(shortCountry=='NU')return 'Niue';
	if(shortCountry=='NZ')return 'New Zealand (Aotearoa)';
	if(shortCountry=='OM')return 'Oman';
	if(shortCountry=='PA')return 'Panama';
	if(shortCountry=='PE')return 'Peru';
	if(shortCountry=='PF')return 'French Polynesia';
	if(shortCountry=='PG')return 'Papua New Guinea';
	if(shortCountry=='PH')return 'Philippines';
	if(shortCountry=='PK')return 'Pakistan';
	if(shortCountry=='PL')return 'Poland';
	if(shortCountry=='PM')return 'St. Pierre and Miquelon';
	if(shortCountry=='PN')return 'Pitcairn';
	if(shortCountry=='PR')return 'Puerto Rico';
	if(shortCountry=='PS')return 'Palestinian Territory, Occupied';
	if(shortCountry=='PT')return 'Portugal';
	if(shortCountry=='PW')return 'Palau';
	if(shortCountry=='PY')return 'Paraguay';
	if(shortCountry=='QA')return 'Qatar';
	if(shortCountry=='RE')return 'Reunion';
	if(shortCountry=='RO')return 'Romania';
	if(shortCountry=='RS')return 'Serbia';
	if(shortCountry=='RU')return 'Russian Federation';
	if(shortCountry=='RW')return 'Rwanda';
	if(shortCountry=='SA')return 'Saudi Arabia';
	if(shortCountry=='SB')return 'Solomon Islands';
	if(shortCountry=='SC')return 'Seychelles';
	if(shortCountry=='SD')return 'Sudan';
	if(shortCountry=='SE')return 'Sweden';
	if(shortCountry=='SG')return 'Singapore';
	if(shortCountry=='SH')return 'St. Helena';
	if(shortCountry=='SI')return 'Slovenia';
	if(shortCountry=='SJ')return 'Svalbard & Jan Mayen Islands';
	if(shortCountry=='SK')return 'Slovak Republic';
	if(shortCountry=='SL')return 'Sierra Leone';
	if(shortCountry=='SM')return 'San Marino';
	if(shortCountry=='SN')return 'Senegal';
	if(shortCountry=='SO')return 'Somalia';
	if(shortCountry=='SR')return 'Suriname';
	if(shortCountry=='ST')return 'Sao Tome and Principe';
	if(shortCountry=='SU')return 'USSR (former)';
	if(shortCountry=='SV')return 'El Salvador';
	if(shortCountry=='SY')return 'Syria';
	if(shortCountry=='SZ')return 'Swaziland';
	if(shortCountry=='TC')return 'Turks and Caicos Islands';
	if(shortCountry=='TD')return 'Chad';
	if(shortCountry=='TF')return 'French Southern Territories';
	if(shortCountry=='TG')return 'Togo';
	if(shortCountry=='TH')return 'Thailand';
	if(shortCountry=='TJ')return 'Tajikistan';
	if(shortCountry=='TK')return 'Tokelau';
	if(shortCountry=='TM')return 'Turkmenistan';
	if(shortCountry=='TN')return 'Tunisia';
	if(shortCountry=='TO')return 'Tonga';
	if(shortCountry=='TP')return 'East Timor';
	if(shortCountry=='TR')return 'Turkey';
	if(shortCountry=='TT')return 'Trinidad and Tobago';
	if(shortCountry=='TV')return 'Tuvalu';
	if(shortCountry=='TW')return 'Taiwan';
	if(shortCountry=='TZ')return 'Tanzania';
	if(shortCountry=='UA')return 'Ukraine';
	if(shortCountry=='UG')return 'Uganda';
	if(shortCountry=='UK')return 'United Kingdom';
	if(shortCountry=='UM')return 'US Minor Outlying Islands';
	if(shortCountry=='US')return 'United States';
	if(shortCountry=='UY')return 'Uruguay';
	if(shortCountry=='UZ')return 'Uzbekistan';
	if(shortCountry=='VA')return 'Vatican City State (Holy See)';
	if(shortCountry=='VC')return 'Saint Vincent & the Grenadines';
	if(shortCountry=='VE')return 'Venezuela';
	if(shortCountry=='VG')return 'British Virgin Islands';
	if(shortCountry=='VI')return 'Virgin Islands (U.S.)';
	if(shortCountry=='VN')return 'Viet Nam';
	if(shortCountry=='VU')return 'Vanuatu';
	if(shortCountry=='WF')return 'Wallis and Futuna Islands';
	if(shortCountry=='WS')return 'Samoa';
	if(shortCountry=='YE')return 'Yemen';
	if(shortCountry=='YT')return 'Mayotte';
	if(shortCountry=='YU')return 'Yugoslavia (former)';
	if(shortCountry=='ZA')return 'South Africa';
	if(shortCountry=='ZM')return 'Zambia';
	if(shortCountry=='ZR')return 'Zaire';
	if(shortCountry=='ZW')return 'Zimbabwe';
	return "?";
}		


//  CONTACT PAGE SCRIPTS

	    var arrayOne = new Array("Img1", "Img2", "Img3", "Img4", "Img5");
	    var arrayTwo = new Array("Img6", "Img7", "Img8", "Img9", "Img10", "Img11");
	    function swopcheckimage(id, array) {
	        if (document.getElementById(array[id]).getAttribute("src") == "images/unchecked.GIF") {
		        for(i=0;i<array.length;i++)
		        {
		            document.getElementById(array[i]).setAttribute("src", "images/unchecked.GIF");
		        }
		        document.getElementById(array[id]).setAttribute("src", "images/checked.GIF");
		    } else {
		        document.getElementById(array[id]).setAttribute("src", "images/unchecked.GIF");
			    if(array[0] == "Img1")
		        {
	                document.getElementById('<% =hfInterests.ClientID %>').setAttribute('value', "")
	            }
	            if(array[0] == "Img6")
	            {
	                document.getElementById('<% =hfFoundForm.ClientID %>').setAttribute('value', "")
	            }
		    }
        }
        var ValidateControlsRequired = new Array("<% =txtName.ClientID %>", "<% =txtCompany.ClientID %>", "<% =txtPhone.ClientID %>", "<% =txtEmail.ClientID %>", "<% =txtCountry.ClientID %>","<% =txtComments.ClientID %>");
        function ValidateRequired(JQObject)
        {
            var value = JQObject.val();
            if(value == null || value ==""){
                JQObject.css("backgroundColor","#FFAEAE");
            }
        }
        function Validate()
        {
            for(id in ValidateControlsRequired){
                var value = $('#'+ValidateControlsRequired[id]).val();
                var valtxt = $('#'+ValidateControlsRequired[id]).attr("title");
                if(value == null || value =="" || (valtxt!=null && value == valtxt)){
                    $('#'+ValidateControlsRequired[id]).focus();
                    return false;
                }
            }
        }
        
        $(document).ready(function(){
            for(id in ValidateControlsRequired){
                $('#'+ValidateControlsRequired[id]).focus(function(){
                    $(this).css("backgroundColor","#FFF");
                }).blur(function(){
                    ValidateRequired($(this));
                });
                presistTextBoxValue(ValidateControlsRequired[id], $('#'+ValidateControlsRequired[id]).attr("title"));
            }
        });