/**
 * 別ウィンドウ表示
 */
function popUp(url){
	url = url.replace('[s]', "https://");
	url = url.replace('[p]', "http://");
	url = url.replace('[w]', "www.");
	url = url.replace('[j]', ".jp");
	url = url.replace('[h]', ".html");
	window.open(url, 'newwin');
	return false;
}
/**
 * カレンダ取得
 */
function getCalendar(PrefCd, CategoryCd, GenreCd, Month) {
	var domain  = document.getElementById('domain').value;
	var url = 'http://' + domain + '/calendar.php';
	$.ajax({
		url: url,
		type: 'POST',
		timeout: 10000,
		data: 'pref_cd=' + PrefCd + '&category_cd=' + CategoryCd + '&genre_cd=' + GenreCd + '&month=' + Month,
		success: function(rtn) {
			$("#calendar").html(rtn);
		}
	});
}
/**
 * ニュース取得
 */
function getNewsDataList(url) {
	location.href = url;
	return false;
}
//function getNewsPage(url){
//	url = url.replace('[s]', "https://");
//	url = url.replace('[p]', "http://");
//	url = url.replace('[w]', "www");
//	url = url.replace('[h]', ".html");
//	window.open(url, 'newwin');
//	return false;
//}
/**
 * ボタン処理(ニュース)
 */
function onMail(frm, url) {
	$("#m").val(url);
	frm.submit();
	return false;
}
/**
 * 天気予報取得
 */
function getWeather() {
	var domain  = document.getElementById('domain').value;
	var weather  = document.getElementById('weather').value;
	var url = 'http://' + domain + '/weather.php';
	if (weather=='') {
		return false;
	}
	$.ajax({
		url: url,
		type: 'POST',
		timeout: 10000,
		data: 'city=' + weather + '&day=today',
		success: function(rtn) {
			$("#today_s").remove();
			$("#today").html(rtn);
		}
	});
	
	$.ajax({
		url: url,
		type: 'POST',
		timeout: 10000,
		data: 'city=' + weather + '&day=tomorrow',
		success: function(rtn) {
			$("#tomorrow_s").remove();
			$("#tomorrow").html(rtn);
		}
	});
}
/**
 * 検索ボタン処理
 */
function searchSite() {
	var word = $("#form_txt").val();
	var str = word.replace(/^\s+|\s+$/g, "");
	if (str == '') {
		alert('検索ワードを入力してください');
		return false;
	}
	var pref  = $("#pref_noapply").val();
	var genre = $("#date_month2").val();
	var domain  = document.getElementById('domain').value;
	var url = 'http://' + domain + '/word.php';
	$.ajax({
		url: url,
		type: 'POST',
		timeout: 10000,
		data: 'pref_s=' + pref + '&genre_s=' + genre + '&word_s=' + word,
		success: function(rtn) {
			var url = 'http://' + rtn + $("#searchresult").val() + word + '/1/';
			location.href = url;
			return false;
		}
	});
}
/**
 * 検索ボタン処理
 */
function search() {
	var word = $("#side_form_txt").val();
	var str = word.replace(/^\s+|\s+$/g, "");
	if (str == '') {
		alert('検索ワードを入力してください');
		return false;
	}
	var domain   = document.getElementById('domain').value;
	var category = document.getElementById('category_cd').value;
	var url = 'http://' + domain + '/word.php';
	var result = $("#searchresult").val() +word + '/1/';
	$.ajax({
		url: url,
		type: 'POST',
		timeout: 10000,
		data: 'domain_s=' + domain + '&category_s=' + category + '&word_s=' + word,
		success: function(rtn) {
			var url = 'http://' + domain + $("#searchresult").val() + word + '/1/';
			location.href = result;
			return false;
		}
	});
}
/**
 * 位置移動
 */
function setPos(url) {
	var sPos = document.getElementById("pos").value;
	if (sPos.length > 0) {
		location.href = "#pos"+sPos;
	}
	return false;
}
/**
 * カウントアップ
 */
function updCount(shopid, paiddiv, href) {
	var domain  = document.getElementById('domain').value;
	var url = 'http://' + domain + '/countup.php';
	$.ajax({
		url: url,
		type: 'POST',
		timeout: 10000,
		data: 'shop_id=' + shopid + '&paid_div=' + paiddiv,
		success: function(rtn) {
			location.href = href;
			return false;
		}
	});
}
/**
 * ジャンルプルダウン取得(初回)
 */
//jQselectable.jsに

