function createCookie(name,value,days)
{
	var expires = "";
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		expires = "; expires="+date.toGMTString();
	}
	else {expires = "";}
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') {c = c.substring(1,c.length);}
		if (c.indexOf(nameEQ) === 0) {return c.substring(nameEQ.length,c.length);}
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}

var helpWin;
var infoWin;
function openHelpWin(inhref) {
    helpWin = window.open(inhref,"help","toolbar=no,menubar=no,location=no, personalbar=no,scrollbars=yes,directories=no,status=no,resizable=no, width=450,height=390, left:300");
		helpWin.focus();
}
function openInfoWin(inhref,inWidth,inHeight) {
    infoWin = window.open(inhref,"info","toolbar=no,menubar=no,location=no, personalbar=no,scrollbars=yes,directories=no,status=no,resizable=no, width=" + inWidth + ",height=" + inHeight + ", left:100");
		infoWin.focus();
}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    };
  }
}

	 function doLoadContent(objid, file){
	  var head = document.getElementsByTagName('body').item(0);
	  var scriptTag = document.getElementById(objid);
	  if(scriptTag) {head=scriptTag.parentNode;}
	  if(scriptTag) {head.removeChild(scriptTag);}
	  var script = document.createElement('script');
	  script.src = file;
		script.type = 'text/javascript';
		script.id = objid;
		document.getElementsByTagName('head')[0].appendChild(script);
	}
	function setBanner(bid, s){
		var b = document.getElementById('banners-js-' + bid);
		if (b) {
			b.innerHTML = s;	
		}
	}
	function setInnerHTML(objid, s) {
		var b = document.getElementById(objid);
		if (b) {
			b.innerHTML = s;	
		}
	}

