// JavaScript Document




 function submit_form(){
 	if(typeof(validateCaptchaAndSubmit)!='undefined'){
 		validateCaptchaAndSubmit();
 	}else{
 		check_webtolead_fields();
 	}
 }
 
 
 
 function submit_form2(){
 	if(typeof(validateCaptchaAndSubmit)!='undefined'){
 		validateCaptchaAndSubmit();
 	}else{
 		check_webtolead_fields2();
 	}
 }
 
  function submit_form3(){
 	if(typeof(validateCaptchaAndSubmit)!='undefined'){
 		validateCaptchaAndSubmit();
 	}else{
 		check_webtolead_fields3();
 	}
 }
 
 
  function submit_form4(){
 	if(typeof(validateCaptchaAndSubmit)!='undefined'){
 		validateCaptchaAndSubmit();
 	}else{
 		check_webtolead_fields4();
 	}
 }
 
 
 
 function check_webtolead_fields(){
     if(document.getElementById('bool_id') != null){
        var reqs=document.getElementById('bool_id').value;
        bools = reqs.substring(0,reqs.lastIndexOf(';'));
        var bool_fields = new Array();
        var bool_fields = bools.split(';');
        nbr_fields = bool_fields.length;
        for(var i=0;i<nbr_fields;i++){
          if(document.getElementById(bool_fields[i]).value == 'on'){
             document.getElementById(bool_fields[i]).value = 1;
          }
          else{
             document.getElementById(bool_fields[i]).value = 0;
          }
        }
      }
    if(document.getElementById('req_id') != null){
        var reqs=document.getElementById('req_id').value;
        reqs = reqs.substring(0,reqs.lastIndexOf(';'));
        var req_fields = new Array();
        var req_fields = reqs.split(';');
        nbr_fields = req_fields.length;
        var req = true;
        for(var i=0;i<nbr_fields;i++){
          if(document.getElementById(req_fields[i]).value.length <=0 || document.getElementById(req_fields[i]).value==0){
           req = false;
           break;
          }
        }
        if(req){
        validateEmailAdd()
            
        }
        else{
          //alert('Please provide all the required fields');
          $("#requiredfields p").remove();
               $("#requiredfields").append("<p>Please provide all the required fields</p>");
          return false;
         }
        return false
   }
   else{
    document.WebToLeadForm.submit();
   }
}

function check_webtolead_fields2(){
     if(document.getElementById('bool_id') != null){
        var reqs=document.getElementById('bool_id').value;
        bools = reqs.substring(0,reqs.lastIndexOf(';'));
        var bool_fields = new Array();
        var bool_fields = bools.split(';');
        nbr_fields = bool_fields.length;
        for(var i=0;i<nbr_fields;i++){
          if(document.getElementById(bool_fields[i]).value == 'on'){
             document.getElementById(bool_fields[i]).value = 1;
          }
          else{
             document.getElementById(bool_fields[i]).value = 0;
          }
        }
      }
    if(document.getElementById('req_id') != null){
        var reqs=document.getElementById('req_id').value;
        reqs = reqs.substring(0,reqs.lastIndexOf(';'));
        var req_fields = new Array();
        var req_fields = reqs.split(';');
        nbr_fields = req_fields.length;
        var req = true;
        for(var i=0;i<nbr_fields;i++){
          if(document.getElementById(req_fields[i]).value.length <=0 || document.getElementById(req_fields[i]).value==0){
           req = false;
           break;
          }
        }
        if(req){
        validateEmailAdd()
            
        }
        else{
          //alert('Please provide all the required fields');
          $("#requiredfields2 p").remove();
               $("#requiredfields2").append("<p>Please provide all the required fields</p>");
          return false;
         }
        return false
   }
   else{
    document.WebToLeadForm.submit();
   }
}




