//
// $Id: player.js,v 1.8.2.1 2003/11/27 11:31:04 kohara Exp $
//
var CID         ="";         // Custumer_ID
var MID         ="";
var UID         ="web";         // User_ID
var IL          ="1";           // INLINE CODE
var CLIP        ="";
var applet_width    ="160";
var applet_height   ="130";
var SRV         = "";
var SORRY       = SRV + "/images/sorry320.gif";
var CODEBASE        = SRV + "/player/v380/";
var CALLBACK        = '';
var START_CLIP      = "1";
var PLAY_OPTION     = "auto,seq";
//var PLAYER_KEY = "";
var STATUS      = "";
var CTLBAR      = "true";
var COLOR       = "000000";
var CALLBACK_START      = "callback_default";
var CALLBACK_END        = "callback_default";
var CALLBACK_STOP       = "callback_default";
var CALLBACK_CSTART     = "callback_default";
var CALLBACK_CEND       = "callback_default";
var SYNC = "false";
var pagetitle = "movie";

UID = getCookie("UID");
if(UID == ""){
	date = new Date();
	uniqid = getChar(date.getYear())+getChar(date.getMonth())+getChar(date.getDay())+getChar(Math.floor(Math.random()*62))+getChar(Math.floor(Math.random()*62))+getChar(Math.floor(Math.random()*62));
	UID = uniqid;
	setCookie("UID",UID);
}

function getChar(i){
	seedStr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	return seedStr.charAt(i%seedStr.length);
}

function callback_default(){
}

function play(){
 	r = getCookie("reload");
 	if(r == "true"){
 		options = PLAY_OPTION.split(",");
 		newoption = "";
 		for(i = 0; i < options.length; i++){
 			if(options[i] != "random")//options[i] != "seq" &&
 				newoption += options[i] + ",";
 		}
    	PLAY_OPTION = newoption;
    }
    document.write('<applet code="jp.inews.v1.VideoApplet.class" codebase=',CODEBASE,' archive="vplayer.jar" name="VideoApplet" width=', applet_width ,' height=', applet_height ,' border="0" align="absbottom" MAYSCRIPT>');
    document.write('<param name="cabbase" value="vplayer.cab">');
    document.write('<param name=WIDTH value=', applet_width ,'>');
    document.write('<param name=HEIGHT value=', applet_height ,'>');
    document.write('<param name="startclip" value=', START_CLIP ,'>');
    document.write('<param name="id" value=',CID,',',MID,',',UID,',',IL,'>');
    document.write('<param name="clip" value=',CLIP,'>');
    document.write('<param name="play" value=',PLAY_OPTION,'>');
    document.write('<param name="status" value=',STATUS,'>');
//    document.write('<param name="callback,start" value="',CALLBACK_START,'">');
//    document.write('<param name="callback,end" value="',CALLBACK_END,'">');                   
//    document.write('<param name="callback,stop" value="',CALLBACK_STOP,'">');
//    document.write('<param name="callback,cstart" value="',CALLBACK_CSTART,'">');
//    document.write('<param name="callback,cend" value="',CALLBACK_CEND,'">');
    document.write('<param name="ctrl" value="',SYNC,'">');
    document.write('</applet>');
}

function getCookie(keyname){
    tmp = document.cookie + ";";
    index1 = tmp.indexOf(keyname,0);
    if(index1 != -1){
        tmp = tmp.substring(index1,tmp.length);
        index2 = tmp.indexOf("=",0)+1;
        index3 = tmp.indexOf(";",index2);
        return(unescape(tmp.substring(index2,index3)));
    }
    return("");
}
function setCookie(keyname,val){
    tmp = keyname + "=" + escape(val) + ";";
    tmp += "expires=Fri,31-Dec-2050 23:59:59;path=/;";
    document.cookie = tmp;
}


