var _gSelectedItemNo = 1;
var _gSelectedMainMenu = 1;

var height = 310;
var vwidth = 190;
var speedmenu = 0;
var stepmenu =6;

var hheight = 32; // heigth of a header item
var iheight = 20; // heigth of a item

var bgc = "#ffffff" // background color of the item
var tc = "#000000" // text color of the item
var textdec  =  "none";
  
var over_bgc = "#f6f6f6";
var over_tc = "#000000";
var over_textdec  =  "none"; // underline 
var open1 = -1;

var N = (document.all) ? 0 : 1;
var Link_count = 0;
var ntop = 0;
var items = false
var z = 0;
var hnr = 1;
var timerID = null;
var link_array = new Array();

function goasIwant(strHref){
	alert('p');
	//document.location.href = strHref;
}
function write_menu()
{
document.write("<div id=main_panel style='height:")
if (N) document.write(height);
else document.write(height-2);
document.write(";width:");
if (N) document.write(vwidth)
else document.write(vwidth-2)
document.write("'>");

cl =0;
for(i=0;i<Link.length;i++)
{
 la = Link[i].split("|");
 if(la[0] == "0")
 {
//alert("la[0]" + la[0] + "\nla[1]=" + la[1] + "\nla[2]=" + la[2]);
//document.write("<a href='"+la[2]+"'>p");
   if (items == true) {document.write("</div>");items = false;}
   document.write("<div class='head_item' id='move"+cl+"' style='height:"+hheight+";width:"+vwidth+";top:"+(ntop-1)+";z-index:"+z+"' onclick=\"document.location.href='"+la[2]+"'\">&nbsp;"+la[1]+"</div>");
   // alert("'"+la[2]+"'");
   link_array[cl] = new Array("up",0,hnr);
   cl++;hnr++;
   ntop += hheight-1;
   z++;
 }
 else
 {
//alert("_gSelectedItemNo="+ _gSelectedItemNo + "\ncl=" + cl+ "\n_gcnt=" + _gcnt+ "\ni=" + i);	 
  cheight = height - ntop + 1;
//selected-item
//item_panel
  if (items == false) {document.write("<div class='item_panel' id='move"+cl+"' style='height:"+cheight+"px;width:"+vwidth+";top:")
	  if (N) document.write(ntop+2);
	  else document.write(ntop);
	  document.write(";z-index:"+z+"'>");
	  z++;
	  link_array[cl] = new Array("up",0,"");
	  cl++;
  }
  document.write("<a href='"+la[2]+"'");
  if (la[3] != "") document.write(" target='" + la[3] + "' ");
  if(_gSelectedItemNo == i) {	 
	  document.write(" onmouseover=color('item"+i+"') onmouseout=uncolor('item"+i+"') ><div class='selected-item' id='item1"+i+"' style='height:"+iheight+";width:"+vwidth+"'>&nbsp;&nbsp;"+la[1]+"</div></a>");
  }else{
	  document.write(" onmouseover=color('item"+i+"') onmouseout=uncolor('item"+i+"') ><div class='item' id='item"+i+"' style='height:"+iheight+";width:"+vwidth+"'>&nbsp;&nbsp;"+la[1]+"</div></a>");
  }
  items = true;
 }
}
document.write("</div>");
if (items == true) {document.write("</div>");}
}

function color(obj)
{
	if(obj){
		if(document.getElementById(obj)){
			document.getElementById(obj).style.backgroundColor = over_bgc;
			document.getElementById(obj).style.color = over_tc;
			document.getElementById(obj).style.textDecoration  =  over_textdec;
		}
	}
}

function uncolor(obj)
{
	if(obj){
		if(document.getElementById(obj)){	
			 document.getElementById(obj).style.backgroundColor = bgc;
			 document.getElementById(obj).style.color = tc;
			 document.getElementById(obj).style.textDecoration  =  textdec;
		}
	}
}

function move(idnr,hid, glink)
{
//alert("glink='" + glink + "'");	
 if ((idnr != open1)&& (timerID == null))
 {
 if(link_array[idnr][0] == "up")
 {
  down = height - (hid * hheight) - ((hnr -(hid+1))* hheight) + 2;
  if(N) down+=2;
  dmover(idnr+2,down);
 }
 else
 {
  up = height - ((hid -1) * hheight) -((hnr - (hid))* hheight) +2;
  if(N) up+=2;
  umover(idnr,up);
 }
 open1 = idnr;
 }
}