function check_webtolead_fields3(){
     if(document.getElementById('bool_id') != null){
        var reqs=document.getElementById('bool_id').value;
        bools = reqs.substring(0,reqs.lastIndexOf(';'));
        var bool_fields = new Array();
        var bool_fields = bools.split(';');
        nbr_fields = bool_fields.length;
        for(var i=0;i<nbr_fields;i++){
          if(document.getElementById(bool_fields[i]).value == 'on'){
             document.getElementById(bool_fields[i]).value = 1;
          }
          else{
             document.getElementById(bool_fields[i]).value = 0;
          }
        }
      }
    if(document.getElementById('req_id') != null){
        var reqs=document.getElementById('req_id').value;
        reqs = reqs.substring(0,reqs.lastIndexOf(';'));
        var req_fields = new Array();
        var req_fields = reqs.split(';');
        nbr_fields = req_fields.length;
        var req = true;
        for(var i=0;i<nbr_fields;i++){
          if(document.getElementById(req_fields[i]).value.length <=0 || document.getElementById(req_fields[i]).value==0){
           req = false;
           break;
          }
        }
        if(req){
        validateEmailAdd3()
            
        }
        else{
          //alert('Please provide all the required fields');
          $("#requiredfields2 p").remove();
               $("#requiredfields2").append("<p>Please provide all the required fields</p>");
          return false;
         }
        return false
   }
   else{
   var text=direct.value+" - "+message.value;
	
	description.value=text;
	
    document.WebToLeadForm.submit();
   }
}



function check_webtolead_fields4(){
     if(document.getElementById('bool_id') != null){
        var reqs=document.getElementById('bool_id').value;
        bools = reqs.substring(0,reqs.lastIndexOf(';'));
        var bool_fields = new Array();
        var bool_fields = bools.split(';');
        nbr_fields = bool_fields.length;
        for(var i=0;i<nbr_fields;i++){
          if(document.getElementById(bool_fields[i]).value == 'on'){
             document.getElementById(bool_fields[i]).value = 1;
          }
          else{
             document.getElementById(bool_fields[i]).value = 0;
          }
        }
      }
    if(document.getElementById('req_id') != null){
        var reqs=document.getElementById('req_id').value;
        reqs = reqs.substring(0,reqs.lastIndexOf(';'));
        var req_fields = new Array();
        var req_fields = reqs.split(';');
        nbr_fields = req_fields.length;
        var req = true;
        for(var i=0;i<nbr_fields;i++){
          if(document.getElementById(req_fields[i]).value.length <=0 || document.getElementById(req_fields[i]).value==0){
           req = false;
           break;
          }
        }
        if(req){
        validateEmailAdd4()
            
        }
        else{
          //alert('Please provide all the required fields');
          $("#requiredfields2 p").remove();
               $("#requiredfields2").append("<p>Please provide all the required fields</p>");
          return false;
         }
        return false
   }
   else{
      var thetext="Number of Physicians: "+number.value;
	
	description.value=thetext;
	
    document.WebToLeadForm.submit();
   }
}


function validateEmailAdd(){
	if(document.getElementById('webtolead_email1').value.length >0) {
		if(document.getElementById('webtolead_email1').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/) == null){
		 // alert('Not a valid email address');
		 $("#requiredfields p").remove();
		  $("#requiredfields").append("<p>Not a valid email address</p>");
		     return false;
		} else {
		   
		document.WebToLeadForm.submit();
            return true;
		}
	}
	if(document.getElementById('webtolead_email2').value.length >0) {
		if(document.getElementById('webtolead_email2').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/) == null){
		//  alert('Not a valid email address');
		$("#requiredfields p").remove();
		  $("#requiredfields").append("<p>Not a valid email address</p>");
		  return false;
		     
		} else {
		  
		document.WebToLeadForm.submit();
            return true;
		}
	}
}





function validateEmailAdd3(){
	if(document.getElementById('webtolead_email1').value.length >0) {
		if(document.getElementById('webtolead_email1').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/) == null){
		 // alert('Not a valid email address');
		 $("#requiredfields2 p").remove();
		  $("#requiredfields2").append("<p>Not a valid email address</p>");
		     return false;
		} else {
		 var thedirect = $("#direct").val(); 
		var themessage = $("#message").val(); 
		      var text=thedirect+" - "+themessage;
	$('#description').val(text); 
	
		document.WebToLeadForm.submit();
            return true;
		}
	}
	if(document.getElementById('webtolead_email2').value.length >0) {
		if(document.getElementById('webtolead_email2').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/) == null){
		//  alert('Not a valid email address');
		$("#requiredfields2 p").remove();
		  $("#requiredfields2").append("<p>Not a valid email address</p>");
		  return false;
		     
		} else {
		  
		var thedirect = $("#direct").val(); 
		var themessage = $("#message").val(); 
		      var text=thedirect+" - "+themessage;
	$('#description').val(text); 
	
	
		document.WebToLeadForm.submit();
            return true;
		}
	}
}


