/* =======================================

	Common Javascript

 -----------------------------------------
	INDEX
 -----------------------------------------
	
	Smooth Scroll

========================================== */

/* PNG
========================================== */

/*$(function(){ 
    $(document).ready(function(){
        $("div#Container").pngFix();
    });
});*/


/* Smooth Scroll
========================================== */
$(function(){ 
	
	$('a[href^=#]:not(a[href$=#])').click(function(){
		var href= this.hash;
		var $target = $(href == '#_top' ? 'body' : href);
		
		// アンカーリンクがあるページでだけ以下を実行
		if($target.size()){
			var top = $target.offset().top;
			$($.browser.safari ? 'body' : 'html').animate({scrollTop:top}, 500, 'swing');
		}
		return false;
	});
});



/* Cookie Script
==========================================
http://www.quirksmode.org/js/cookies.html
========================================== */
function createCookie(name,value,days){
   if (days){
   var date = new Date();
   date.setTime(date.getTime()+(days*24*60*60*1000));
   var expires = "; expires="+date.toGMTString();
   }
   else var expires = "";
   document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name){
   var nameEQ = name + "=";
   var ca = document.cookie.split(';');
   for(var i=0;i < ca.length;i++)
   {
   var c = ca[i];
   while (c.charAt(0)==' ') c = c.substring(1,c.length);
   if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
   }
   return null;
}


/* print
========================================== */
function pri(){
bz = window.navigator.userAgent;
if( (bz.indexOf("Mac") != -1) && (bz.indexOf("MSIE") != -1) ){
alert("このボタンはMacのIEには対応していません。\n恐れ入りますが、ブラウザのプリントボタンをお使いください。");
}else{
window.print();
}
}

/* Form
========================================== */
//フォームボタンCSS
function setOnColor(targetObj) {
	targetObj.style.color='#FFF';
	targetObj.style.border='none';
	targetObj.style.background='#666';
}
function setOffColor(targetObj) {
	targetObj.style.color='#FFF';
	targetObj.style.border='none';
	targetObj.style.background='#000';
}

//フォームボタンCSS　標準
function default_OnColor(targetObj) {
	targetObj.style.backgroundColor='#E2E2E2';
}
function default_OffColor(targetObj) {
	targetObj.style.backgroundColor='#fff';
}

/* ポップアップ
========================================== */
function pupup(url,width,height){
window.open(url,"","width="+width+",height="+height+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0").focus();
}

function pupup02(url,width,height){
window.open(url,"","width="+width+",height="+height+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes").focus();
}
