// General functions used on Devtactics.com

// This old function is still used for the eSchool Essentials demo
function openWindow(url,id,w,h) {
		myWin = window.open(url,id,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h);
	}
	
	
function actuateLink(link)
{
	// Lightbox doesn't work properly if you have two links referencing the same image. You end up with two copies of the same image in your slideshow. (Lightbox adds images to slideshows based on URLs.)
	// To get around this, I'm using this function on one of the links to simulate a click on the other link. Lightbox ignores the javascript and the slideshow has the correct number of images.
	
   var allowDefaultAction = true;
	  
   if (link.click)
   {
	  link.click();
	  return;
   }
   else if (document.createEvent)
   {
	  var e = document.createEvent('MouseEvents');
	  e.initEvent(
		 'click'     // event type
		 ,true      // can bubble?
		 ,true      // cancelable?
	  );
	  allowDefaultAction = link.dispatchEvent(e);           
   }
		 
   if (allowDefaultAction)       
   {
	  var f = document.createElement('form');
	  f.action = link.href;
	  document.body.appendChild(f);
	  f.submit();
   }
}

