
function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
	
  } else {
   return window.document[movieName]
  }
}
function instr(text,c,posInitial)
{
if (posInitial<0) posInitial=0;

for(var i=posInitial; i<text.length;i++)
{
if(text.charAt(i)==c) return i;
}
return -1;
} 

function createJSFCommObject(playerObj)
{
		//create an instance of JSFCommunicator, pass the flashMovie's reference
		//make sure flash object is loaded when you create this object with parameter otherwise
		//you can JSFCommunicator.setMovie(flashMovie) once flash object is loaded

		fh = new JSFCommunicator(playerObj);

      // does the visitor have a cookie?      
      if(document.cookie != "") {
	  		if (instr(document.cookie, ";",0)!=(-1)){

	  		//selection of last pair of variable-value at the cookie
			namevar = document.cookie.split(";"); 
			//selection of 8th char to get real value of cookie variable
			fh.setVariable("txPlay", namevar[1].substr(8,1));}

            }
			
			fh.setVariable("title", titlevar);

}

function cookit() {
      exDate = new Date
      exDate.setMinutes(exDate.getMinutes()+10)
      // This function writes a cookie string from your Flash file.
      // to call this function, use the Get URL command and pass the
      // two variables to the JavaScript.
      for(i=0;i<cookit.arguments.length;i++) {
            ckThing = cookit.arguments[i]

            i++
            document.cookie = ckThing + '; expires=' + exDate.toGMTString()
            }

      // The command to call this function is on the button 'click to
      // write cookie'. It uses the 'Get URL' command and passes
      // cookie information in pairs. The first item in a pair is
      // the cookie variable name, the second is the value for the
      // variable.
}

function writeSWF(){
	hdr = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="header" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="321" width="706"><param name="movie" value="header.swf"><param name="quality" value="high"><param name="wmode" value="transparent"><embed src="header.swf" width="706" height="321" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="header" swliveconnect="true" wmode="transparent"></object>';
	document.write(hdr);
}