function popup(url){
	target = "ladies/"+url+"/data.html";
	window.open(target,'','toolbar=no,Width=700,Height=500,left=0,top=0');
}

function couponOpen(){
	return;
	//window.open('coupon.html','','toolbar=no,Width=380,Height=148,left=0,top=0');
}

function smartPhoneRedirect(){

	var career = new Array("iPhone",  			// Apple iPhone
							"iPod", 			// Apple iPod touch
							"incognito", 		// Other iPhone browser
							"webmate", 			// Other iPhone browser
							"Android", 			// 1.5+ Android
							"dream", 			// Pre 1.5 Android
							"CUPCAKE", 			// 1.5+ Android
							"blackberry9500",	// Storm
							"blackberry9530",	// Storm
							"blackberry9520",	// Storm v2
							"blackberry9550",	// Storm v2
							"blackberry 9800",	// Torch
							"webOS",			// Palm Pre Experimental
							"s8000", 			// Samsung Dolphin browser
							"bada",				// Samsung Dolphin browser
							"Googlebot-Mobile"	// the Google mobile crawler
						);

	var user = navigator.userAgent;
	
	for(i=0;i<career.length;i++){
		
		if(user.indexOf(career[i]) != -1){
			
			var btn = document.createElement("div");
			btn.style.fontFamily = 'Meiryo,"ヒラギノ角ゴ Pro W3","Hiragino Kaku Gothic Pro W3","ＭＳ Ｐゴシック",sans-serif';
			btn.style.fontSize = "36px";
			btn.style.cursor = "pointer";
			btn.style.textAlign = "center";
			btn.style.margin = "0";
			btn.style.padding = "0";
			btn.style.fontWeight = "bold";
			btn.style.width = "100%";
			btn.style.height = "100px";
			btn.style.lineHeight = "100px";
			btn.style.color = "#ffffff";
			btn.style.whiteSpace = "nowrap";
			btn.style.textShadow = "0px -1px 1px #000000";
			btn.style.border = "solid 1px #000000";
			btn.style.background = "-webkit-gradient(linear, left top, left bottom, from(#ffcc00), to(#5e4b00))";
			
			btn.innerHTML = 'スマートフォン版はコチラ';
			
			btn.onclick = function(){
				
				document.cookie = "mode=sp;path=/;";
				
				host_name = location.host;
				now_url = location.href;
				urlArray = now_url.split(host_name);
				spURL = urlArray.join(host_name+"/sp");
				spURL = spURL.replace(".html","/");

				location.href = spURL;
			}
			document.body.insertBefore(btn,document.body.firstChild);
			
			break;
		}
	}
	return;

}


function init(){
	smartPhoneRedirect();
}

// ページの構築が完了したらloadを呼び出す
setOnLoad();
function setOnLoad(){

	var userAgent = navigator.userAgent.toLowerCase();
	
	if(document.addEventListener){ // opera,safari,mozilla向け
		document.addEventListener("DOMContentLoaded", init, false);
	} else if(/msie/.test(userAgent)){ // IE向け
		try {
			document.documentElement.doScroll("left");
		} catch(error){
			setTimeout(arguments.callee, 0);
			return;
		}
		init();
	} else { // その他
		window.onload = init;
	}
}

