//********************************************************
// This is the one that goes in the header. It does not 
// seem to work if you have two call to these functions 
// on the same page; hence the duplicate functions.
//********************************************************
// IF AGENTS ARE AVAILABLE:
function agents_available(cmTagName, imgS, imgHt, imgWdth, divN) {
	linkImage = '/rrs/img/header/chat_btn.gif';
	linkImgHt = '24';
	linkImgWdth = '104';
	var divName = 'smartbutton';
	if(imgS != null && imgS.length > 0)	{
		linkImage = imgS;
	}
	if(imgHt != null && imgHt > 0 )	{
		linkImgHt = imgHt;
	}
	if(imgWdth != null && imgWdth > 0)	{
		linkImgWdth = imgWdth;
	}
	var imageTag = '<img src="'+linkImage+'" height="'+linkImgHt+'" width="'+linkImgWdth+'">';
	if(divN != null && divN.length > 0)	{
		divName = divN;
	}
	document.getElementById(divName).innerHTML = '' +
    '<a href="javascript:void();" onclick="cmCreatePageviewTag(\'' + cmTagName + '\',\'' + cmTagName + '\',null);window.open(\'https://admin.instantservice.com/links/5422/13218\',' + 
    '\'custclient\',\'width=600,height=400,resizable=1,scrollbars=0\');return false;">' + 
    imageTag+'</a><br>';
  return true;
}

// IF AGENTS ARE NOT AVAILABLE:
function agents_not_available(divName) {
  document.getElementById(divName).innerHTML = '' +
    '';
  return true;
}

//********************************************************
// This is the one that goes on the customer service page.
//********************************************************
// IF AGENTS ARE AVAILABLE:
function agents_available2() {
  document.getElementById('smartbutton2').innerHTML = '' +
    '<A HREF="" onClick="window.open(\'https://admin.instantservice.com/links/5422/13218\',' + 
    '\'custclient\',\'width=600,height=400,resizable=1,scrollbars=0\');return false;">' + 
    'Enjoy live help online - click now</A><br>';
  return true;
}

// IF AGENTS ARE NOT AVAILABLE:
function agents_not_available2() {
  document.getElementById('smartbutton2').innerHTML = '' +
    '';
  return true;
}

//********************************************************
// This is the one that goes in the footer.
//********************************************************
// IF AGENTS ARE AVAILABLE:
function agents_available_footer() {
  document.getElementById('smartbutton_footer').innerHTML = '' +
    '<a href="" class="footer_extended" onClick="window.open(\'https://admin.instantservice.com/links/5422/13218\',' + 
    '\'custclient\',\'width=600,height=400,resizable=1,scrollbars=0\');return false;">' + 
    'Live Help</a><br />';
  return true;
}
// IF AGENTS ARE NOT AVAILABLE:
function agents_not_available_footer() {
  document.getElementById('smartbutton_footer').innerHTML = '' +
    '';
  return true;
}
