//--------------------------------------------------------------
// Js from As
//--------------------------------------------------------------
function callExternalInterface(str) {
swfTarget("collection").callOuboEnd(str); 
}

//--------------------------------------------------------------
// Win or Mac
//--------------------------------------------------------------
function swfTarget(movie) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
	    return window[movie]
    } else {
	    return document[movie]
    }
}

//--------------------------------------------------------------
// init
//--------------------------------------------------------------
chk = getCookie("sendchk");

function getCookie(key){
    tmp = document.cookie+";";
    tmp1 = tmp.indexOf(key,0);
    if(tmp1 != -1){
        tmp = tmp.substring(tmp1,tmp.length);
        start = tmp.indexOf("=",0);
        end = tmp.indexOf(";",start);
        return(unescape(tmp.substring(start+1,end)));
    }
    return("");
}

function setCookie(){
	// set cookie
	d = new Date();
	d.setTime(d.getTime() + 60 * 24 * 60 * 60 * 1000); // 60日
	document.cookie = "sendchk=finish; pass=/; expires=" + d.toGMTString();
	callExternalInterface('finish');
}

function initOubo(){
	chk = getCookie("sendchk");
	if (chk == "finish"){
		callExternalInterface('finish');
	}else{
		callExternalInterface('notyet');
	}
}