var ie
if(navigator.userAgent.indexOf("MSIE") != -1) {
	ie = true;
}
/*
//ページトップに戻る
function pageScroll(posi) {
	dist = posi / 6;
	nPos = parseInt(posi - dist);
	scrollTo(0,nPos);
	if (nPos > 0) {
		setTimeout("pageScroll(nPos)",10);
	}
}
*/	
function CloseWin(){
	window.close();
}
var __scroll = {sp:6, fps:16, timer:0};
function setScrollSp(sp) {
	if(typeof sp == "number") {
		this.__scroll.sp = sp;
	}
}
function setScrollFps(fps) {
	if(typeof fps == "number") {
		this.__scroll.fps = fps;
	}
}
function getScrollLeft() {
	if(navigator.userAgent.indexOf("MSIE") != -1) {
		return (document.compatMode=="CSS1Compat")?document.documentElement.scrollLeft:document.body.scrollLeft;
	} else {
		return (window.pageXOffset) ? window.pageXOffset : 0;
	}
}
function getScrollTop() {
	if(navigator.userAgent.indexOf("MSIE") != -1) {
		return (document.compatMode=="CSS1Compat")?document.documentElement.scrollTop:document.body.scrollTop;
	} else {
		return (window.pageYOffset) ? window.pageYOffset : 0;
	}
}
function pageScroll(toX, toY, cuX, cuY) {
	clearTimeout(this.__scroll.timer);
	toX = (!toX || toX < 0) ? 0 : toX;
	toY = (!toY || toY < 0) ? 0 : toY;
	cuX = (!cuX) ? 0 + getScrollLeft() : cuX;
	cuY = (!cuY) ? 0 + getScrollTop() : cuY;
	cuX += (toX - getScrollLeft()) / this.__scroll.sp; 
	cuY += (toY - getScrollTop()) / this.__scroll.sp; 
	if(cuX < 0) { cuX = 0; }
	if(cuY < 0) { 	 cuY = 0; 	 }
	window.scrollTo(Math.floor(cuX), Math.floor(cuY));
	if(Math.floor(cuX) != toX || Math.floor(cuY) != toY) {
			this.__scroll.timer = setTimeout("pageScroll("+toX+","+toY+"," +cuX+","+cuY+")",this.__scroll.sp);
	}
}
function js_scroll2xy(x,y){
	pageScroll(x,y);
	return false;
}
function fj_chgimg(id,fn){
	document.getElementById(id).src = fn;
}
function fj_submit(id){
//	document.getElementById(id).action = document.getElementById(id).action+'#content';
	document.getElementById(id).submit();
}
function fj_image_ini(arr){
	for(i=0;i<arr.length;i++){
		obj = document.getElementById('id_val_'+arr[i]);
		img = document.getElementById('id_img_'+arr[i]);
		if(obj.value == 0)img.style.display = 'inline';
		if(obj.value == 1)img.style.display = 'none';
		img = document.getElementById('id_img_'+arr[i]+'_on');
		if(obj.value == 0)img.style.display = 'none';
		if(obj.value == 1)img.style.display = 'inline';
	}
}
function fj_image_set(id){
	obj = document.getElementById('id_val_'+id);
	obj.value ^= 1;
	img = document.getElementById('id_img_'+id);
	if(obj.value == 0)img.style.display = 'inline';
	if(obj.value == 1)img.style.display = 'none';
	img = document.getElementById('id_img_'+id+'_on');
	if(obj.value == 0)img.style.display = 'none';
	if(obj.value == 1)img.style.display = 'inline';
}
function fj_jump_innerwear(id,val){
	document.getElementById('id_jump_listmode').value = 'item';
	document.getElementById('id_jump_brand').value = '';
	document.getElementById('id_jump_category').value = '';
	document.getElementById('id_jump_color').value = '';
	document.getElementById('id_jump_keyword').value = '';
	document.getElementById('id_jump_newitem').value = '';
	document.getElementById('id_jump_type').value = '';
	document.getElementById('id_jump_style').value = '';
	id = id.split("/");
	val = val.split("/");
	for(i=0;i<id.length;i++){
		obj = document.getElementById(id[i]);
		obj.value = val[i];
	}
}
function js_mailto(mode){
	uat = '';
	var osname = navigator.userAgent.toUpperCase();
	if(osname.indexOf("WIN") >= 0){
		uat = 'win';
	}
	if(osname.indexOf("MAC") >= 0){
		uat = 'mac';
	}
	if(mode == 'mobileurl'){
		msg = mt_mobileurl_head + mt_mobileurl_body;
	}
	if(mode == 'catalogue'){
		msg = mt_catalogue_head + mt_catalogue_body;
		if(osname.indexOf("OPERA") >= 0){
			alert('カタログ請求ありがとうございます。\n郵便番号、ご住所、ご氏名、電話番号を入力後、\nメール送信してください。');
			msg = mt_catalogue_head + mt_catalogue_body_oneline;
		}
	}
	if(uat == ''){
		alert('対応していないブラウザです。');
		return;
	}
	if(uat=='mac')while(msg.match('##'))msg = msg.replace('##',"%0D");
	if(uat=='win')while(msg.match('##'))msg = msg.replace('##',"%0D%0A");
	window.self.location.href = 'mailto:'+msg;
}

