﻿// JScript File

// JScript File

function getObj(id) {
	if(document.layers) {
		return document.layers[id];
	} else if(document.all) {
		return document.all[id];
	} else if(document.getElementById) {
		return document.getElementById(id);
	}
} 

$(document).ready(function() {
    $("img.navitem").mouseover(function(){
		var name = $(this).attr("name");
		$(this).attr("src", "media/images/" + name + "-over.gif");
	});
	$("img.navitem").mouseout(function(){
		var name = $(this).attr("name");
		$(this).attr("src", "media/images/" + name + "-off.gif");
    });
    $("img.navitemon").mouseover(function(){		
		var name = $(this).attr("name");
		$(this).attr("src", "media/images/" + name + "-over.gif");
		});
	$("img.navitemon").mouseover(function(){
		var name = $(this).attr("name");
		$(this).attr("src", "media/images/" + name + "-on.gif");
		});
	$("img.navitemon").mouseout(function(){
		var name = $(this).attr("name");
		$(this).attr("src", "media/images/" + name + "-on.gif");
    });
    $("img.navitem").click(function(){		
		var name = $(this).attr("name");
		$("img#toolkitphoto").attr("src", "media/images/" + "slide-" + name + ".jpg");	
		$("img.navitemon").removeClass("navitemon");
		$(this).removeClass("navitem");	
		$(this).addClass("navitemon");
		$(this).attr("src", "media/images/" + name + "-on.gif");		
    });

	function SubmitSearch()
	{
		var term = getObj('ct100_Header1_SearchTerm').value;
		window.location = "http://lc.chiomega.com/search.aspx?search=" + term;
	}

	function disableEnterKey(e)
	{
		 var key;

		 if(window.event)
			  key = window.event.keyCode;     //IE
		 else
			  key = e.which;     //firefox

		 if(key == 13)
		 {
			SubmitSearch()
			return false;
		 }     
		 else
		 {
			return true;
		 }
	}
});

function Change(type, mode, path)
        {	
				var html = "";
				if (mode == "add")
				{
					html = getObj(type + "Hold").innerHTML;
					html = html + "<img src=\"" + path + "\"/><br/>";
					alert(html);
				}
				else
				{
					html = "<img src=\"" + path + "\"/>";
				}
				getObj(type + "Hold").innerHTML = html;				
		}

		function OpenWindow(path)
		{
			var theWin = window.open('' + path + '',null,'height=500,width=483,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes');
			theWin.opener = self;
		}

