function e(el){
	return document.getElementById(el);
}

function c_menuButton(topicNum)
{
   //e("contentFrame").src = "page" +topicNum + ".htm";
   if (topicNum == 1)
   {
    openWin("content/about.pdf",600,800,"About", 1)
   }
   if (topicNum == 2)
   {
    openWin("content/chapter1.pdf",600,800,"Chapter1", 1)
   }
   if (topicNum == 3)
   {
    openWin("content/maps.pdf",600,800,"Maps", 1)
   }  
   if (topicNum == 4)
   {
    openWin("http://excoboard.com/exco/index.php?boardid=24333",600,800,"Forum", 1);
   }  
   if (topicNum == 'links')
   {
    openWin("links.htm",500,306,"Links", 0);
   }   
   if (topicNum == 6)
   {
    openWin("world.htm",440,750,"Interactive_World", 0)
   }  
   if (topicNum == 7)
   {
    openWin("content/DyingStar_MP4.mp4",730,1280,"Dying_Star_HD", 1)
   } 
   if (topicNum == 8)
   {
    openWin("content/DyingStar_WMV.wmv",720,1280,"Dying_Star_HD", 1)
   }  
   if (topicNum == 'Sanctuary')
   {
        parent.replaceSite()
   }                  
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}


function c_mOver(s){v_mOver(s);}

function c_mOff(s){v_mOff(s);}

function v_mOver(s)
{
    if(!isNaN(s))
    {
         e("ls"+s).style.backgroundImage = "url(interface/bt_" + s + "_ovr.png)";    
    }
    else
    {
        if (s == 'links')
        {
             e('legal').style.backgroundImage = "url(interface/box_ovr.png)";
        }
        
        if (s == 'credit')
        {
             e('credit').style.backgroundImage = "url(interface/box_ovr.png)";
        }
    }    
}
function v_mOff(s)
{
    if(!isNaN(s))
    {
         e("ls"+s).style.backgroundImage = "url(interface/bt_" + s + "_std.png)";    
    }
    else
    {
        if (s == 'links')
        {
             e('legal').style.backgroundImage = "url(interface/box_std.png)";
        }
        
        if (s == 'credit')
        {
             e('credit').style.backgroundImage = "url(interface/box_std.png)";
        }
    }    
}

function openWin(sFileName, iHeight, iWidth, sName, iScroll)
{

	iHpos = (((screen.availHeight-200)/2)-(iHeight/2));
	iWpos = ((screen.availWidth/2)-(iWidth/2));
	
	if (navigator.appName == "Microsoft Internet Explorer")	
	{
		objWin = window.open(sFileName,sName,"top=" + iHpos + ", left=" + iWpos + ", height=" + iHeight + ",width=" + iWidth + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=" + iScroll + "");
	}	
	else
	{
		objWin = window.open(sFileName,sName,"height=" + iHeight + ",width=" + iWidth + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=" + iScroll + "");	
		objWin.moveTo(iWpos, iHpos);
	}
	objWin.opener = parent;
}				
