
//サイズ設定
function size_set(d){
	$.cookie('size',d,{ expires: 30, path: '/' });
}
//セーフモード
function safe_mode(d){
	$.cookie('safe',d,{ expires: 30, path: '/' });
}
//厳選モード
function excellent_mode(d){
	$.cookie('excellent',d,{ expires: 30, path: '/' });
}
//ヘッダの固定
function headline_fixed(d){
	$.cookie('fixed',d,{ expires: 30, path: '/' });
}
//言語変更
function lang_change(){
	var l = document.getElementById("lang");
	if(l.value == "ja"){
		location.href = location.href.replace(/\.com\/..\/n\//, ".com/n/");
	}else if(location.href.match(/\.com\/n\//)){
		location.href = location.href.replace(/\.com\/n\//, ".com/" + l.value + "/n/");
	}else{
		location.href = location.href.replace(/\.com\/..\/n\//, ".com/" + l.value + "/n/");
	}
}
//レコメンド表示
function recommend_more(){
	var d = document.getElementById("recommend_more");
	if(d.style.display != "none"){
		d.style.display = "none";
	}else{
		d.style.display = "block";
	}
}

//見つかった画像の処理
var image_count = 0;
function found_image(){
	image_count++;
	document.getElementById("img_count").innerHTML = image_count;
}
//エラー画像の処理
function error_image(url,img_no){
	document.getElementById(img_no).style.display='none';
}
//削除処理
function delete_image(url,img_no){
	document.getElementById(img_no).style.display='none';
}
//取り置き処理
var win_open = 0;
var torioki_no = 0;
function torioki(url,img_no,appear_width){
	torioki_no++;
	var h = "<div id='" + torioki_no + "' class='imagebox' style='width:" + appear_width + "px;'>";
	h = h + document.getElementById(img_no + "_inner").innerHTML;
	h = h + "［<a href='javascript:void(0);' onclick=";
	h = h + "'document.getElementById(" + torioki_no + ").style.display=\"none\"'>×</a>］</div>";
	if(win_open > 0 && !(torioki_win.closed)){
		torioki_win.document.getElementById('field').innerHTML += h;
	}else{
		torioki_win = window.open('','torioki_win');
		win_open = 1;
		torioki_win.document.open();
		var hh = "<html><link rel='stylesheet' href='/css.css' /><body><div id='field'></div><script src='/main.js'></script></body></html>";
		torioki_win.document.write(hh);
		torioki_win.document.getElementById('field').innerHTML += h;
		torioki_win.document.close();
	}
	torioki_win.document.close();
}
//フォーム送信
function submit_go(lang){
	key = encodeURI(document.keywords.elements[0].value);
	if(lang != 'ja' && lang){
		location.href = "http://" + location.hostname + "/" + lang + "/n/" + key;
	}else{
		location.href = "http://" + location.hostname + "/n/" + key;
	}
	return false;
}
