/*

BREADCRUMBS JavaScript Extension for
the College of Applied and Natural Sciences

Written 2003, by Gorden Green and Jared Hancock
Modified 2004, by Clayton Chandler

You may use any of this code according to the terms of the
General Public License, however, please give credit if you use it
in your own code

*/
var newLink=0;
function addLinks(linkArray)
{
    var i=0;
    // We'll loop until there are no more links to add.  We'll make sure,   //
    // though we're starting at i=0, to insert the links starting at 1      //
    while (linkArray[i])
    {
        if (linkArray[i].Offset&&parseInt(linkArray[i].Offset))
        {
            links[linkArray[i].Offset] = linkArray[i++];
        }
        else
        {
            links[++newLink] = linkArray[i++];
        }
    }
}
function crumbs(crumbList)
{
    // Establish an array of departments and introduction page link ids     //
    depid=new Array;
    depid={"107":"Agricultural Sciences","71":"Biological Sciences",
            "99":"Environmental Science","136":"Forestry",
            "133":"Wildlife Conservation","180":"Health Information Management",
            "122":"Human Ecology", "78":"Nursing","145":"College of ANS"};
    var breadCrumbs="";
    for (i=0; i<crumbList.length-1; i++)
    {
        // Check to see if the entry is a number to know whether or not it  //
        // is special                                                       //
        if (parseInt(crumbList[i]))
        {
            // We'll substitute 'Introduction' with the department name     //
            if (links[crumbList[i]].Title=="Introduction")
            {
                breadCrumbs += "<a href=\"" + links[crumbList[i]].Link;
                breadCrumbs += "\">" + depid[crumbList[i]];
                breadCrumbs += "</a> :: ";
            }
            else
            {
                breadCrumbs += "<a href=\"" + links[crumbList[i]].Link;
                breadCrumbs += "\">" + links[crumbList[i]].Title;
                breadCrumbs += "</a> :: ";
            }
        }
        else
        {
            breadCrumbs += crumbList[i] + " :: ";
        }
    }
    if (parseInt(crumbList[i]))
    {
        breadCrumbs += "<b>" + links[crumbList[i]].Title;
        breadCrumbs += "</b>";
    }
    else
    {
        breadCrumbs += "<b>" + crumbList[i];
    }
    
    return breadCrumbs;
}
function options(optionList)
{
    var options="<table>";
    for (i=0; i<optionList.length-1; i++)
    {
        if (optionList[i]==optionList[optionList.length-1])
        {
            if (parseInt(optionList[i]))
            {
                if (!(links[optionList[i]].childOf))
                {
                    options += "<tr><td width=2></td><td height=30>";
                    options += "<img src=\"http://ans.latech.edu/img/right.gif\" ";
                    options += "align=\"absmiddle\" alt=\"Go\"></td>";
                    options += "<td class=crumbs><b>";
                    options += links[optionList[i]].Title;
                    options += "</b></td></tr>";
                }
                else
                {
                    options += "<tr><td width=2></td><td height=18 width=30>";
                    options += "</td><td><table><tr vAlign=top><td class=crumbs>";
                    j=1;
                    while(j<links[optionList[i]].childOf)
                    {
                        options += "&nbsp;&nbsp;&nbsp;&nbsp;";
                        j++;
                    }
                    options += "<b>:&nbsp;:</td><td class=crumbs><b>";
                    options += links[optionList[i]].Title;
                    options += "</b></td></tr></table></td></tr>";
                }
            }
            else
            {
                options += "<tr><td width=2></td><td height=18 width=30>";
                options += "</td><td><table><tr vAlign=top><td class=crumbs>";
                options += "<b>:&nbsp;:</b></td><td class=crumbs><b>" + optionList[i];
                options += "</b></td></tr></table></td></tr>";
            }
        }
        else
        {
            if (!(links[optionList[i]].childOf))
            {
                options += "<tr><td width=2></td><td height=30>";
                options += "<img src=\"http://ans.latech.edu/img/remove.gif\" ";
                options += "align=\"absmiddle\" alt=\"Go\"></td><td>";
                options += "<a href=\"" + links[optionList[i]].Link;
                options += "\">" + links[optionList[i]].Title;
                options += "</a></td></tr>";
            }
            else
            {
                options += "<tr><td width=2></td><td height=18 width=30>";
                options += "</td><td><table><tr vAlign=top><td class=crumbs>";
                j=1;
                while(j<links[optionList[i]].childOf)
                {
                    options += "&nbsp;&nbsp;&nbsp;";
                    j++;
                }
                options += "::</td><td class=crumbs>";
                options += "<a href=\"" + links[optionList[i]].Link;
                options += "\">" + links[optionList[i]].Title;
                options += "</a></td></tr></table></td></tr>";
            }
        }
    }
    options += "</table>";
    return options;
}
function helpBar()
{
    var temp;
    temp = "<table width=100%><tr><td align=right>";
    temp += "<table><tr>";
    /*temp += "<td style=font-size:7pt;text-align:center>Back</td>";
    temp += "<td style=font-size:7pt;text-align:center>Top</td>";
    temp += "<td style=font-size:7pt;text-align:center>Bottom</td>";
    temp += "<td style=font-size:7pt;text-align:center>Print</td>";
    temp += "<td style=font-size:7pt;text-align:center>Help</td>";
    temp += "</td></tr><tr>"; */
    temp += "<td><center><img src=http://ans.latech.edu/img/first.png title=\"Back\" alt=\"Back\" border=0 onClick=js:history.go(-1);></center></td>";
    temp += "<td><center><a href=#Top><img src=http://ans.latech.edu/img/top.png title=\"Top\" alt=\"Top\" border=0></a></center></td>";
    temp += "<td><center><a href=#Bottom><img src=http://ans.latech.edu/img/bottom.png title=\"Bottom\" alt=\"Bottom\" border=0></a></center></td>";
    temp += "<td><center><img src=http://ans.latech.edu/img/print.png title=\"Print\" alt=\"Print\" border=0 onClick=js:printthis(\"content\");></center></td>";
    temp += "<td><center><img src=http://ans.latech.edu/img/help.png title=\"Help\" alt=\"Help\" border=0></center></td>";
    temp += "</td></tr></table></td></tr></table>";
    return temp;
}
var BarDef = {
	"style"	: {
		"css"	:"bartitle2",
		"align":"center",
		"bgcolor":"#c8c8ca",
		"size"	:[160,25],
		"shadow":{"color":"#C0C0C0","width":0},
		"imgspace":5,
		"imgendon": { "src":"http://ans.latech.edu/img/arr_up_2.jpg", "width":13, "height":12},
		"imgendoff":{ "src":"http://ans.latech.edu/img/arr_down_2.jpg", "width":13, "height":12},
		"itemoffset":{ "x":5, "y":10 },
		"fixheight":305	},

		"scroller":{
			"style": {
				"bgcolor":"#c8c8ca",
				"bgimg":"",
				"align":"center",
  			        "imgendon": "",
				"imgendoff":"",
			        "size":[170,18],
			        "css":"bartitlecenter"

				 },
			"styleover" : {
	 			      "imgendon": "",
				      "imgendoff":"",
			 	      "bgcolor":"#C8C8CA",
				      "bgimg":"",
				      "align":"center",
			              "size":[170,18],
			        "css":"bartitlecenter"
            },
		        "up":"http://ans.latech.edu/img/arr_up_2.jpg",
			"down":"http://ans.latech.edu/img/arr_down_2.jpg",
			"step":5, "time":30, "len":60
		},
			
	"itemover" : {"css":"bartext2",
		      "size"	:[160,29],	 	
	 	      "bgimg":"img/1x1.gif"
	             },
	"itemon" : {"bgimg":"img/1x1.gif", "color":"#000000" },
	"position": { "absolute": false, "pos":[-1,-4] },
	"items" : [
		{ "text":"The College",
	  	  "style": {
				"bgimg":"http://ans.latech.edu/img/1x1.gif",
				"imgdir":{ "src":"http://ans.latech.edu/img/home2.gif", "width":24, "height":24}
		           },
		  "menu": {
		  	"style": {
				"css"	:"bartext2",
				"size":[150, 22],
				"bgcolor":"#D8D8DA",
				"border":{"color":"#666666","width":1},
				"bgimg":"",
				"itemoffset":{ "x":5, "y":2 }
				 },
			"itemover" : {
	 			      "imgendon": "",
				      "imgendoff":"",
				      "bgimg":"",
				      "bgcolor":"#C8C8CA",
				      "size":[150, 22]
			             },
			"styleover" : {"css":"bartitlecenter"},
	  	  	"items"	: [
		  		{
				 "text": "Home",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}},
				 "action": {"url": "http://ans.latech.edu"}	
				},
		  		{"text": "Graduate Studies",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}},
				  "action": {"url": "http://ans.latech.edu/grad-index.html"}	
				},
				{"text": "E-Mail Us",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}},
				  "action": {"url": "mailto:ANSmail@ans.latech.edu"}	
				}
		  	]
		  }
		},
		{ "text":"Louisiana Tech",
	  	  "style": {
				"bgimg":"img/1x1.gif",
				"imgdir":{ "src":"http://ans.latech.edu/img/home2.gif", "width":24, "height":24}
		  },
		  "menu": {
		  	"style": {
				"css"	:"bartext2",
				"size":[150,29],
				"bgcolor":"#D8D8DA",
				"border":{"color":"#666666","width":1},
				"bgimg":"",
				"itemoffset":{ "x":5, "y":2 }
			},
			"itemover" : {
	 			"imgendon": "",
				"imgendoff":"",
				"bgcolor":"#C8C8CA",
				"size":[150, 22]
			},
		  	"items"	: [
		  		{"text": "Tech Home",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}
				 },
			         "action" : {"url":"http://www.latech.edu","target":"_blank", "title":"Louisiana Tech" }	
				},
				{"text": "Administration and Business",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}
				 },
			         "action" : {"url":"http://www.cab.latech.edu/public/","target":"_blank", "title":"Louisiana Tech" }	
				},
				{"text": "Education",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}
				 },
			         "action" : {"url":"http://www.latech.edu/Education","target":"_blank", "title":"Louisiana Tech" }	
				},
				{"text": "Engineering and Science",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}
				 },
			         "action" : {"url":"http://www.latech.edu/tech/engr","target":"_blank", "title":"Louisiana Tech" }	
				},
				{"text": "Liberal Arts",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}
				 },
			         "action" : {"url":"http://www.latech.edu/tech/liberal-arts/","target":"_blank", "title":"Louisiana Tech" }	
				},
				{"text": "Graduate School",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}
				 },
			         "action" : {"url":"http://www.latech.edu/graduateschool.","target":"_blank", "title":"Louisiana Tech" }	
				},
				{"text": "Library",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}
				 },
			         "action" : {"url":"http://www.latech.edu/tech/library/","target":"_blank", "title":"Louisiana Tech" }	
				},
				{"text": "Research",
				 "style" :
				 {"imgitem":{ "src":"http://ans.latech.edu/img/remove16.gif", "width":16, "height":16}
				 },
			         "action" : {"url":"http://www.latech.edu/research/","target":"_blank", "title":"Louisiana Tech" }	
                }		 	
		  	  ]
		   }
		},
		{ "text":"Details" ,
 	  	  "style": {
				"bgimg":"http://ans.latech.edu/img/1x1.gif",
				"imgdir":{ "src":"http://ans.latech.edu/img/add.gif", "width":24, "height":24}
		    },
		  "menu": {
		  	"style": {
				"css"	:"bartext2",
				"size":[150,29],
				"bgcolor":"#D8D8DA",
				"border":{"color":"#666666","width":1},
				"bgimg":"",
				"itemoffset":{ "x":5, "y":2 }
				 },
			"itemover" : {
	 			      "imgendon": "",
				      "imgendoff":"",
				      "bgcolor":"#C8C8CA",
				      "size":[150, 22]
			             },
			"items": [{"text":"[ <i>Empty</i> ]"}]
		  }
		}
	]
};
function printthis(sourceID)
{
   var printWindow = window.open("", "printVersion", "menubar,scrollbars,width=560,height=480,top=0,left=0");
   var content ="<html><head>";
   content +="<title>"+document.title+"</title>";
   content +="<link rel=stylesheet href=\"http://ans.latech.edu/ans-style-new.css\" type=\"text/css\">";
   content +="</head><body>";
   content +=document.getElementById(sourceID).innerHTML;
   content +="</body></html>";
   printWindow.document.write('<span style=font-size:16pt;color:#666666>'+document.title+'</span><br><br>');
   printWindow.document.write(content);
   printWindow.document.close();
   printWindow.focus();
   printWindow.print();
   printWindow.close();
};
var banner = 1,
Rotation = 8000;

function GoBanner()
{					
    if (banner==1) window.location.href="";
	if (banner==2) window.location.href="natres.html";
	if (banner==3) window.location.href="mailto:ANSmail@ans.latech.edu";
}
function rotate()
{
	if (banner > 2) Rotation = 6000;
    if (++banner > 17)
	{
		banner = 1;
		Rotation = 8000;
	}
    document.images["banner"].src = "http://www.ans.latech.edu/banners/banner" + banner + ".gif";
    window.setTimeout('rotate();',Rotation);
}
var details=0;
function addDetail(html,url)
{
    if (url!="")
    {
        BarDef.items[2].menu.items[details++] = {"text":html,"action":{"url":url}};
    }
    else
    {
        BarDef.items[2].menu.items[details++] = {"text":html};
    }
}
function printTitle(title)
{
    if (parseInt(title))
    {
        document.write(links[title].Title);
        document.title="College of Applied and Natural Sciences :: "+links[title].Title;
    }
    else
    {
        document.write(title);
        document.title="College of Applied and Natural Sciences :: "+title;
    }
}
