				// for Micro
				function usdOnly() {	
					$('select#ctl00_plc1_realregForm_trading_ddlCurrency option:contains("USD")').attr('selected', 'yes');
					$('.ForSelectUSDonly').css({"display":"none"});
					$('.ForSelectUSDonlyDisable, .acceptMicro').css({"display":"block"});
					$('#ctl00_plc1_realregForm_rbAccountIslamic').removeAttr('checked');
					$('.acceptIslamic').css({'display':'none'})
					$('#ctl00_plc1_realregForm_rbAccountIslamic').attr('disabled', 'disabled');
				};	
				function usdOnlyDisabled() {	
					$('select#ctl00_plc1_realregForm_trading_ddlCurrency option:contains("USD")').removeAttr('selected');
					$('.ForSelectUSDonlyDisable, .acceptMicro').css({"display":"none"});
					$('.ForSelectUSDonly').css({"display":"block"});
					$('#ctl00_plc1_realregForm_rbAccountIslamic').removeAttr('disabled');
				};
				
				// select islamic account				
				function islamicAccount() {		
					if (($('.acceptIslamic').css('display')) == 'none') {
						$('.acceptIslamic').css({'display':'block'})
					}
					else {
						$('.acceptIslamic').css({'display':'none'})
					}
                };
				
				// for pretty input.file				
				function AddValue(some) {	
					$('div.fileinputs' + some + ' div.fileField').empty();
					$('div.fileinputs' + some + ' div.fileField').append($('div.fileinputs' + some + ' input').val().slice('0','17'));
				};	

				/* If I see orange bubble 1 - hide bubble 2 and selects */				
				function orangeBubble1() { 
					$('#orangeBubble1').css('display','block');
					$('#orangeBubble2').css('display','none');
					return false;	
				 }
				
				function orangeBubble1Close() { 
					$('#orangeBubble1').css('display','none');
					if ($.browser.msie && $.browser.version == 6) {
						$('.NoSeeIfOrange1').css('visibility','visible');	
					}					
					return false;	
				 }
 
				function orangeBubble2() { 
					$('#orangeBubble2').css('display','block');
					$('#orangeBubble1').css('display','none');
					if ($.browser.msie && $.browser.version == 6) {
						$('.NoSeeIfOrange2, .NoSeeIfOrange1').css('visibility','hidden');		
					}	
					return false;	
				 }
				 
				function orangeBubble3() { 
					$('#orangeBubble3').css('display','block');
					if ($.browser.msie && $.browser.version == 6) {
						$('.NoSeeIfOrange3').css('visibility','hidden');		
					}	
					return false;	
				 }
				 
				function orangeBubble2Close() { 
					$('#orangeBubble2').css('display','none');
					if ($.browser.msie && $.browser.version == 6) {
						$('.NoSeeIfOrange2, .NoSeeIfOrange1').css('visibility','visible');		
					}	
					return false;	
				 }
				 
				function orangeBubble3Close() { 
					$('#orangeBubble3').css('display','none');
					if ($.browser.msie && $.browser.version == 6) {
						$('.NoSeeIfOrange3').css('visibility','visible');		
					}	
					return false;	
				 }

				 $(document).ready(function () {

				     // if Micro	
				     if ($("#ctl00_plc1_realregForm_rbAccountMicro").is(":checked")) {
				         $('.ForSelectUSDonlyDisable').css({ "display": "block" });
				     }

				     $("input[name$='AccountType']").change(function () {
                        if(this.value == 'rbAccountZeroSpread'){
                            $('.acceptZeroSpread').css({ 'display': '' });
                        } else {
                            $('.acceptZeroSpread').css({ 'display': 'none' });
                        }
                    });

                    $("input[name$='AccountType']").change(function () {
                        if (this.value == 'rbAccountSTPCheckBox') {
                            $('.acceptSTP').css({ 'display': '' });
                        } else {
                            $('.acceptSTP').css({ 'display': 'none' });
                        }
                    });

				     // Live Form fiels reactions				  
				     $("#liveForm input").focusin(
				  function () {
				      $(this).addClass("selected");
				      $('span.realAccFieldCommentTEST').css({ "display": "none" });
				      //$('#' + $(this).parent().attr('id') + ' span.realAccFieldCommentTEST').css({"display":"block"});	
				      $(this).parent().find('.realAccFieldCommentTEST').css("display", "block");
				  });

				     $("#liveForm input").focusout(
				  function () {
				      $(this).removeClass("selected");
				      $('span.realAccFieldCommentTEST').css({ "display": "none" });
				  });

				     $("#liveForm select").focusin(
				  function () {
				      $(this).addClass("selected");
				  });

				     $("#liveForm input").focusout(
				  function () {
				      $(this).removeClass("selected");
				  });




				     // FORM send form
				     $('.submit input').click(function () {

				         if ('#FormErrors') {
				             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') }
				         }

				         if ('#FileErrors') {
				             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') }
				         }

				         if ('#TradingErrors') {
				             var areAllHiddenT = true;
				             $('#TradingErrors table.redBubble td.center span').each(function () {
				                 if ($(this).css('display') != 'none') {
				                     areAllHiddenT = false;
				                     return false;
				                 }
				             });
				             if (areAllHiddenT) { $('#TradingErrors table.redBubble').css('display', 'none') }
				             else { $('#TradingErrors table.redBubble').css('display', 'block') }
				         }

				         if ('#ContactErrors') {
				             var areAllHiddenC = true;
				             $('#ContactErrors table.redBubble td.center span').each(function () {
				                 if ($(this).css('display') != 'none') {
				                     areAllHiddenC = false;
				                     return false;
				                 }
				             });
				             if (areAllHiddenC) { $('#ContactErrors table.redBubble').css('display', 'none') }
				             else { $('#ContactErrors table.redBubble').css('display', 'block') }
				         }

				         if ('#PersonalErrors') {
				             var areAllHiddenP = true;
				             $('#PersonalErrors table.redBubble td.center span').each(function () {
				                 if ($(this).css('display') != 'none') {
				                     areAllHiddenP = false;
				                     return false;
				                 }
				             });
				             if (areAllHiddenP) { $('#PersonalErrors table.redBubble').css('display', 'none') }
				             else { $('#PersonalErrors table.redBubble').css('display', 'block') }
				         }

				         if ('#AddressErrors') {
				             var areAllHiddenA = true;
				             $('#AddressErrors table.redBubble td.center span').each(function () {
				                 if ($(this).css('display') != 'none') {
				                     areAllHiddenA = false;
				                     return false;
				                 }
				             });
				             if (areAllHiddenA) { $('#AddressErrors table.redBubble').css('display', 'none') }
				             else { $('#AddressErrors table.redBubble').css('display', 'block') }
				         }

				         if (!areAllHiddenC || !areAllHiddenA || !areAllHiddenP)
				         { $('html, body').animate({ scrollTop: 480 }, 'slow') }
				         else if (!areAllHiddenT || !areAllHiddenF)
				         { $('html, body').animate({ scrollTop: 930 }, 'slow') }
				         //else (!areAllHiddenFF) 
				         //{$('html, body').animate({scrollTop:1650}, 'slow')};


				     });



				 });
