/*// this is for external link pop-ups
// set up some parameters so window relates to the parent window
if (parent.window.innerWidth) var w = parent.window.innerWidth-80;
else if (parent.document.body.clientWidth) var w = parent.document.body.clientWidth-80;
if (parent.window.innerHeight) var h = parent.window.innerHeight-30;
else if (parent.document.body.clientHeight) var h = parent.document.body.clientHeight-50;
if (parent.window.screenX) var l = parent.window.screenX+30;
else var l = 30;
if (parent.window.screenY) var t = parent.window.screenY+30;
else var t = 30;

function initpop()
{
	var windowAttributes='width='+w+',height='+h+',left='+l+',top='+t+',scrollbars=yes,location=yes,resize=yes';
	var mtoAttributes = 'width=10,height=10,left=0,top=0,scrollbars=no,location=no,resize=no';
   	if(!window.opener)
  	{
		var as,i,popfun
		as=document.getElementsByTagName('a');
		for (i=0;i<as.length;i++)
		{
			if(as[i].target && !as[i].onclick && as[i].target.indexOf("_blank")>-1)
			// keeps it from cancelling out Highslide events and parent links
			{
				popfun=function(){window.open(this.href,'',windowAttributes);return false;};  //
				as[i].onclick=popfun;
				as[i].onkeypress=popfun;
			}
			if (as[i].href=="mailto:info@welcometostratford.com")
			{
                      popfun=function(){window.open('infoconversion.html','',mtoAttributes);return false;};  //
			    as[i].onclick=popfun;
			    as[i].onkeypress=popfun;
			}
		}
  	}
}

// With thanks to Scott Andrew
function addEvent(obj, evType, fn)
{
	if (obj.addEventListener)
	{
		obj.addEventListener(evType, fn, true);
		return true;
	} else if (obj.attachEvent){
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	}
}

addEvent(window,'load',initpop);*/

// these are the functions for remote expansion (as called by Flash)

function doExpand(el) // for external images
{
	if (document.all) var elem=document.all(el);
	else if (document.getElementById&&!document.all) var elem=document.getElementById(el);
	hs.expand(elem);
}

function doHTMLExpand(el,cid) //from content on same web page, content must be in a div tag
{
      if (document.getElementById){
	 	var elem=document.getElementById(el);
		var content=document.getElementById(cid);
      }
	else if (document.all)
	{
		 var elem=document.all(el);
		 var content=document.all(cid);
      }
      return hs.htmlExpand(elem, { contentID:  content });  	//, width:600, height:450
}

function doIframeExpand(el,w,h) //from external web page, el is the ID of the text or hidden link
{
	if (document.getElementById) var elem=document.getElementById(el);
	else if (document.all)  var elem=document.all(el);
     // 	alert(elem);
      /*	if (navigator.appName.indexOf("Explorer")>-1){
		if (w!="") w+=5;
	     	//if (h!="") h-=5;
      }*/
	if (w!=""&&h!="")	hs.htmlExpand(elem, { objectType:  'iframe', width:w, height:h });
	else if (w!=""&&h=="")	hs.htmlExpand(elem, { objectType:  'iframe', width:w });
    else hs.htmlExpand(elem, { objectType:  'iframe' });
}

function doAjaxExpand(el,w) // from a file containing divs with ID's and multiple content - e is the ID
{
	if (document.all) var e=document.all(el);
	else if (document.getElementById&&!document.all) var e=document.getElementById(el);
	return hs.htmlExpand(e, { objectType: 'ajax', width:w } );
}

function doGuideExpand(el) // from the guides file as per above
{
	if (document.all) var e=document.all(el);
	else if (document.getElementById&&!document.all) var e=document.getElementById(el);
	return hs.htmlExpand(e, { objectType: 'ajax', width: 280, targetX: 'guides 0px', targetY: 'guides 0px' } );
}

function initPage(p,w,h) // this opens the first page
{
  	setTimeout("doIframeExpand('"+p+"', "+w+","+h+")",800);
}

function contentExpand(el)
{
	setTimeout("doHTMLExpand('"+el+"',)",800);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function doClick(el)
{
      if (document.getElementById) var targ = document.getElementById(el);
	else if (document.all) var targ = document.all(el);
     targ.onclick();
}

function winopen(url)
{
      if (parent.window.innerWidth) var w = parent.window.innerWidth-80;
	else if (parent.document.body.clientWidth) var w = parent.document.body.clientWidth-80;
	if (parent.window.innerHeight) var h = parent.window.innerHeight-30;
	else if (parent.document.body.clientHeight) var h = parent.document.body.clientHeight-50;
	if (parent.window.screenX) var l = parent.window.screenX+30;
	else var l = 30;
	if (parent.window.screenY) var t = parent.window.screenY+30;
	else var t = 30;
	var features = 'width='+w+',height='+h+',left='+l+',top='+t+',scrollbars=yes,location=yes,resize=yes'
	window.open(url,'babywin',features);
}

function ccoptin()
{
    if (document.getElementById) var val = document.getElementById('ccbox').value;
	else if (document.all) var val = document.all('ccbox').value;
	document.newsoptin.ea.value=val;
	document.newsoptin.action='ccconversion.php';
	document.newsoptin.submit();
}