function validateEmailAdd4(){
	if(document.getElementById('webtolead_email1').value.length >0) {
		if(document.getElementById('webtolead_email1').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/) == null){
		 // alert('Not a valid email address');
		 $("#requiredfields2 p").remove();
		  $("#requiredfields2").append("<p>Not a valid email address</p>");
		     return false;
		} else {
		var thenumber = $("#number").val(); 
		     var thetext=thenumber+"- Number of Physicians";
	$('#description').val(thetext); 
	
		document.WebToLeadForm.submit();
            return true;
		}
	}
	if(document.getElementById('webtolead_email2').value.length >0) {
		if(document.getElementById('webtolead_email2').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/) == null){
		//  alert('Not a valid email address');
		$("#requiredfields2 p").remove();
		  $("#requiredfields2").append("<p>Not a valid email address</p>");
		  return false;
		     
		} else {
			var thenumber = $("#number").val(); 
		       var thetext=thenumber+"- Number of Physicians";
	
$('#description').val(thetext); 
		document.WebToLeadForm.submit();
            return true;
		}
	}
}





function animeRollOver(srcEl){
	//alert(srcEl.tagName);
	var srcEl=srcEl.getElementsByTagName('img')[0];
	rollOverAnime=new Animator({transition: Animator.makeEaseOut(2),duration: 400});
	rollOverAnime.addSubject(new NumericalStyleSubject(srcEl, 'opacity', 0, 1));
	rollOver();
}
function rollOver(){
	rollOverAnime.seekTo(1);
}
function rollOut(){
	rollOverAnime.seekTo(0);
}



function changefieldbg(theelement){
	$("#field1").removeClass('currentli');
		$("#field2").removeClass('currentli');
			$("#field3").removeClass('currentli');
				$("#field4").removeClass('currentli');
					$("#field5").removeClass('currentli');
						$("#field6").removeClass('currentli');
	$("#"+theelement).addClass('currentli');
	}
	
	
	function closethedemo(){
	$("#fade").fadeOut(1200);
	 	 $("#light").fadeOut(200);

	
	}
  
  
  
  $(function()
{
	$('.textfielddemosmall').datePicker();
});
  


