$(document).ready(function(){ 
$("#active").parent().parent().attr('style','display:block;visibility:visible;left:0;z-index:99;');

if($("#active").parent().hasClass("nav_parent")) { // has className of nav_parent
$("#active").parent().addClass("focus");
$("#active").parent().attr('style','background:url(template/nav_active_left.gif) no-repeat top left');

} else { // doesn't have className of nav_parent 3 times
$("#active").parent().parent().parent().addClass("focus");
$("#active").parent().parent().parent().attr('style','background:url(template/nav_active_left.gif) no-repeat top left');

}
}); 

function changePic(divName) {

	var arguments = changePic.arguments;
	var special = 0;

	for (var i=1;i<arguments.length;i++) {
		
		if(pagenumber==arguments[i]) {
			
			//document.getElementById(divName).style.backgroundImage="url(template/top_pic_fast.gif)";
			//$("#top_pic img").attr("src","template/top_pic_fast.gif");
$("#bannerText1").hide();
$("#bannerText2").show();
			$("#right_col").load("html30.htm", {}, function() {
			$("#patientCommentsFade").load("html23.htm", {}, function() {
			$("#patientCommentsFade").superCycle({length:8000});
			});
			$("#leadingCommentsFade").load("html38.htm", {}, function() {
			$("#leadingCommentsFade").superCycle({length:8000}); 
			});
			});
			return;
			
		} else if(pagenumber==16 || pagenumber==13 || pagenumber==12) {
			
			//document.getElementById(divName).style.backgroundImage="url(template/top_pic.gif)";
			return;
		
		} else if(special==0) {
			
			//document.getElementById(divName).style.backgroundImage="url(template/top_pic.gif)";
			$("#right_col").load("html29.htm?c=1", {}, function() {
			$("#patientCommentsFade").load("html23.htm", {}, function() {
			$("#patientCommentsFade").superCycle({length:8000});
			});
			$("#leadingCommentsFade").load("html38.htm", {}, function() {
			$("#leadingCommentsFade").superCycle({length:8000}); 
			});
			});
			special=1;
			
		} else {
			
		}
	
	}
}

function ultra(divName) {
	var arguments = ultra.arguments;	
	for (var i=1;i<arguments.length;i++) {
	if(pagenumber==arguments[i]) {
		$("#top_pic img").attr("src","template/top_picultra.jpg");
		$("#bannerText1").hide();
		$("#bannerText2").hide();
		$("#bannerText3").show();
		
		
	}
}
}

function changePic2(divName) {
var arguments = changePic2.arguments;

for (var i=1;i<arguments.length;i++) {
if(pagenumber==arguments[i]) {
$("#right_col").load("html28.htm");
return;
} else if(pagenumber==16 || pagenumber==13 || pagenumber==12) {
return;
} else {
$("#right_col").load("html29.htm?c=2", {}, function() {
$("#patientCommentsFade").load("html23.htm", {}, function() {
$("#patientCommentsFade").superCycle({length:8000});
});
$("#leadingCommentsFade").load("html38.htm", {}, function() {
$("#leadingCommentsFade").superCycle({length:8000}); 
});
});


}
}
}

function changeAdv(htmlNum,pageNum) {
if(pagenumber==pageNum) {
$("#right_col").load("html"+htmlNum+".htm", {}, function() {
$("#patientCommentsFade").load("html23.htm", {}, function() {
$("#patientCommentsFade").superCycle({length:8000}); 
});
$("#leadingCommentsFade").load("html38.htm", {}, function() {
$("#leadingCommentsFade").superCycle({length:8000}); 
});
});



return;
}
}

$(document).ready(function() {
  //for table row
  $("#patient_comments p:even").attr("style","background:#f6f6f6;padding:14px;");


function makeSublist(parent,child,isSubselectOptional,childVal)
{
	$("body").append("<select style='display:none' id='"+parent+child+"'></select>");
	$('#'+parent+child).html($("#"+child+" option"));
	
		var parentValue = $('#'+parent).attr('value');
		parentValue = parentValue.replace(/ /g,"");
		parentValue = parentValue.toLowerCase();
		$('#'+child).html($("#"+parent+child+" .sub_"+parentValue).clone());
	
	childVal = (typeof childVal == "undefined")? "" : childVal ;
	$("#"+child).val(["'+ childVal +'"]).attr('selected','selected'); 
	
	$('#'+parent).change( 
		function()
		{
			var parentValue = $('#'+parent).attr('value');
			parentValue = parentValue.replace(/ /g,"");
			parentValue = parentValue.toLowerCase();
			$('#'+child).html($("#"+parent+child+" .sub_"+parentValue).clone());
			//$('#'+child).prepend("<option value='' selected=selected>Please Select</option>");
			$('#'+child).trigger("change");
        $('#'+child).focus();
		}
	);
}

		makeSublist('parent','child', false, '1');	


$("#00N20000001u0l6").change( function() {
 
    if($(this).val()=="Insured") {
      $("#insured_show").show();
    } else {
      $("#insured_show").hide();
    }
 
});

if($("#00N20000001u0l6").val()=="Insured") {
      $("#insured_show").show();
    } else {
      $("#insured_show").hide();
    }

$("#00N20000001u0iR").change( function() {
 
    if($(this).val()=="Yes") {
      $("#another_clinician1, #another_clinician2").show();
    } else {
      $("#another_clinician1, #another_clinician2").hide();
    }
 
});

if($("#00N20000001u0iR").val()=="Yes") {
      $("#another_clinician1, #another_clinician2").show();
    } else {
      $("#another_clinician1, #another_clinician2").hide();
    }

  //for table row
  $("#patient_comments p:even").attr("style","background:#f6f6f6;padding:14px;");
});
