var q_WOW=new Wow();
//BEGIN CLASS Wow
function Wow(q_onChangeTime,q_onVideoStatus){
//The public API
//this.init=init_01;//Wow_init01;
//this.getProperty=Wow_getProperty;
//this.setinter=setinter;
//this.interaction=interaction;
//this.setCurrentTime=Wow_setCurrentTime;
//this.getCurrentTime=Wow_getCurrentTime;
//this.buttonClick=Wow_buttonClick;
//this.onChangeTime=q_onChangeTime;
//this.onVideoStatus=q_onVideoStatus;

//Private stats
this.q_INITTS=(new Date()).getTime();
//this.q_FIREUPTS=0;
//this.q_BANDS=0;
//this.q_FRAMR=0;
//this.q_STARTED=false;
//this.q_STATM=0;
this.q_SLIDP=0;
//this.q_POLLTS=0;
//this.q_POLLT=0;
//this.q_POLLA=0;
//this.q_POLLAVG=0;
//this.q_POLLPROB=0;
//this.q_CONNTS=0;
//this.q_BUFFTS=0;
//this.q_BUFFC=0;
//this.q_PLAYTS=0;
//this.q_PLAYA=0;
//this.q_STOPTS=0;
//this.q_DISCTS=0;
this.q_REPORTEDCLOSE=null;
this.q_LASTPACKAGE="";
this.q_SHOWTIME=0;
this.q_DELAY=0;
this.q_DIAGTS=this.q_INITTS;
this.q_DIAGREFRESH=60000;
this.q_LOSTVIDEOTS=0;
this.q_RECONTIMER=null;
this.q_ASYNC=false;//Asynchronous Clock
//Private variables.
this.q_NS=(window.navigator.appName=="Netscape");
this.q_NS7=(window.navigator.userAgent.indexOf("Netscape/") > -1);
this.q_IE=(window.navigator.userAgent.indexOf("MSIE") > -1);
this.q_MAC=(window.navigator.userAgent.indexOf("Mac")>-1);
this.q_WIN=(window.navigator.userAgent.indexOf("Win")>-1);
this.q_MZ=(window.navigator.userAgent.indexOf("Gecko/") > -1);
this.q_OP=(window.navigator.userAgent.indexOf("Opera") > -1);
this.q_LINUX=((window.navigator.userAgent.indexOf("Unix")!=-1)||(window.navigator.userAgent.indexOf("Linux")!=-1));
this.q_SCALABLEWIDTH=400;
this.q_FORM = new Array();
this.q_TABLE = new Array();
this.q_RETRY=30000;
this.q_CHATREFRESH=1000000;
this.q_CHATLINE="";//NOT USED?
this.q_LASTCOMID="0";
this.q_STARTCOMMAND=-1;
this.q_RESTART="0";//NOT USED?
this.q_DELIVERYC=0;
this.q_DELIVERYTS=this.q_INITTS;
this.q_SCHEDULEANIMATION=0;
this.q_PIC=new Array();
this.q_CURCOMMENT="";
this.q_CURADS="";
this.q_CURADINDEX=0;
this.q_ADSTIMERID="";
this.q_TIMERID = 0;
this.q_CURRENTEVENT=-1;
this.q_CURSEC=0;
this.q_LOGOWIDTH=100;
this.q_COMPATIBILITYMODE=false;
this.q_RECEIVEDCMD;
this.q_MYSERVER;
this.q_MYURL;
this.q_EVENTLIST=new Array();
this.q_REPLYTS=(new Date()).getTime();//NOT USED?
this.q_REPLYTYPE="";
this.q_ANSWERID="";
this.q_REPLYTEXT="";
this.q_REPLYNAME="";
this.q_REPLYEMAIL="";
this.q_EVCURTIME=0;
this.q_PH=new Array();//plan ahead schedule
this.q_PHAVGTIMEBETWEEN=30;//EstDuration/q_totalslidecount
this.q_PRELOADINPROGRESS=false;
this.q_ISPRELOADING="0";
this.q_SCOUTIMG=new Image();//New simple preloading
this.q_SCOUTTIME=20;//look ahead 20 seconds
this.q_INTERACTION;
this.q_SLIDE;
this.q_MENUSTRIP;
this.isFlipped="0";
this.q_MENULIST=new Array(
new Array("File","Quit"),
new Array("Help","Ability Help","Report Error","<hr>","About Ability"));
//INIT_01 private variables that get values from ASP
this.q_FADESTAGE=3;
this.q_JAVALOADIMAGES="";
this.q_PRESENTATIONNAMES="";
this.q_ONLINE="";
this.q_RESIZABLE="";
this.q_USESCROLLBARS="no";
this.q_PRESENTATIONFORMAT="";
this.q_DOPRELOAD="";
this.q_SHOWANIMATION="";
this.q_REFRESH="";
this.q_LASTSLIDE=1;//NOT USED?
this.q_CONTROLHEIGHT="";
this.q_SECSURVEY="";
this.q_PRODUCERID="";
this.q_FOLDERNAME="";
this.q_STREAMID="";
this.q_CHANNEL="";
this.q_SFORMAT="";
this.q_SHOWPOSITIONCONTROLS="";
this.q_ALLOWCHANGESIZE="";
this.q_NOTSCRIPTABLE=false;
this.q_VIDEOURL="";
this.q_EVENTNAME="";
this.q_EVENTDESCRIPTION="";
this.q_EVENTCONTACT="";
this.q_EVENTEMAIL="";
//INIT_01 private variables that get values from querystring
this.q_SHOWRUN_ID="";
//this.q_LIVEID="";
this.q_VIEWERNAME="";
this.q_VIEWEREMAIL="";
this.q_IMG="";
this.q_ADM="";
this.q_BASEURL="";
this.q_CHAPTERARROW="0";
this.q_USETITLES=1;
this.q_SHOWMENU="1";
this.q_SHOWROLLER="1";
this.q_FADEIN="";
}//end function

