// JavaScript Document
			
var startTimer = 0;
function checkLivePersonStatus(){
	var imageLoaded = jQuery("li.livePersonStatus").children("a").find("imgs").length;
	if (imageLoaded > 0) {
		clearTimeout(t);
		startTimer = 0;
		if(jQuery("li.livePersonStatus").contents().get(3).nodeValue.indexOf('is currently not available')!=-1){
			jQuery("li.livePersonStatus").find("a").removeAttr("href");
		}
	}
	else {
		t = setTimeout("timedCount()", 1000);
		startTimer ++
		if (startTimer >= 20) {
			clearTimeout(t);
			startTimer = 0;
			if(jQuery("li.livePersonStatus").contents().get(3).nodeValue.indexOf('is currently not available')!=-1){
				jQuery("li.livePersonStatus").find("a").removeAttr("href");
			}
		}
	}
}
    

$(document).ready(function(){

function searchStringSetup(userType)
{
	if(userType=="WHSL"){
			$('#q').attr('title','Search CenturyLink Wholesale');
			$('#q').attr('value','Search CenturyLink Wholesale');
		}
		else{
			$('#q').attr('title','Search CenturyLink Business');
			$('#q').attr('value','Search CenturyLink Business');
		}
}
		searchStringSetup(userType);
		serStr=$('#q').val();
		/*alert('serStr:'+serStr);*/
		$('#q').focus(function(){
			if(serStr=='Search CenturyLink Wholesale'||serStr=='Search CenturyLink Business'){
				$(this).attr('value','');
			}
		});
		$('#q').blur(function(){
			serStr=$('#q').val();
			if(serStr==''){
				searchStringSetup(userType);
			}
			serStr=$('#q').val();
			$(this).attr('value',serStr);
		});
		
		$(".li-default").each(function(){ 
				$(this).show();
		});
try {
	/*alert('userloginStatus-js2:'+userloginStatus);*/
	if(userloginStatus=='true' || userloginStatus==true){	
	/*alert("userType:js"+userType);*/
	 	$("#mergerNews").hide();
	  $(".li-default").each(function(){
			$(this).hide();
		});
	    $(".li-switch").each(function(){
			$(this).show();
		});	
		var fName='Welcome '+fname+'!'; 
		var lName=" "+lname;
		var eid="ID:"+EID;
		var cname=CName;
	
		$('.fname').text(fName);
		$('.fn').text(fname);
		$('.ln').text(lName);
		$('.cname').text(cname);
		$('.eId').text(eid);
	
		if(myProfileLink=='true')
			$('.myProfile_Link').show();
		else 
			$('.myProfile_Link').hide();
		}
		
	else {
		$("#mergerNews").show();
		$(".li-default").each(function(){
			$(this).show();
		});
	    $(".li-switch").each(function(){
			$(this).hide();
		});	
	}	
}
catch(err) {
	log.error("commonheader.vm","commonheader Error: "+err.message,5)

}
$(".bmgCL_utilitybar").show();

});

