// functions to show and hide divs
function openDiv(div) {
  document.getElementById(div).style.display = '';
}
function closeDiv(div) {
  document.getElementById(div).style.display = 'none';
}

// Function to open a hidden div and set the src of an iframe in that div
function openDivLoadIframe(divId,iframeId,url) {
  document.getElementById(iframeId).src = url;
  openDiv(divId);
}

function closeDivUnloadIframe(divId,iframeId) {
  document.getElementById(iframeId).src = '';
  closeDiv(divId);
}

function textCounter(field, countfield, maxlimit) {
   if (field.value.length > maxlimit) {
     field.value = field.value.substring(0, maxlimit);
   } else {
      countfield.value = maxlimit - field.value.length;
   }
}

function showhide(id, id2){
	if (document.getElementById){
		obj = document.getElementById(id);
		if (obj.style.display == "none"){
		obj.style.display = "";
		} else {
		obj.style.display = "none";
		}
		obj2 = document.getElementById(id2);
		obj2.style.display = "none";
	}
} 
