// apply inline-box only for mozilla
if( jQuery.browser.mozilla ) {
	// do when DOM is ready
	$( function() {
		// search form, hide it, search labels to modify, filter classes nocmx and error
		$( 'form.cmxform' ).hide().find( 'p>label:not(.nocmx):not(.error)' ).each( function() {
			var $this = $(this);
			var labelContent = $this.html();
			var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
			// create block element with width of label
			var labelSpan = $("<span>")
				.css("display", "block")
				.width(labelWidth)
				.html(labelContent);
			// change display to mozilla specific inline-box
			$this.css("display", "-moz-inline-box")
				// remove children
				.empty()
				// add span element
				.append(labelSpan);
		// show form again
		}).end().show();
	});
};

$(document).ready(function(){
		
		//Hide div w/id extra
	   $("#hclass").css("display","none");
		 $("#hvalue").css("display","none");
		 
		// Add onclick handler to checkbox 
	   $("#yesH").click(function(){
		
		// If checked
		if ($("#yesH").is(":checked"))
		{
			//show the hidden div
			$("#hclass").show("fast");
		}
		else
		{	   
			//otherwise, hide it 
			$("#hclass").hide("fast");
		}
	  });
	  // Add onclick handler to checkbox 
	   $("#noH").click(function(){
		
		// If checked
		if ($("#noH").is(":checked"))
		{
			//show the hidden div
			$("#hclass").hide("fast");
		}
		else
		{	   
			//otherwise, hide it 
			$("#hclass").show("fast");
		}
	  });
	  // Add onclick handler to checkbox 
	   $("#yesI").click(function(){
		
		// If checked
		if ($("#yesI").is(":checked"))
		{
			//show the hidden div
			$("#hvalue").show("fast");
		}
		else
		{	   
			//otherwise, hide it 
			$("#hvalue").hide("fast");
		}
	  });
	  // Add onclick handler to checkbox 
	   $("#noI").click(function(){
		
		// If checked
		if ($("#noI").is(":checked"))
		{
			//show the hidden div
			$("#hvalue").hide("fast");
		}
		else
		{	   
			//otherwise, hide it 
			$("#hvalue").show("fast");
		}
	  });
	
});

function lookup(CompanyLocation) {
    if(CompanyLocation.length == 0) {
		$('#SalesTeam').val('');
    } 
	else if(CompanyLocation.length > 1) {
        $.get("pc.asp?PC=1", {queryString: ""+CompanyLocation+""}, function(data){
		if(data.length >0) {
				$('#SalesTeam').val(data);
            }
	 });
    }
} 