function dmover(idnr,down)
{
 for (i=idnr;i<link_array.length;i++)
 {
  if(link_array[i][0] == "up")
  {
   txt_obj = "move" + i
   document.getElementById(txt_obj).style.top = parseInt(document.getElementById(txt_obj).style.top) + stepmenu;
  }
 }
 down-= stepmenu;
 if(down > 0)timerID = setTimeout("dmover("+idnr+","+down+")",speedmenu);
 else 
 {
  for (i=idnr;i<link_array.length;i++) {link_array[i][0] = "down";}
 timerID = null;
 }
}

function umover(idnr,up)
{
 for (i=0;i<(idnr+2);i++)
 {
  if(link_array[i][0] == "down")
  {
   txt_obj = "move" + i
   document.getElementById(txt_obj).style.top = parseInt(document.getElementById(txt_obj).style.top) - stepmenu;
  }
 }
 up-=stepmenu;
 if(up > 0)timerID = setTimeout("umover("+idnr+","+up+")",speedmenu);
 else 
 {
  for (i=0;i<(idnr+2);i++) {link_array[i][0] = "up";}
 timerID = null;
 }
}
//free JavaScripts at http://jdstiles.com

function start(idnr)
{
 write_menu();
 for(i=0;i<link_array.length;i++)
 {
  if (link_array[i][2] == idnr)
  {
   pull = i;
   i = link_array.length;
  }
 }
   move(pull,idnr);
} 





  var Link = new Array();
  Link[0] = "0|About Us |"+ _gRootPath +"/university_programs.html|_self|Main";
  Link[1] = "0|IGNOU|"+ _gRootPath +"/university_programs/about_ignou.html|_self|Forms";
  Link[2] = "1|<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>About IGNOU|"+ _gRootPath +"/university_programs/about_ignou.html|_self|Utilities";
  Link[3] = "1|<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Courses|"+ _gRootPath +"/university_programs/ignou_courses.html|_self|Main";
  Link[4] = "1|<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Enrolled Students|"+ _gRootPath +"/university_programs/ignou_schedule.html|_self|Navigation";
  Link[5] = "1|&nbsp;&nbsp;&nbsp;<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Schedule|"+ _gRootPath +"/university_programs/ignou_schedule.html|_self|Navigation";
  Link[6] = "1|&nbsp;&nbsp;&nbsp;<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Notice|"+ _gRootPath +"/university_programs/ignou_notice.html|_self|Navigation";
  Link[7] = "1|&nbsp;&nbsp;&nbsp;<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Assignment Marks|"+ _gRootPath +"/university_programs/ignou_assignment_marks.aspx|_self|Navigation";
  Link[8] = "0|SMU|"+ _gRootPath +"/university_programs/about_smu.html|_self|Effects";
  Link[9] = "1|<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>About SMU|"+ _gRootPath +"/university_programs/about_smu.html|_self|Utilities";
  Link[10] = "1|<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Courses|"+ _gRootPath +"/university_programs/smu_courses.html|_self|Utilities";
  Link[11] = "1|<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Enrolled Students|http://www.kctm.co.in/enrolled_students_SMU_lect_sch.html|_blank|Utilities";
  Link[12] = "1|&nbsp;&nbsp;&nbsp;<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Lecture Schedule|http://www.kctm.co.in/enrolled_students_SMU_lect_sch.html|_blank|Navigation";
  Link[13] = "1|&nbsp;&nbsp;&nbsp;<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Notice|"+ _gRootPath +"/university_programs/smu_notice.html|_self|Navigation";
  Link[14] = "1|&nbsp;&nbsp;&nbsp;<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Sample Question Papers|"+ _gRootPath +"/university_programs/smu_sample_question_papers.html|_self|Navigation";
  Link[15] = "1|&nbsp;&nbsp;&nbsp;<img src='"+ _gRootPath +"/images/common/bul_red_arrow_small.gif' align='absmiddle' hspace='6' border='0'>Assignments|"+ _gRootPath +"/university_programs/smu_assignments.html|_self|Navigation";
  Link[16] = "0|Contact Us|"+ _gRootPath +"/university_programs/contact.html|_self|Utilities";