document.writeln('<link rel="stylesheet" type="text/css" href="/common/style/clobber.css" media="all" />');

jQuery.fn.accordion = function(elem){
	var obj = jQuery(elem).next();
	(jQuery(obj).attr("class") == "accordionContent") ? jQuery(obj).attr("class", "accordionContentOpen") : jQuery(obj).attr("class", "accordionContent");
	//(jQuery(obj).css("display") == "block") ? jQuery(obj).css("display", "none") : jQuery(obj).css("display", "block");
}
jQuery.fn.objectOffsetTop = function(elem){
	return jQuery(elem).offset().top;
}

jQuery(function(){
	var closeImage = new Image();
	closeImage.src = "/common/images/share_btn_05.gif";
	jQuery('p.accordionBtn img').each(function(){
		this.dSrc = this.src;
		this.cSrc = closeImage.src;
	});
	jQuery('p.accordionBtn img').bind("click", function(){
		if (this.src == this.dSrc) {
			this.src = this.cSrc;
			this.alt = "close";
		}else {
			this.src = this.dSrc;
			this.alt = "open";
		}
		jQuery(this).accordion(this.parentNode.parentNode);
	});
	var hash = location.hash;
	if(hash != ""){
		var h = (document.all) ? 10 : 40;
		var h2anc = hash.split('-')[0];
		var h3anc = hash.split('-')[1];
			jQuery(h2anc).each(function(){
				var obj;
				if(document.all){
					obj = this.parentNode.nextSibling.firstChild;
				}else{
					obj = this.parentNode.nextSibling.nextSibling.firstChild;
					h = 60;
				}
				if (obj.src == obj.dSrc) {
					obj.src = obj.cSrc;
					obj.alt = "close";
				}else {
					obj.src = obj.dSrc;
					obj.alt = "open";
				}
				jQuery(obj).accordion(obj.parentNode.parentNode);
			});
			jQuery('html, body').animate({scrollTop: objectOffsetTop(hash) - h}, 500, "easeOut");
		if(h3anc == undefined){

		}else{
			
		}
	}else{
		jQuery('div.accordionContent').each(function(){
			jQuery(this).show();
			var obj;
			if(document.all){
				obj = this.previousSibling.childNodes[1].firstChild;
			}else{
				obj = this.previousSibling.previousSibling.childNodes[3].firstChild;
			}
			if (obj.src == obj.dSrc) {
				obj.src = obj.cSrc;
				obj.alt = "close";
			}else {
				obj.src = obj.dSrc;
				obj.alt = "open";
			}			
		})
	}
});