$(function() {
	       
    $('#apo , #centry, #pm,  #rc , #ecs , #pp , #cm , #rbi , #eps , #ths , #rcam , #opfa , #ecce , #rp , #arm , #cf , #dm').tooltip({
		track: true,
	delay: 0,
	showURL: false,
	showBody: " - ",
	extraClass: "pretty",
	fixPNG: true,
	left: -120,
	fade: 250
});



  

		   var stack = [];
 
    // preload images into an array
    for (var i = 3; i < 3; i++) {
        var img = new Image(991,378);
        img.src = '/graphs/Hero-Banners_0' + i + '.jpg';
      $(img).bind('load', function() { 
            stack.push(this); 
        }); 
    }  
						   
    $('.slideshow').cycle({
		fx: 'fade',
		
		 speed: 600,
      pause: 1,
      timeout: 8000,
      delay: 100,
	   pager:  '#nav',
       before:  onBefore,
      prev: '#slider_next',
      next: '#slider_prev'
	});
	
	 // add images to slideshow
   function onBefore(curr, next, opts) {
   $("#heroimage2").removeClass("hidden");
    $("#heroimage3").removeClass("hidden");
      if (opts.addSlide) // <-- important!
            while(stack.length) 
                opts.addSlide(stack.pop());  
    };

		

	
	
			
					     var stack2 = [];
 
    // preload images into an array
    for (var i = 4; i < 3; i++) {
        var img2 = new Image(990,350);
        img2.src = '/graphs/6-Trillion-Dollar-Industry-' + i + '.jpg';
        stack2.push(img2);
    }
						   
    $('.slideshow_technology').cycle({
		fx: 'fade', 
		 speed: 600,
      pause: 1,
      timeout: 8000,
      delay: 100,
	   pager:  '#nav_technology',
          before:  onBefore_technology,
      prev: '#slider_next',
      next: '#slider_prev'
	});
	
	 // add images to slideshow
    function onBefore_technology(curr, next, opts) {
       $("#heroimage2").removeClass("hidden");
    $("#heroimage3").removeClass("hidden");
        $("#heroimage4").removeClass("hidden");
    $("#heroimage5").removeClass("hidden");
        $("#heroimage6").removeClass("hidden");

        if (opts.addSlide) // <-- important!
            while(stack2.length)
                opts.addSlide(stac2.shift()); 
    };
	

	
	  $('#freedemo').click(function() {
	  $("#light", window.parent.document).css("top", "2%");
	 $("#fade").fadeIn(200);
	 	 $("#light").fadeIn(1000);
	 	  var windowheight11= $(document).height();
	 	  	 $("#fade").height(windowheight11);

	});
	
	
	  $('#fade').click(function() {
	 $("#fade").fadeOut(1200);
	 	 $("#light").hide();
	

	});
	
		  $('#close_this_tab').click(function() {
	$("#light", window.parent.document).css("top", "0px");
	 $("#fade", window.parent.document ).fadeOut(300);
	 	 $("#light", window.parent.document).hide();
	 	
	

	});
	
	
	
	  $('#centralnav').mouseover(function() {
	 $("#centralnav").fadeOut(500);
	
	 	 
	});
	
});


 
   function doSomething() {
   var windowheight3= $(window).height();
		 if  (windowheight3 > 1000){
   var windowheight4= (($(window).height()) - (69));
  
   $("#newfooter").fadeIn();
$("#newfooter").css("top", windowheight4);
$("#fade").height(windowheight3);
 
   
} else {

$("#newfooter").fadeIn();
$("#newfooter").css("top", "1000px");

  
}

};
 var resizeTimer = null;


