/* MENU onMouse */
menuGif=16;

menuGifBox=new Array(
"/img_cmn/me_top.gif", //0
"/img_cmn/me_top_act.gif", //1
"/img_cmn/me_home.gif", //2
"/img_cmn/me_home_act.gif", //3
"/img_cmn/me_car.gif", //4
"/img_cmn/me_car_act.gif", //5
"/img_cmn/me_card.gif", //6
"/img_cmn/me_card_act.gif", //7
"/img_cmn/me_omatome.gif", //8
"/img_cmn/me_omatome_act.gif", //9
"/img_cmn/me_others.gif", //10
"/img_cmn/me_others_act.gif", //11
"/img_cmn/me_business.gif", //12
"/img_cmn/me_business_act.gif", //13
"/img_cmn/me_education.gif", //14
"/img_cmn/me_education_act.gif" //15
);

menuImg=new Array(menuGif);
for (i=0;i<menuGif;i++){
menuImg[i]=new Image();menuImg[i].src=menuGifBox[i];
}
function menuChange(menuButNo,menuBoxNo){
document.images["menuBut"+menuButNo].src=menuImg[menuBoxNo].src;
}


/* ABOUT onMouse */
aboutGif=6;

aboutGifBox=new Array(
"/about/img/m_g_sagasu.gif", //0
"/about/img/m_g_sagasu_act.gif", //1
"/about/img/m_g_kuraberu.gif", //2
"/about/img/m_g_kuraberu_act.gif", //3
"/about/img/m_g_moshikomu.gif", //4
"/about/img/m_g_moshikomu_act.gif" //5
);

aboutImg=new Array(aboutGif);
for (i=0;i<aboutGif;i++){
aboutImg[i]=new Image();aboutImg[i].src=aboutGifBox[i];
}
function aboutChange(aboutButNo,aboutBoxNo){
document.images["aboutBut"+aboutButNo].src=aboutImg[aboutBoxNo].src;
}

function openBlanketOrder(i,refname,siteType) {
	param = "";
	if (refname != null && refname != "") {
		param = "&from=" + refname;
	}
	if (siteType != null && siteType != "") {
		param = param + "&siteType=" + siteType;
	}

	openfname = "http://m.eloan.co.jp/pc/loan.jsp?loanType=" + i + param;
	openfunc = window.open(openfname,"mb");
//	openfunc = window.open(openfname,"mb","WIDTH=600,HEIGHT=600,MENUBAR=0,SCROLLBARS=1,TOOLBAR=0,STATUS=1,DIRECTORIES=0,RESIZABLE=1");
	openfunc.focus();
}


//廃止予定---使用しないでください。
function mb(i,refname) {
	if (refname == null) referer = "";
	else {referer = "&from=" + refname;}
	openfname = "http://m.eloan.co.jp/pc/loan.jsp?loanType=" + i + referer;
	openfunc = window.open(openfname,"mb","WIDTH=600,HEIGHT=600,MENUBAR=0,SCROLLBARS=1,TOOLBAR=0,STATUS=1,DIRECTORIES=0,RESIZABLE=1");
	openfunc.focus();
}

function popup_size(w,h,openfname) {
	args = "WIDTH=" + w + ",HEIGHT=" + h + ",MENUBAR=1,SCROLLBARS=1,TOOLBAR=1,STATUS=1,DIRECTORIES=0,RESIZABLE=1";
	openfunc = window.open(openfname,"page",args);
	openfunc.focus();
}


// 2007/05/15 検索フォーム用スクリプト
function validateSearchWord(value) {
	if (value!=null && value.length!=0) {
		if (trim(value).length!=0 && value!="サイト内検索") {
			return true;
		}
	}

	return false;
}

function trim(value){ 
	var flg = 1; 

	// 先頭のスペースを取る 
	for (i=0; i<value.length; i++) { 
		if((value.substring(i, i+1) != ' ') && (value.substring(i, i+1) != '　')) { 
			value = value.substring(i, value.length+1); 
			flg = 0; break; 
		} 
	} 

	// 末尾のスペースを取る 
	for (i=value.length-1; i>=0; i--){  
		if((value.substring(i, i+1) != ' ') && (value.substring(i, i+1) != '　')) { 
			value = value.substring(0, i+1); 
			flg = 0; break; 
		} 
	} 

	// すべてスペースの場合はクリア 
	if (flg) { value = ''; } 

	return value; 
} 

// 検索ボックスの初期化
function InitializeSearchBox() {
	var t = document.getElementById("w");
	if (t) {
		t.default_value = "サイト内検索";
//		if (t.value=="") {
			t.value = t.default_value;
//		}

		if (t.addEventListener) {
			t.addEventListener('focus', focusTextBox, false);
			t.addEventListener('blur', leaveTextBox, false);
		} else if (t.attachEvent) {
			t.attachEvent('onfocus', focusTextBox);
			t.attachEvent('onblur', leaveTextBox);
		}
	}
}

function focusTextBox() {
	var t = document.getElementById("w");
	if (t) {
		if (t.value==t.default_value) {
			t.value="";
		}
		if (typeof(t.style) != 'undefined') {
//			t.style.width="180px";
//			t.style.height="16px";
//			t.style.paddingTop="3px";
//			t.style.paddingLeft="3px";
//   t.style.border="2px solid #063";
//			t.style.color="#000";
//			t.style.backgroundColor="#ffe";
		}
	}
}

function leaveTextBox() {
	var t = document.getElementById("w");
	if (t) {
		if (trim(t.value).length==0 || t.value==t.default_value) {
			t.value=t.default_value;
			if (typeof(t.style) != 'undefined') {
//				t.style.width="120px";
//				t.style.height="14px";
//	 		t.style.paddingTop="1px";
//			 t.style.paddingLeft="1px";
//    t.style.border="1px solid #999";
//				t.style.color="#666";
//			t.style.backgroundColor="#ffe//";
			}
		}
	}
}