/************************************
* Purpose: Client side script for Ceuplan
* Date:    7/15/2007
* Author:  Dean Reid
***************************************/
var timer;
var elem = document.createElement('span' );
elem.setAttribute('id','subNavItems');



/************************************
* Purpose: Swap images for menu
* Date:    7/15/2007
* Author:  Dean Reid
***************************************/
function fnImageSwap(id,img,status,selected)
{
 
  var newimg = new Image();
  newimg.src = img;
  document.getElementById(id).src=newimg.src;
  
  switch (status)
  {
   case "ON":
     fnShowSubNav(status, img);
   break;
   case "OFF":
    if(selected=='ON')
    {
      fnShowSubNav(status, img);
    }
     
   break;
  }

}
/************************************
* Purpose: Show sections
* Date:    10/28/2007
* Author:  Dean Reid
***************************************/
function fnDisplay(val, section)
{
alert(val + ' ' + section);
  

}
/************************************
* Purpose: Launch window
* Date:    7/15/2007
* Author:  Dean Reid
***************************************/
function fnOpenWindow(wid)
{
  location.href=wid;
}
/************************************
* Purpose: Display sub navigation
* Date:    7/15/2007
* Author:  Dean Reid
***************************************/
function fnShowSubNav(status,img)
{     
 
  
   if (img.indexOf('HOME',0)!=-1)
   {
   
      elem.innerHTML="";
   }
   if (img.indexOf('ABOUT',0)!=-1)
   {
    document.getElementById("subNavigation").style.left=2; // 135;
     elem.innerHTML = " <a href='Mission.aspx'>Mission Statement</a> &diams; <a href='Policies.aspx'>Our Policies</a> &diams; <a href='Copyright.aspx'>Copyright</a> &diams; <a href='Honesty.aspx'>Academic Honesty</a> &diams; <a href='Privacy.aspx'>Privacy Statment</a> &diams; <a href='Testimonial.aspx'>Testimonials</a> &diams; <a href='Sponsors.aspx'>Links &amp; References</a>";      
   }
   if (img.indexOf('COURSES',0)!=-1)
   {
   
     document.getElementById("subNavigation").style.left=2; //400;
      elem.innerHTML = "<a href='Categories.aspx'>Course Categories</a> &diams; <a href='CoursesAll.aspx'>View All Courses</a> &diams; <a href='NewReleases.aspx'>New Course Releases</a> &diams;<a href='TopTenCourses.aspx'>Top Ten Courses</a> &diams;<a href='States.aspx'>Qualified States</a>";      
   }
   
   if (img.indexOf('INSTRUCTORS',0)!=-1)
   {
      document.getElementById("subNavigation").style.left=2; //268;
       elem.innerHTML = "<a href='InstructorProfiles.aspx'>Instructor Profiles</a> &diams; <a href='InstructorWanted.aspx'>Instructors Wanted</a>";      
   }
   
   if (img.indexOf('STUDENTS',0)!=-1)
    {
     document.getElementById("subNavigation").style.left=2; //527;
      elem.innerHTML = "<a href='Enroll.aspx' >Enroll</a> &diams; <a href='FAQ.aspx'>Student FAQ's</a> &diams; <a href='Login.aspx'>Student Login</a>";  
    }
   
   if (img.indexOf('SUPPORT',0)!=-1)
   {
     document.getElementById("subNavigation").style.left=2; //660;
      elem.innerHTML = "<a href='Requirements.aspx'>System Requirements</a> &diams; <a href='Help.aspx'>I Need Help</a> &diams; <a href='gs_tutorial.html' target='_blank'>Getting Started Tutorial</a>";
   }
   
   document.getElementById("subNavigation").appendChild(elem);
   
   if(navigator.appName=='Netscape')
   {
     document.getElementById("subNavigation").style.top=10;
   }
   else
   {
    
    document.getElementById("subNavigation").style.position="absolute";
    document.getElementById("subNavigation").style.top=30;
   }
   
   
   
   
   //clear timer
   clearTimeout(timer);
   //restart timer
   fnSetSubTimer();
   
}
/************************************
* Purpose: Clear sub navigation
* Date:    7/15/2007
* Author:  Dean Reid
***************************************/
function fnClearSubNav()
{
  if (elem)
  {  
   
       elem.innerHTML="";
   // $get("subNavNavigation").removeChild(elem);
  }
  
}
function fnSetSubTimer()
{
    timer=setTimeout(fnClearSubNav,10000);
}

/************************************
* Purpose: Launch Eval
* Date:    10/30/2007
* Author:  Dean Reid
* Note: 
***************************************/
function  fnOpenEval (parm)
{
  window.open('StudentEvaluation.aspx?courseid=' + parm, 'Evaluation', 'width=500,height=400,location=no,status=yes,resizable=yes,top=50,scollbars=yes');
}
/************************************
* Purpose: Launch Pop-up window
* Date:    9/10/2007
* Author:  Tyrone DAvis
* Note: This is written in an OO fashion for JavaScript
***************************************/

if ( !window.Ceuplan ) {
    window.Ceuplan = { };
}

Ceuplan.PopupWindow = function ( name, width, height, url, resizable) {
    this._name = name;
    this._width = width;
    this._height = height;
    this._url = url;
    this._resizable = resizable;
    
}

Ceuplan.PopupWindow.prototype = {    
    show : function() { 
        var options = "width=" + this._width + ",height=" + this._height + ",resizable=" + this._resizable;
        options += ",scrollbars=yes,location=no,status=yes,top=50,left=250";
        var win = window.open(this._url, this._name, options); 
        
    }
}

