if(navigator.userAgent.indexOf("Mac")!=-1){ 
	document.write("<link rel='stylesheet' type='text/css' href='https://b-promotion.jp/css/mac.css' />"); 
} else { 
	document.write("<link rel='stylesheet' type='text/css' href='https://b-promotion.jp/css/win.css' />"); 
} 

function mg_submit_check(no){
	var msg='';
	if (no == 1){ msg= 'このプロモーションへ参加申請の申込みをしますか？'; }
	if (no == 2){ msg= 'このプロモーションの評価及び投稿報告を送信します\nよろしいですか？'; }

	if (confirm(msg)){	
		return true 
	}else{
		return false 
	}
}


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}


function mg_agreement(obj){
	if (obj.agreement[0].checked == false){
		alert("利用規約への同意が必要です。");
		return false;
	}else{
		return true;
	}
}

function getCookie(key){
	tmp=document.cookie+";";
	tmp1=tmp.indexOf(key, 0);
	if(tmp1!=-1){
		tmp=tmp.substring(tmp1, tmp.length);
		start=tmp.indexOf("=", 0)+ 1;
		end=tmp.indexOf(";", start);
		return(unescape(tmp.substring(start, end)));
	}
	return("");
}

function mg_delcheck(){
		if ( confirm('削除します。宜しいですか？')){	
			return true 
		}else{
			return false 
		}
}

function mg_wopen_wh(url,gWindowWidth,gWindowHeight) {
	var st = 'width=' + gWindowWidth;
	st += ',';
	st += 'height=' + gWindowHeight;
	st += ',';
	var cw = (screen.width / 2) - (gWindowWidth / 2);
	var ch = (screen.height / 2) - (gWindowHeight / 2);
	if (navigator.userAgent.indexOf('MSIE') != -1) {
		st += 'left=' + cw;
		st +=',';
		st += 'top=' + ch;
	}else if (navigator.userAgent.indexOf('Mozilla') != -1) {
		st += 'screenX=' + cw;
		st += ',';
		st += 'screenY=' + ch;
	}
	st += "resizable=yes, scrollbars=yes, menubar=yes, directories=0, status=0, location=0";
	newwindow = window.open(url, 'sub', st);
	newwindow.focus();
}

function mg_pallet(url) {
	var gWindowWidth  = 380;
	var gWindowHeight = 60;
	var st = 'width=' + gWindowWidth;
	st += ',';
	st += 'height=' + gWindowHeight;
	st += ',';
	var cw = (screen.width / 2) - (gWindowWidth / 2);
	var ch = (screen.height / 2) - (gWindowHeight / 2);
	if (navigator.userAgent.indexOf('MSIE') != -1) {
		st += 'left=' + cw;
		st +=',';
		st += 'top=' + ch;
	}else if (navigator.userAgent.indexOf('Mozilla') != -1) {
		st += 'screenX=' + cw;
		st += ',';
		st += 'screenY=' + ch;
	}
	st += "resizable=0, scrollbars=0, menubar=0, directories=0, status=0, location=0";
	newwindow = window.open(url, 'prof', st);
	newwindow.focus();
}

function pWin(wUrl,wName,wProp) {
	newWin = window.open(wUrl,wName,wProp);
	newWin.focus();
}