// This script was created © 02/15/2007 and copyrighted © 06/04/2007 by RangDong.com
// To use it personally, please contact us for authorization at admin@rangdong.com
// However, it will be a subscription charge for commercial usage

var stopTime = 60;
var currentPosition;
var currentState;

function getUpdate(typ,pr1,pr2,pid) {
	if(pid != "null") {
		if(typ == "time") { currentPosition = pr1; }
		else if(typ == "state") { currentState = pr1; } 

		if (currentPosition >= stopTime) {
			if ((currentState == 2)||(currentState == 3)) { 
				sendEvent('stop');  
				// setTimeout("sendEvent('next')",1000);
			}

		}

	}
}

function sendEvent(typ,prm) { 
  thisMovie(hex_md5('rangdong.com')).sendEvent(typ,prm); 
}

function thisMovie(movieName) {
    if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
}

function loadFile(movieName,obj) {
	if (hex_md5('rangdong.com') == movieName) {
		thisMovie(hex_md5('rangdong.com')).loadFile(obj);
	} else {
		alert("This script is customized and copyrighted by RangDong.com.\nPlease contact us for the authorization. Thank you!");
	}
}
