function openShowReg(arg1) {
	if (arg1) {
		windowObject = window.open('https://www.expologic.com/chasummer09/?org_key='+arg1,'CHAShowRegistration','');
	}
}

/* Created by: Cat Arriola | http://astrodiva.journalspace.com/ */
function fixImgs(whichId, maxW) {
  var pix=document.getElementById(whichId).getElementsByTagName('img');
  for (i=0; i<pix.length; i++) {
    w=pix[i].width;
    h=pix[i].height;
    if (w > maxW) {
      f=1-((w - maxW) / w);
      pix[i].width=w * f;
      pix[i].height=h * f;
    }
  }
}

// Multiple onload function created by: Simon Willison  http://simonwillison.net/2004/May/26/addLoadEvent/ 
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function onImgErrorSmall(source) {
	source.src = "/eweb/images/no-image-100px.gif";
	// disable onerror to prevent endless loop
	source.onerror = "";
	return true;
}

function onImgErrorLarge(source) {
	source.src = "/eweb/images/no-image-200px.gif";
	// disable onerror to prevent endless loop
	source.onerror = "";
	return true;
}

function getDomain(thestring) {
    var urlpattern = new RegExp("(http|ftp|https)://(.*?)/.*$");
    var parsedurl = thestring.match(urlpattern);
    return parsedurl[2];
}




