//Cookieが正しいかを判断する

//	alert("スクリプトは実行されているよ");

	strKey = getCookie("key");

//	alert(strKey);
	if (strKey != "sumitomo") {
//		location.href = "http://e-medicine.sumitomopharm.co.jp/e-medicine/";
//		location.href = "http://med.ds-pharma.co.jp/medicine/index.html";
		location.href = "http://ds-pharma.jp/medical/gakujutsu/index.html";
	}
	
function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}
