function bookmarkPage()
{
	var browsername = navigator.appName; 
      	if(browsername=="Microsoft Internet Explorer")
      	{  window.external.AddFavorite(window.location,document.title);  }
      	else
      	{  alert ("Please press CONTROL + 'D' on your keyboard to bookmark this page!");  }
}

function emailPage()
{
	eval("window.open('http://ydesigns.biz/tools/email-a-friend/?storename=stagefright&theURL="+window.location+"','email_popup','menubar=no,scrollbars=no,width=500,height=420')");  
}
function expandImage(imgLoc,imgH,imgW)
{
	imgH = imgH * 1; imgW = imgW * 1;
	var X = window.screen.availHeight;
	var Y = window.screen.availWidth;
	X = X - 100;  Y = Y - 50;
	if(X > (imgH + 90))	
	{ X = (imgH + 90); }
	if(Y > (imgW + 40))	
	{ Y = (imgW + 40); }
	if(Y<210){	Y = 210;	}
	  var popWin = window.open('','','toolbar=0, location=0,status=0,menubar=0,resizable=0,scrollbars=1,width='+Y+',height=' + X);
	  popWin.document.open();
	  popWin.document.write('<ht'+'ml><he'+'ad><ti'+'tle>StageFright.com</tit'+'le></he'+'ad><bo'+'dy>');
	  popWin.document.write('<img alt="loading expanded image... please wait..." name=mainImage src='+imgLoc+' border=0>');
	  popWin.document.write('<br><br><font face=verdana,arial,helvetica size=2><b><center><a href="javascript:window.close()"><b><font color=990000>Close Window</a>');
	  popWin.document.write('</body></html>');
	  popWin.document.close();
	  popWin.moveTo(50,50);
}

function changeSite()
{
  var newSite = "http://www.stage-fright.com/";
		
  var currentURL = window.location + "";
  rExp = /.+\//gi;
  var newURL = currentURL.replace(rExp, "");
  newURL = newSite + newURL;
  window.location = newURL;
}
  // don't use .org URL
  var currentLoc = window.location + " ";
  var RE = new RegExp(".+fright\.org","i");
  if(currentLoc.match(RE))
  {
    changeSite();
  }