/** =============================================================
ddaccordion.js
============================================================ **/

ddaccordion.init({
	headerclass: "inner-head", //Shared CSS class name of headers group
	contentclass: "inner", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["suffix", "<img src='/common/img/arrow-under.gif' alt='under' />", "<img src='/common/img/arrow-up.gif' alt='up' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})

ddaccordion.init({
	headerclass: "third", //Shared CSS class name of headers group
	contentclass: "forth", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: false, //persist state of opened contents within browser session?
	toggleclass: ["close", "open"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["suffix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})



$(function(){
	$(".search-result tr,div.list-ex dl,.detail tr").hover(function(){
		$(this).addClass("hover");
	},function(){
		$(this).removeClass("hover");
	});

	$('div.list-ex dl').flatHeights();


	// search box open & close
	$("#main p#switchBtn img").hover(function(){
		$(this).animate({opacity:0.65},{duration:200,queue:false});
	},function(){
		$(this).animate({opacity:1},{duration:200,queue:false});
	});

	if($.browser.msie && $.browser.version == 8 ){
		$("#switchBtn img").toggle(function(){
			$("#searchBox").fadeOut(300,function(){
				if(location.hash){
					var pageHash = location.hash;
					var slidingTarget = $.support.boxModel ? navigator.appName.match(/Opera/) ? "html" : "html,body" : "body";
					var hashPos = $(pageHash).offset().top +"px";
					$(slidingTarget).animate({scrollTop:hashPos},0);
				}
			}).addClass("close");
			$(this).attr("src","/product/img/btn_form_open.gif");
		},function(){
			$("#searchBox").fadeIn(300).removeClass("close");
			$(this).attr("src","/product/img/btn_form_close.gif");
		});
	}else{
		$("#switchBtn img").toggle(function(){
			$("#searchBox").slideUp(300,function(){
				if(location.hash){
					var pageHash = location.hash;
					var slidingTarget = $.support.boxModel ? navigator.appName.match(/Opera/) ? "html" : "html,body" : "body";
					var hashPos = $(pageHash).offset().top +"px";
					$(slidingTarget).animate({scrollTop:hashPos},0);
				}
			}).addClass("close");
			$(this).attr("src","/product/img/btn_form_open.gif");
		},function(){
			$("#searchBox").slideDown(300).removeClass("close");
			$(this).attr("src","/product/img/btn_form_close.gif");
		});
	}

	if($("#searchBox.close").length && $("#main .error").length != 1){
		$("#switchBtn img").trigger("click");
	}

	if($.browser.msie && $.browser.version <= 6 ){
		$("td:empty").text(" ");
	}

});

$.fn.inquiryPopUp = function(){
	$(this).click(function(e){
		var targetURL = $(this).attr('href');
		window.open(targetURL,'theWin','scrollbars=1,width=730,resizable=0,directories=0,toolbar=0,status=0,location=0');
		return false;
	});
};


$(function(){
	$('#contents p.button button').hover(function(){
		$(this).addClass('hover');
	},function(){
		$(this).removeClass('hover');	
	});
});













