//checking the cookies for UserID and SessionID and passing it to flash object
var myArray = new Object();
function callFromFlash() {
	var userId = readCookie ("UserID");
	var sessionId = readCookie ("SessionID");
	if(userId == null || userId == "undefined" || userId == "") {
		userId = getUniqueId();
		setPersistentCookie ("UserID", userId);
		sessionId = userId;
		setSessionCookie ("SessionID", sessionId);
	} else {
		if(sessionId == null || sessionId == "undefined" || sessionId == "") {
			sessionId = getUniqueId();
			setSessionCookie ("SessionID", sessionId);
		}
	}
	myArray.userId = userId;			// "UserID"
	myArray.sessionId = sessionId;	// "SessionID"

	callExternalInterface();
	return true;
}
function callExternalInterface(){
    thisMovie("base").data_sent(myArray);
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }else{
        return document[movieName]
    }
}














