
$(function() {
	$("#nav").addClass("dynamic");
	$("#nav ul li").hover(
	  function () {
		$(this).find("ul").addClass("hover");
	  },
	  function () {
		$(this).find("ul").removeClass();
	  });
});


/**
* Scroll inside page
*/
$(document).ready(function(){
  $('a[href*=#]').click(function() {
	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	&& location.hostname == this.hostname) {
	  var $target = $(this.hash);
	  $target = $target.length && $target
	  || $('[name=' + this.hash.slice(1) +']');
	  if ($target.length) {
		var targetOffset = $target.offset().top;
		$('html,body').animate({scrollTop: targetOffset}, 300);
	   return false;
	  }
	}
  });
});


/**
* External Links
*/
$(function() {
	$("a[@href^='http']").click(function(){window.open(this.href); return false;});
	$("#output #contents .data a[@href^='http']").addClass("extLink");
	$("#newsrelease #contents li a[@href^='http']").addClass("extLink");
	$("#corporate #contents a[@href^='http']").addClass("extLink");
	$("#main #subFooter .ext a[@href^='http']").addClass("extLink");
	$("#logic #contents a[@href^='http']").addClass("extLink");

});


/**
* Map
*/
$(function() {
	$("#gMap").addClass("showMap");
	$("#map").addClass("hideMap");

});

/**
 * input_value
 */

function clearDefaultValue(trg){
	if(trg.defaultValue == trg.value){
		trg.value = '';
		trg.style.color = '#666';
	}
}

function setDefaultValue(trg){
	if(trg.value == ""){
		trg.value = trg.defaultValue;
		trg.style.color = '#ccc';
	}
}