 $(document).ready(function() {
   	$('#middleContent #contentArea ul').each(function() {
		if ($(this).parent('li').css('background-color') == 'rgb(237, 237, 237)' || $(this).parent('li').css('background-color') == '#ededed') {
			$(this).children('li:even').css('background-color','#FFFFFF');
			$(this).children('li:odd').css('background-color','#ededed');
		}
		else {
			$(this).children('li:even').css('background-color','#ededed');
			$(this).children('li:odd').css('background-color','#FFFFFF');
		}
	});
	
	$('#topNav>ul>li>a:not([href])').addClass('noLink');
	
	$('#middleContent #contentArea ul ul').each(function() {
		$(this).parent('li').css({'padding-bottom': 0, 'margin-bottom' : '10px'});
	});
	if ($.browser.msie) {
  		$('#topNav>ul>li').hover(function () {
			$(this).addClass('jqhover');
			$(this).children('ul').css('display','block');	
		}, function() {
			$(this).removeClass('jqhover');
			$(this).children('ul').css('display','none');
		});
	}
	
	$('.checkclear').focus(function() {
		$(this).val("");
	});
	  

});

window.onload = NewBrokerApplicationShowOther;
function NewBrokerApplicationShowOther() {

    ctl = document.getElementById("ctl00_ContentPlaceHolder1_ddlReference");
    if (ctl != null) {
        if (ctl.value == 'Other') {
            document.getElementById("trReference_other").style.display = 'Block';
        }
        else {
            document.getElementById("trReference_other").style.display = 'none';
        }
    }
}

function NewBrokerApplicationCheckPercentage() {

    ctl1 = document.getElementById("ctl00_ContentPlaceHolder1_split_personal");
    ctl2 = document.getElementById("ctl00_ContentPlaceHolder1_split_commercial");
    if (ctl1 != null && ctl2 != null) {
        if (ctl1.value != "" && ctl2.value != "") {
            var p1 = new Number(parseFloat(ctl1.value));
            var p2 = new Number(parseFloat(ctl2.value));
            if (p1 + p2 != 100) {
                document.getElementById("ctl00_ContentPlaceHolder1_percentageError").style.display = 'Block';
            }
            else {
                document.getElementById("ctl00_ContentPlaceHolder1_percentageError").style.display = 'none';
            }
        }
    }
}

function popUpLogin(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=100%,height=100%,left = 000,top = 000');");
}

