var br;

if(navigator.appName=='Microsoft Internet Explorer'){
 	br = true;
}else{
	br = false;
}


function showPulldown(){
	$("reliability").show();
}

function hidePulldown(){
	$("reliability").hide();
}

function pulldownInit(){
	$("speed-accuracy").hide();
	$("reliability").hide();
	$("creative-options").hide();
	$("image-quality").hide();
	$("operability").hide();
	
	setPulldown();
	
}

function setPulldown(){
	/* speed-accuracy */
	if( $("g-navi-1").classNames() != "current" ){
		Event.observe($("g-navi-1"),
						"mouseover",
						function(){
								$("g-navi-img-1").setAttribute("src", $("g-navi-img-1").getAttribute("src").replace("_d.", "_o."));
								$("speed-accuracy").show();
						},
						false);
		Event.observe($("g-navi-1"),
						"mouseout",
						function(){
							$("g-navi-img-1").setAttribute("src", $("g-navi-img-1").getAttribute("src").replace("_o.", "_d."));
							$("speed-accuracy").hide();
						},
						false);
	}
	/* reliability */
	if( $("g-navi-2").classNames() != "current" ){
		Event.observe($("g-navi-2"),
						"mouseover",
						function(){
							$("g-navi-img-2").setAttribute("src", $("g-navi-img-2").getAttribute("src").replace("_d.", "_o."));
							$("reliability").show();
						},
						false);
		Event.observe($("g-navi-2"),
						"mouseout",
						function(){
							$("g-navi-img-2").setAttribute("src", $("g-navi-img-2").getAttribute("src").replace("_o.", "_d."));
							$("reliability").hide();
						},
						false);
	}
	
	/* creative-options */
	if( $("g-navi-3").classNames() != "current" ){
		Event.observe($("g-navi-3"),
						"mouseover",
						function(){
							$("g-navi-img-3").setAttribute("src", $("g-navi-img-3").getAttribute("src").replace("_d.", "_o."));
							$("creative-options").show();
						},
						false);
		Event.observe($("g-navi-3"),
						"mouseout",
						function(){
							$("g-navi-img-3").setAttribute("src", $("g-navi-img-3").getAttribute("src").replace("_o.", "_d."));
							$("creative-options").hide();
						},
						false);
	}
	
	/* image-quality */
	if( $("g-navi-5").classNames() != "current" ){
		Event.observe($("g-navi-5"),
						"mouseover",
						function(){
							$("g-navi-img-5").setAttribute("src", $("g-navi-img-5").getAttribute("src").replace("_d.", "_o."));
							$("image-quality").show();
						},
						false);
		Event.observe($("g-navi-5"),
						"mouseout",
						function(){
							$("g-navi-img-5").setAttribute("src", $("g-navi-img-5").getAttribute("src").replace("_o.", "_d."));
							$("image-quality").hide();
						},
						false);
	}
	
	/* operability */
	if( $("g-navi-6").classNames() != "current" ){
		Event.observe($("g-navi-6"),
						"mouseover",
						function(){
							$("g-navi-img-6").setAttribute("src", $("g-navi-img-6").getAttribute("src").replace("_d.", "_o."));
							$("operability").show();
						},
						false);
		Event.observe($("g-navi-6"),
						"mouseout",
						function(){
							$("g-navi-img-6").setAttribute("src", $("g-navi-img-6").getAttribute("src").replace("_o.", "_d."));
							$("operability").hide();
						},
						false);
	}
}


function smartRollover() {
	
	pulldownInit();
	
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		
		for(var i=0; i < images.length; i++) {
			
			if(br){
				var className = images[i].getAttribute("className");
			}else{
				var className = images[i].getAttribute("class");
			}
			//var fg = images[i].getAttribute("src").match("_d.");
			
			if(images[i].getAttribute("src") != null){
				var fg = images[i].getAttribute("src").match("_d.");
			}
			
			if(fg)
			{
					if(className != "current"){
						images[i].onmouseover = function() {
							this.setAttribute("src", this.getAttribute("src").replace("_d.", "_o."));
						}
						images[i].onmouseout = function() {
							this.setAttribute("src", this.getAttribute("src").replace("_o.", "_d."));
						}
					}
			}
			
			
			
		}
		
	}
	
}

try{
	window.addEventListener("load", smartRollover, false);
}catch(e){
	window.attachEvent("onload", smartRollover);
}
