function RankSwitch(tab){
	if(navigator.userAgent.indexOf("MSIE") != -1){
		//alert("this is MSIE");
	}else{
	tab1 = document.getElementById("tab1");
	tab2 = document.getElementById("tab2");
	tableA = document.getElementById("tableA");
	tableB = document.getElementById("tableB");
	}
	switch(tab){
		case 1:
		tab1.src = "images/rankTab01_a.gif";
		tab2.src = "images/rankTab02.gif";
		tableA.style.display = "block";
		tableB.style.display = "none";
		break;
		case 2:
		tab1.src = "images/rankTab01.gif";
		tab2.src = "images/rankTab02_a.gif";
		tableA.style.display = "none";
		tableB.style.display = "block";
		break;
	}
}

function clearTxt(defvalue){
	obj = document.getElementById("inputText");
	if(obj.value == defvalue){
		obj.value = "";
		obj.style.color = "#000000";
	}else{
		obj.style.color = "#000000";	
	}
}

function retrunTxt(defvalue){
	obj = document.getElementById("inputText");
	if(obj.value == ""){
		obj.value = defvalue;
		obj.style.color = "#999999";
	}
}
function checkDate(year, month, day) {
    var dt = new Date(year, month - 1, day);
    if(dt == null || dt.getFullYear() != year || dt.getMonth() + 1 != month || dt.getDate() != day) {
        return false;
    }
    return true;
}
function checkDateForSelectMenu(e_year, e_month, e_day, emsg) {
	var val_year  = $('#' + e_year).val();
	var val_month = $('#' + e_month).val();
	var val_day   = $('#' + e_day).val();

	if((val_year == null || val_year == 0 || val_year == '') &&
	   (val_month == null || val_month == 0 || val_month == '') &&
	   (val_day == null || val_day == 0 || val_day == '')){
		return true;
	}else if((val_year == null || val_year == 0 || val_year == '') ||
	   		 (val_month == null || val_month == 0 || val_month == '') ||
	   		 (val_day == null || val_day == 0 || val_day == '')){
		alert(emsg);
		return false;
	}
	if(!checkDate(val_year, val_month, val_day)){
		if(emsg != null || emsg != ''){
			alert(emsg);
		}
		return false;
    }
    return true;
}


function newUp(y, m, d, c) {
  delDay = 7; // 何日後に削除するか
  oldDay = new Date(y + "/" + m + "/" +d);
  newDay = new Date();
  d =(newDay - oldDay) / (1000 * 24 * 3600);
  if(d <= delDay) {
    // 大Newマーク
    if(c == "newbig") document.write("<IMG src='/images/misc/dl_new01.gif' border='0'>");
    // 小Newマーク
    if(c == "newsmall") document.write("<IMG src='/images/misc/dl_new02.gif' border='0'>");
  }
}

//================================================
//■ポップアップ
//================================================

function subWin(url,winName,features) { 
  window.open(url,winName,features);
}