$(document).ready(function(){



$("#demoSubmit").mouseover(function () {
	$(this).css('cursor', 'pointer');
});


		$(window).bind('resize', function () {
		  if (resizeTimer) clearTimeout(resizeTimer);
		  $("#newfooter").fadeOut(50);
    resizeTimer = setTimeout(doSomething, 300);
		});
 //alert ($(window).height()) 
 
 
 


 var windowheight= $(window).height();
if (windowheight > 1000){
   var windowheight2= (($(window).height()) - (69));
   $("#newfooter").fadeIn(300);
$("#newfooter").css("top", windowheight2);
} else {
   $("#newfooter").fadeIn(300);
$("#newfooter").css("top", "1000px");
}

var currentpage= jQuery.url.segment(0);
if (currentpage=="solutions"){
  $("#solutionsnavimg").attr("src","/images/nav/solnavdown.png");

} else {
  $("#solutionsnavimg").attr("src","/images/nav/solnav.png");

}

if ((currentpage=="schedule-your-demo") || (currentpage==null)){


  $("#homenavimg").attr("src","/images/nav/homenavdown.png");

}  else {
  $("#homenavimg").attr("src","/images/nav/homenav.png");

}

if (currentpage=="schedule-your-demo") {
$("#fade").fadeIn(200);
	 	 $("#light").fadeIn(1000);
	 	  var windowheight11= $(window).height();
	 	  	 $("#fade").height(windowheight11);

 

}




if (currentpage=="technology"){
  $("#technavimg").attr("src","/images/nav/technavdown.png");

} else {
  $("#technavimg").attr("src","/images/nav/technav.png");

}



if (currentpage=="why-carecloud"){
  $("#whynavimg").attr("src","/images/nav/whynavdown.png");

} else {
  $("#whynavimg").attr("src","/images/nav/whynav.png");

}

if (currentpage=="careers"){
  $("#careernavimg").attr("src","/images/nav/careersnavdown.png");

} else {
  $("#careernavimg").attr("src","/images/nav/careersnav.png");

}


if (currentpage=="about-us" || currentpage=="leadership" || currentpage=="our-company" || currentpage=="news" || currentpage=="our-people" || currentpage=="contact-us" || currentpage=="signup" || currentpage=="our-company/albert-santalo" || currentpage=="board-of-directors" || currentpage=="contact")   {
  $("#aboutnavimg").attr("src","/images/nav/aboutnavdown.png");

} else {
  $("#aboutnavimg").attr("src","/images/nav/aboutnav.png");

}


$("#careernavimg").hover(function(){ 
  $(this).attr("src","/images/nav/careersnavover.png"); 
},function(){ 

 if (currentpage=="careers"){
  $("#careernavimg").attr("src","/images/nav/careersnavdown.png");

} else {
  $("#careernavimg").attr("src","/images/nav/careersnav.png");

}
});

$("#whynavimg").hover(function(){ 
  $(this).attr("src","/images/nav/whynavover.png"); 
},function(){ 

 
if (currentpage=="why-carecloud"){
  $("#whynavimg").attr("src","/images/nav/whynavdown.png");

} else {
  $("#whynavimg").attr("src","/images/nav/whynav.png");

}
});

$("#aboutnavimg").hover(function(){ 
  $(this).attr("src","/images/nav/aboutnavover.png"); 
},function(){ 

 if (currentpage=="about-us" || currentpage=="leadership" || currentpage=="our-company" || currentpage=="news" || currentpage=="our-people" || currentpage=="contact-us" ||  currentpage=="signup" || currentpage=="our-company/albert-santalo" ||  currentpage=="board-of-directors" || currentpage=="contact")   {
  $("#aboutnavimg").attr("src","/images/nav/aboutnavdown.png");

} else {
  $("#aboutnavimg").attr("src","/images/nav/aboutnav.png");

}
});


$("#solutionsnavimg").hover(function(){ 
  $(this).attr("src","/images/nav/solnavover.png"); 
},function(){ 

 if (currentpage=="solutions"){
  $("#solutionsnavimg").attr("src","/images/nav/solnavdown.png");

} else {
  $("#solutionsnavimg").attr("src","/images/nav/solnav.png");

}
}); 

$("#blognavimg").hover(function(){ 
  $(this).attr("src","/images/nav/blognavover.png"); 
},function(){ 

 if (currentpage=="blog"){
  $("#blognavimg").attr("src","/images/nav/blognavdown.png");

} else {
  $("#blognavimg").attr("src","/images/nav/blognav.png");

}
});

$("#homenavimg").hover(function(){ 
  $(this).attr("src","/images/nav/homenavover.png"); 
},function(){ 

if ((currentpage==null) || (currentpage=="schedule-your-demo")) {
  $("#homenavimg").attr("src","/images/nav/homenavdown.png");

} else {
  $("#homenavimg").attr("src","/images/nav/homenav.png");

}


});

$("#technavimg").hover(function(){ 
  $(this).attr("src","/images/nav/technavover.png"); 
},function(){ 

 if (currentpage=="technology"){
  $("#technavimg").attr("src","/images/nav/technavdown.png");

} else {
  $("#technavimg").attr("src","/images/nav/technav.png");

}
});



					  
 $('#search-input').focus(function () {
		if ($('#search-input').val() == 'Search') {
			$('#search-input').val('');
			$('#search-input').css({'color' : '#474747'});
		}
	});
	
	
	
	 $('#first_name').focus(function () {
		if ($('#first_name').val() == 'first') {
			$('#first_name').val('');
			$('#first_name').css({'color' : '#5f5f5f'});
		}
	});
	
	
	 $('#last_name').focus(function () {
		if ($('#last_name').val() == 'last') {
			$('#last_name').val('');
			$('#last_name').css({'color' : '#5f5f5f'});
		}
	});
	
	
	
	 $('#webtolead_email1').focus(function () {
		if ($('#webtolead_email1').val() == 'Email Address') {
			$('#webtolead_email1').val('');
			$('#webtolead_email1').css({'color' : '#5f5f5f'});
		}
	});
	
		 $('#phone_work').focus(function () {
		if ($('#phone_work').val() == 'Phone Number') {
			$('#phone_work').val('');
			$('#phone_work').css({'color' : '#5f5f5f'});
		}
	});
	
	
	 $('#specialty_c').focus(function () {
		if ($('#specialty_c').val() == 'Speciality') {
			$('#specialty_c').val('');
			$('#specialty_c').css({'color' : '#5f5f5f'});
		}
	});
	
	
	 $('#number').focus(function () {
		if ($('#number').val() == '#') {
			$('#number').val('');
			$('#number').css({'color' : '#5f5f5f'});
		}
	});
	
		
		$(".form_div_close").click(function () {
      $(".formdiv").addClass('hidden');
	 //  $("#content-main-body_left").height($("#content-main-body_right").height()+210);
	 // $("#content-main-body_right").height($("#content-main-body_left").height());
      return true;
    });
		
		$(".tab_content").hide(); //Hide all content
	//$(".navcontainer ul li:first-child a").addClass("active").show(); //Activate first tab
	//$(".tab_content:first").show(); //Show first tab content
	$("#content-main-body_right").height($("#content-main-body_left").height());


//on load Event
var theanchor= jQuery.url.segment(2);

var loadactiveTab = $(this).find("a[href='"+theanchor+"']"); //Find the href attribute value to identify the active tab + content

		$('#'+theanchor).fadeIn(); //Fade in the active ID content
		$(loadactiveTab).addClass("active");
		$("#content-main-body_right").height($("#content-main-body_left").height());
	
	


	$(".tab_content1").hide(); //Hide all content

	$("#content-main-body_right").height($("#content-main-body_left").height());





//on load Event
var theanchor1= jQuery.url.segment(1);

var loadactiveTab1 = $(this).find("a[href='"+theanchor1+"']"); //Find the href attribute value to identify the active tab + content

		$('#'+theanchor1).fadeIn(); //Fade in the active ID content
		$(loadactiveTab1).addClass("active");
		$("#content-main-body_right").height($("#content-main-body_left").height());
		
		$(".tab_content2").hide(); //Hide all content

	$("#content-main-body_right").height($("#content-main-body_left").height());


//on load Event
var theanchor2= jQuery.url.segment(0);

var loadactiveTab2 = $(this).find("a[href='"+theanchor2+"']"); //Find the href attribute value to identify the active tab + content

		$('#'+theanchor2).fadeIn(); //Fade in the active ID content
		$(loadactiveTab2).addClass("active");
		$("#content-main-body_right").height($("#content-main-body_left").height());


	//On Click Event
	//$(".navcontainer ul li").click(function() {
//
	//	$(".navcontainer ul li a").removeClass("active"); //Remove any "active" class
		
	//	$(".tab_content").hide(); //Hide all tab content

	//	var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
	//	$(activeTab).fadeIn(); //Fade in the active ID content
		
	//	var activeTab2= $(this).find("a"); //Add "active" class to selected tab
	//	$(activeTab2).addClass("active");
	//	$("#content-main-body_right").height($("#content-main-body_left").height());
	//		return false;
	  
		
	//});
	
	
			
			
			
		$(".tab_content_vertical").hide(); //Hide all content
	$(".navcontainer_vertical ul li:first-child a").addClass("active").show(); //Activate first tab
	$(".tab_content_vertical:first").show(); //Show first tab content
	$("#sectional-main-content").height($("#sectional-main-rightcontent").height()+20);
				$("#central-sectional-main-content").height($("#sectional-main-rightcontent").height()+20);

	//On Click Event
	$(".navcontainer_vertical ul li").click(function() {

		$(".navcontainer_vertical ul li a").removeClass("active"); //Remove any "active" class
		
		$(".tab_content_vertical").hide(); //Hide all tab content

		var activeTab3 = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab3).fadeIn(); //Fade in the active ID content
		var activeTab4= $(this).find("a"); //Add "active" class to selected tab
		$(activeTab4).addClass("active");
			$("#sectional-main-content").height($("#sectional-main-rightcontent").height()+20);
						$("#central-sectional-main-content").height($("#sectional-main-rightcontent").height()+20);
		return false;
	});
	
	
		$(".tab_content_concierge").hide(); //Hide all content
	$(".navcontainer_concierge ul li:first-child a").addClass("active").show(); //Activate first tab
	$(".tab_content_concierge:first").show(); //Show first tab content
	

	//On Click Event
	$(".navcontainer_concierge ul li").click(function() {

		$(".navcontainer_concierge ul li a").removeClass("active"); //Remove any "active" class
		
		$(".tab_content_concierge").hide(); //Hide all tab content

		var activeTab5 = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab5).fadeIn(); //Fade in the active ID content
		var activeTab6= $(this).find("a"); //Add "active" class to selected tab
		$(activeTab6).addClass("active");
	
		return false;
	});
		
		
				
		$(".tab_content_solutions").hide(); //Hide all content
	$(".navcontainer_solutions ul li:first-child a").addClass("active").show(); //Activate first tab
	$(".tab_content_solutions:first").show(); //Show first tab content
	

	//On Click Event
	$(".navcontainer_solutions ul li").click(function() {

		$(".navcontainer_solutions ul li a").removeClass("active"); //Remove any "active" class
		
		$(".tab_content_solutions").hide(); //Hide all tab content

		var activeTab8 = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab8).fadeIn(); //Fade in the active ID content
		var activeTab9= $(this).find("a"); //Add "active" class to selected tab
		$(activeTab9).addClass("active");
	
		return false;
	});
		
	
		
		
						   
		// $('#search-input').smartSuggest({
		//src: '/javascripts/data.js',
		//minChars: 1
	//});
						   
	$(".downsolutions").mouseenter(function() {
			$(this).parent().find(".solutionsdropped").slideDown("fast").show();
		$(this).parent().find(".technologydropped").slideUp("fast");
						$(this).parent().find(".whydropped").slideUp("fast");
						$(this).parent().find(".aboutdropped").slideUp("fast");
		$(this).parent().hover(function() {
		
		}, function(){
		$(this).parent().find(".solutionsdropped").slideUp("fast");
						$(this).parent().find(".whydropped").slideUp("fast");
						$(this).parent().find(".aboutdropped").slideUp("fast");
		}); 
	}); 
	
	
	
	
	
	$(".downtechnology").mouseenter(function() {
		$(this).parent().find(".technologydropped").slideDown("fast").show();
		$(this).parent().find(".solutionsdropped").slideUp("fast");
				$(this).parent().find(".whydropped").slideUp("fast");
				$(this).parent().find(".aboutdropped").slideUp("fast");
		$(this).parent().hover(function() {
		}, function(){
		$(this).parent().find(".technologydropped").slideUp("fast");
						$(this).parent().find(".whydropped").slideUp("fast");
						$(this).parent().find(".aboutdropped").slideUp("fast");
		}); 
	
	}); 
	$(".downwhy").mouseenter(function() {
		$(this).parent().find(".whydropped").slideDown("fast").show();
				$(this).parent().find(".solutionsdropped").slideUp("fast");
		$(this).parent().find(".technologydropped").slideUp("fast");
		$(this).parent().find(".aboutdropped").slideUp("fast");
		$(this).parent().hover(function() {
		}, function(){
		$(this).parent().find(".solutionsdropped").slideUp("fast");
			$(this).parent().find(".technologydropped").slideUp("fast");
			$(this).parent().find(".aboutdropped").slideUp("fast");
		}); 
	}); 
	$(".downabout").mouseenter(function() {
		$(this).parent().find(".aboutdropped").slideDown("fast").show();
				$(this).parent().find(".solutionsdropped").slideUp("fast");
						$(this).parent().find(".whydropped").slideUp("fast");
		$(this).parent().find(".technologydropped").slideUp("fast");
		$(this).parent().hover(function() {
		}, function(){
		$(this).parent().find(".solutionsdropped").slideUp("fast");
		$(this).parent().find(".whydropped").slideUp("fast");
			$(this).parent().find(".technologydropped").slideUp("fast");
		}); 
	}); 
	
	
	$(".downhome").mouseenter(function() {
	
				$(this).parent().find(".solutionsdropped").slideUp("fast");
						$(this).parent().find(".whydropped").slideUp("fast");
		$(this).parent().find(".technologydropped").slideUp("fast");
			$(this).parent().find(".aboutdropped").slideUp("fast");
		$(this).parent().hover(function() {
		}, function(){
		$(this).parent().find(".solutionsdropped").slideUp("fast");
		$(this).parent().find(".whydropped").slideUp("fast");
			$(this).parent().find(".technologydropped").slideUp("fast");
				$(this).parent().find(".aboutdropped").slideUp("fast");
		}); 
	}); 
	
	
		$(".downblog").mouseenter(function() {
	
				$(this).parent().find(".solutionsdropped").slideUp("fast");
						$(this).parent().find(".whydropped").slideUp("fast");
		$(this).parent().find(".technologydropped").slideUp("fast");
			$(this).parent().find(".aboutdropped").slideUp("fast");
		$(this).parent().hover(function() {
		}, function(){
		$(this).parent().find(".solutionsdropped").slideUp("fast");
		$(this).parent().find(".whydropped").slideUp("fast");
			$(this).parent().find(".technologydropped").slideUp("fast");
				$(this).parent().find(".aboutdropped").slideUp("fast");
		}); 
	}); 
	
	
		$(".downcareer").mouseenter(function() {
	
				$(this).parent().find(".solutionsdropped").slideUp("fast");
						$(this).parent().find(".whydropped").slideUp("fast");
		$(this).parent().find(".technologydropped").slideUp("fast");
			$(this).parent().find(".aboutdropped").slideUp("fast");
		$(this).parent().hover(function() {
		}, function(){
		$(this).parent().find(".solutionsdropped").slideUp("fast");
		$(this).parent().find(".whydropped").slideUp("fast");
			$(this).parent().find(".technologydropped").slideUp("fast");
				$(this).parent().find(".aboutdropped").slideUp("fast");
		}); 
	}); 
	
	
		$(window).scroll(function () { 
$(".solutionsdropped").slideUp("fast");
$(".technologydropped").slideUp("fast");
$(".whydropped").slideUp("fast");
$(".aboutdropped").slideUp("fast");


    });
    
    
    //mouseover and drop functions
    
    $(".technologydropped").mouseover(function() {
	
	$("#technavimg").attr("src","/images/nav/technavdown.png");
	});
	
	$(".technologydropped").mouseout(function() {
	
	 if (currentpage=="technology"){
  $("#technavimg").attr("src","/images/nav/technavdown.png");

} else {
  $("#technavimg").attr("src","/images/nav/technav.png");

}
	});
	
	
	
	   $(".whydropped").mouseover(function() {
	
	$("#whynavimg").attr("src","/images/nav/whynavdown.png");
	});
	
	$(".whydropped").mouseout(function() {
	
	if (currentpage=="why-carecloud"){
  $("#whynavimg").attr("src","/images/nav/whynavdown.png");

} else {
  $("#whynavimg").attr("src","/images/nav/whynav.png");

}
	});
	
	
		   $(".aboutdropped").mouseover(function() {
	
	$("#aboutnavimg").attr("src","/images/nav/aboutnavdown.png");
	});
	
	$(".aboutdropped").mouseout(function() {
	
	 if (currentpage=="about-us" || currentpage=="leadership" || currentpage=="our-company" || currentpage=="news" || currentpage=="our-people" || currentpage=="contact-us" ||  currentpage=="signup" || currentpage=="our-company/albert-santalo" || currentpage=="board-of-directors" || currentpage=="contact")   {
  $("#aboutnavimg").attr("src","/images/nav/aboutnavdown.png");

} else {
  $("#aboutnavimg").attr("src","/images/nav/aboutnav.png");

}
	});
	
	
	 $(".solutionsdropped").mouseover(function() {
	
	$("#solutionsnavimg").attr("src","/images/nav/solnavdown.png");
	});
	
	$(".solutionsdropped").mouseout(function() {
	
	 if (currentpage=="solutions"){
  $("#solutionsnavimg").attr("src","/images/nav/solnavdown.png");

} else {
  $("#solutionsnavimg").attr("src","/images/nav/solnav.png");

}
	});
		
	
	 $(".tweet").tweet({
          join_text: "auto",
          username: "carecloud",
          avatar_size: 0,
          count: 1,
          auto_join_text_default: "", 
          auto_join_text_ed: "",
          auto_join_text_ing: "",
          auto_join_text_reply: "",
          auto_join_text_url: "",
          loading_text: "loading tweets..."
        });
      
       

	
	
});
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

		