//initializing zipped data
function init02(d1,d2,d3,d4,fzipped){
var EE,ee;
gSTREAMID=request_querystring("STREAMID");
if (gSTREAMID==""){gSTREAMID="1"}
var t0=now();
if(fzipped){
	gStreamlist=tab2array(zstring.unzip(data1));
	var JJ=zstring.unzip(data2).split(",");
	var eeStr=zstring.unzip(data3);
	var d=zstring.unzip(data4).split("\t");
}else{
	gStreamlist=tab2array(unescape(data1));
	var JJ=unescape(data2).split(",");
	var eeStr=unescape(data3);
	var d=unescape(data4).split("\t");
}//end if
if(eeStr.indexOf("<EVENTLISTSEP>")>-1){
	var ee=eeStr.split("<EVENTLISTSEP>");
	if(gSTREAMID<ee.length){
		EE=tab2array(ee[gSTREAMID]);
	}else{
		EE=new Array();
	}//end if
}else{
	EE=tab2array(eeStr);
}//end if
var t1=now()-t0;
init_03(null,gStreamlist,JJ,EE,d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],gSTREAMID,d[16],d[17],d[18],d[19],d[20],d[21],d[22],d[23],d[24],d[25],d[26],d[27],d[28],d[29]);

}//end function

function init_03(q_xpform,q_xsm,q_xjm,q_xEVENTSCRIPT,q_xPRESENTATIONNAMES,
q_xONLINE,q_xRESIZABLE,q_xUSESCROLLBARS,q_xPRESENTATIONFORMAT,q_xCOMPLETEPRELOAD,q_xSHOWANIMATION,
q_xREFRESH,q_xSECSURVEY,q_xPRODUCER_ID,q_xFOLDERNAME,q_xSTREAMID,
q_xCHANNEL,q_xSFORMAT,q_xShowPositionControls,q_xALLOWCHANGESIZE,
q_xEVENTNAME,q_xEVENTDESCRIPTION,
q_xEVENTCONTACT,q_xEVENTEMAIL,q_xCHAPTERARROW,q_xUSETITLES,q_xSHOWMENU,q_xSHOWROLLER,q_xFADEIN,q_xCHATSERVER){
q_WOW.q_FORM=q_xpform;//REMOVE use DOM instead
q_WOW.q_JAVALOADIMAGES=q_xjm;//Slidehandling
eventlist=q_xEVENTSCRIPT;//Ondemand events
q_WOW.q_PRESENTATIONNAMES=q_xPRESENTATIONNAMES;//Slidehandling
q_WOW.q_ONLINE=q_xONLINE;//Exported or online
q_WOW.q_RESIZABLE=q_xRESIZABLE;
q_WOW.q_USESCROLLBARS=(q_xUSESCROLLBARS=="1")?"yes":"no";
q_WOW.q_PRESENTATIONFORMAT=q_xPRESENTATIONFORMAT;
q_WOW.q_DOPRELOAD=q_xCOMPLETEPRELOAD ;
q_WOW.q_SHOWANIMATION=q_xSHOWANIMATION ;
q_WOW.q_REFRESH=parseInt(q_xREFRESH);
q_WOW.q_LASTSLIDE=1;
q_WOW.q_SECSURVEY=q_xSECSURVEY;
q_WOW.q_PRODUCERID=q_xPRODUCER_ID;
q_WOW.q_FOLDERNAME=q_xFOLDERNAME;
q_WOW.q_STREAMID=q_xSTREAMID;
q_WOW.q_CHANNEL=q_xCHANNEL;
q_WOW.q_SHOWPOSITIONCONTROLS=(q_xShowPositionControls=="1");
q_WOW.q_ALLOWCHANGESIZE=q_xALLOWCHANGESIZE;
q_WOW.q_EVENTNAME=q_xEVENTNAME;
q_WOW.q_EVENTDESCRIPTION=q_xEVENTDESCRIPTION;
q_WOW.q_EVENTCONTACT=q_xEVENTCONTACT;
q_WOW.q_EVENTEMAIL=q_xEVENTEMAIL;
q_WOW.q_STREAMID=q_xSTREAMID;
gSFORMAT=gStreamlist[q_WOW.q_STREAMID][2];
q_WOW.q_SFORMAT=gSFORMAT;
q_WOW.q_VIDEOURL=gStreamlist[q_WOW.q_STREAMID][3];
q_WOW.q_CHATSERVER=q_xCHATSERVER;
q_WOW.q_VIEWERNAME=getViewername();
var q_B=request_querystring("HOMEBASE");
if (q_B==""){//Master
	q_WOW.q_BASEURL=getBaseHref();
	q_WOW.q_IMG=resolveUrl(q_WOW.q_BASEURL,"../../../program/livepro/images/");
	q_WOW.q_ADM=resolveUrl(q_WOW.q_BASEURL,"../../../program/livepro/admin/");
	q_WOW.q_HOMEBASE=q_WOW.q_ADM;
}else{//Slave
	q_WOW.q_BASEURL=getBaseHref();
	q_WOW.q_IMG=resolveUrl(q_WOW.q_BASEURL,"images/");
	q_WOW.q_ADM=resolveUrl(q_WOW.q_BASEURL,"images/");//Used by gSlide only
	q_WOW.q_HOMEBASE=q_B;
}//end if
gHOMEBASE=q_WOW.q_HOMEBASE;//For general.js navigation
q_WOW.q_CHAPTERARROW=q_xCHAPTERARROW;
q_WOW.q_USETITLES=parseInt(q_xUSETITLES);
q_WOW.q_SHOWMENU=q_xSHOWMENU;
q_WOW.q_SHOWROLLER=q_xSHOWROLLER;
q_WOW.q_FADEIN=q_xFADEIN;
}//end function

function getViewername(){
q_WOW.q_AUTH_NAME=request_querystring("AUTH_NAME");
q_WOW.q_AUTH_UID=request_querystring("AUTH_UID");
q_WOW.q_AUTH_PHONE=request_querystring("AUTH_PHONE");
q_WOW.q_AUTH_EMAIL=request_querystring("AUTH_EMAIL");
q_WOW.q_AUTH_COMPANY=request_querystring("AUTH_COMPANY");
q_WOW.q_AUTH_EXTRA=request_querystring("AUTH_EXTRA");
q_WOW.q_AUTH_CCNUMBER=request_querystring("AUTH_CCNUMBER");
if (q_WOW.q_AUTH_NAME>""){
	return q_WOW.q_AUTH_NAME;
}else if (q_WOW.q_AUTH_EMAIL>""){
	return q_WOW.q_AUTH_EMAIL;
}else if (q_WOW.q_AUTH_PHONE>""){
	return q_WOW.q_AUTH_PHONE;
}else if (q_WOW.q_AUTH_COMPANY>""){
	return q_WOW.q_AUTH_COMPANY;
}else if (q_WOW.q_AUTH_UID>""){
	return q_WOW.q_AUTH_UID;
}else{
	return "Admin";
}//end if
}//end function