			
			// Get phone code by country			
			var MyCodes = [,93,358,355,213,376,244,809,672,268,54,374,297,61,43,994,242,973,880,246,375,32,501,229,809,975,591,387,267,999,55,246,673,359,226,257,855,237,1,238,345,236,235,56,86,238,236,57,269,242,243,682,506,225,385,53,357,420,45,253,767,809,593,20,503,240,291,372,251,500,298,679,358,33,594,689,33,241,220,995,49,233,350,30,299,473,590,671,502,441481,224,245,592,509,999,504,852,36,354,91,62,98,964,353,44,972,39,876,81,44153,962,7,254,686,850,82,965,996,856,371,961,266,231,218,423,370,352,853,389,261,265,60,960,223,356,692,596,222,230,269,52,691,373,33,976,473,1664,212,258,95,264,674,977,31,599,687,64,505,227,234,683,672,47,968,92,680,970,507,675,595,51,63,64,48,351,1787,974,262,40,7,250,590,290,869,1758,590,508,1784,685,378,239,966,221,381,248,232,65,421,386,677,252,27,500,34,94,249,597,47,268,46,41,963,886,7,255,66,670,228,690,676,1868,216,90,993,1649,688,256,380,971,44,598,7,678,39,58,84,1340,1340,681,212,967,260,263];
						function getPhoneCode() {	 		
				
				var MyCode = MyCodes[$('#ctl00_plc1_ddlCountries').attr("selectedIndex")];	 					//alert (MyCode);					if (MyCode != null) {					
					$('#ctl00_plc1_tbPhonePrefix').attr('value', MyCode)
				}
				else {
					$('#ctl00_plc1_tbPhonePrefix').attr('value', '')
				};							};	
			
			function getPhoneCodeLive() {	 		
				
				var MyLiveCode = MyCodes[$('#ctl00_plc1_realregForm_address_ddlCountryAddress').attr("selectedIndex")];		
				//alert (MyCode);	
				if (MyLiveCode != null) {					
					$('#ctl00_plc1_realregForm_contact_tbPhonePrefix').attr('value', MyLiveCode)
				}
				else {
					$('#ctl00_plc1_realregForm_contact_tbPhonePrefix').attr('value', ' ')
				};				
			};	
			
			function getPhoneCodeAff() {	 		
				
				var MyLiveCode = MyCodes[$('#ctl00_plc1_editorMain_AffiliateRegistration1_ddlCountry').attr("selectedIndex")];		
				//alert (MyCode);	
				if (MyLiveCode != null) {					
					$('#ctl00_plc1_editorMain_AffiliateRegistration1_tbPhonePrefix').attr('value', MyLiveCode)
				}
				else {
					$('#ctl00_plc1_editorMain_AffiliateRegistration1_tbPhonePrefix').attr('value', ' ')
				};				
			};	
			
			// FORM change field
			function hideOneBlock(blockName) {	 
				var areAllHidden1 = true;
				$('#' + blockName + 'Errors table.redBubble td.center span').each( function() {					
					if($(this).css('display') != 'none')
						{areAllHidden1 = false;
						 return false;}  
				});
				if( areAllHidden1) 
					{$('#' + blockName + 'Errors table.redBubble').css('display','none')}
				else
					{$('#' + blockName + 'Errors table.redBubble').css('display','block')}
			};	
			
			
$(document).ready(function(){

		// For Terms part
		var areAllHiddenFF = true;
			$('#FormErrors table.redBubble td.center span').each( function() {					
				if($(this).css('display') != 'none')
					{ areAllHiddenFF = false;
						return false;}      
			});	
		if (areAllHiddenFF) {$('#FormErrors table.redBubble').css('display','none')}
		else {$('#FormErrors table.redBubble').css('display','block')}  	

		// For Files part	
		var areAllHiddenF = true;
			$('#FileErrors table.redBubble td.center span').each( function() {					
				if($(this).css('display') != 'none')
					{ areAllHiddenF = false;
						return false;}      
			});	
		if (areAllHiddenF) {$('#FileErrors table.redBubble').css('display','none')}
		else {$('#FileErrors table.redBubble').css('display','block'); $('html, body').animate({scrollTop:930}, 'slow')}  

			
	// FORM change field
	$('.DemoForm input, .DemoForm select, .fastReg input, .fastReg select').change ( function () {	
		var areAllHidden = true;
		$('table.redBubble td.center span').each( function() {
			
			if($(this).css('display') != 'none')
				{areAllHidden = false;
				 return false;}  
		});
		if( areAllHidden) 
			{$('table.redBubble').css('display','none')}
		else
			{$('table.redBubble').css('display','block')}
		});	
		
		
	// FORM send form
	$('.submitButton input, .FastSubmitButton input, .FastSubmit input').click ( function () {	
		var areAllHidden = true;
			$('table.redBubble td.center span').each( function() {					
				if($(this).css('display') != 'none')
					{ areAllHidden = false;
						return false;}      
			});	

		if( areAllHidden) 
			{$('table.redBubble').css('display','none')}
		else
			{$('table.redBubble').css('display','block')}  
		});
		
		

});	
			
			
