
var END_OF_INPUT = -1;

var base64Chars = new Array(
			'A','B','C','D','E','F','G','H',
			'I','J','K','L','M','N','O','P',
			'Q','R','S','T','U','V','W','X',
			'Y','Z','a','b','c','d','e','f',
			'g','h','i','j','k','l','m','n',
			'o','p','q','r','s','t','u','v',
			'w','x','y','z','0','1','2','3',
			'4','5','6','7','8','9','+','/'
		);

		var reverseBase64Chars = new Array();
		for (var i=0; i < base64Chars.length; i++){
			reverseBase64Chars[base64Chars[i]] = i;
		}

		var base64Str;
		var base64Count;
		function setBase64Str(str){
			base64Str = str;
			base64Count = 0;
		}
		function readBase64(){    
			if (!base64Str) return END_OF_INPUT;
			if (base64Count >= base64Str.length) return END_OF_INPUT;
			var c = base64Str.charCodeAt(base64Count) & 0xff;
			base64Count++;
			return c;
		}
		function encodeBase64(str){
			setBase64Str(str);
			var result = '';
			var inBuffer = new Array(3);
			var lineCount = 0;
			var done = false;
			while (!done && (inBuffer[0] = readBase64()) != END_OF_INPUT){
				inBuffer[1] = readBase64();
				inBuffer[2] = readBase64();
				result += (base64Chars[ inBuffer[0] >> 2 ]);
				if (inBuffer[1] != END_OF_INPUT){
					result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30) | (inBuffer[1] >> 4) ]);
					if (inBuffer[2] != END_OF_INPUT){
						result += (base64Chars [((inBuffer[1] << 2) & 0x3c) | (inBuffer[2] >> 6) ]);
						result += (base64Chars [inBuffer[2] & 0x3F]);
					} else {
						result += (base64Chars [((inBuffer[1] << 2) & 0x3c)]);
						result += ('=');
						done = true;
					}
				} else {
					result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30)]);
					result += ('=');
					result += ('=');
					done = true;
				}
				lineCount += 4;
				if (lineCount >= 76){
					result += ('\n');
					lineCount = 0;
				}
			}
			return result;
		}
		function readReverseBase64(){   
			if (!base64Str) return END_OF_INPUT;
			while (true){      
				if (base64Count >= base64Str.length) return END_OF_INPUT;
				var nextCharacter = base64Str.charAt(base64Count);
				base64Count++;
				if (reverseBase64Chars[nextCharacter]){
					return reverseBase64Chars[nextCharacter];
				}
				if (nextCharacter == 'A') return 0;
			} 
		}

		function ntos(n){
			n=n.toString(16);
			if (n.length == 1) n="0"+n;
			n="%"+n;
			return unescape(n);
		}

		function decodeBase64(str){
			setBase64Str(str);
			var result = "";
			var inBuffer = new Array(4);
			var done = false;
			while (!done && (inBuffer[0] = readReverseBase64()) != END_OF_INPUT
				&& (inBuffer[1] = readReverseBase64()) != END_OF_INPUT){
				inBuffer[2] = readReverseBase64();
				inBuffer[3] = readReverseBase64();
				result += ntos((((inBuffer[0] << 2) & 0xff)| inBuffer[1] >> 4));
				if (inBuffer[2] != END_OF_INPUT){
					result +=  ntos((((inBuffer[1] << 4) & 0xff)| inBuffer[2] >> 2));
					if (inBuffer[3] != END_OF_INPUT){
						result +=  ntos((((inBuffer[2] << 6)  & 0xff) | inBuffer[3]));
					} else {
						done = true;
					}
				} else {
					done = true;
				}
			}
			return result;
		}

			function do_menu() { 

				d = document.getElementById("bar");
				if ( b == "Explorer" ) { 
					d.innerHTML=    '<embed   src="/shared/ssi_templates/top_bars/top_menu_bar_56.swf?Ie"  bgcolor="#ffffff" width="800" height="160" name="top_menu_bar_56" valign="top" play="true" loop="false" quality="high" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>'; 
				}else { 
					d.innerHTML=    '<embed   src="/shared/ssi_templates/top_bars/top_menu_bar_56.swf?Other"  bgcolor="#ffffff" width="800" height="160" name="top_menu_bar_56" align="top" play="true" loop="false" quality="high" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>'; 
				}
				//contract();								

			}
				
				
				
				
					
			
			//--------------------------
			// Print content from pages
			//--------------------------
			
			function printContent(theURL,winName,features) { //v2.0
			  myWidth = 700;
			  myHeight = 600;
			  centerX = screen.availWidth/2 - (myWidth/2);
			  centerY = screen.availHeight/2 - (myHeight/2);
			  printWindow = window.open(theURL,winName,features);
			  printWindow.moveTo(centerX,centerY);
			}
			
			function displayStatusMsg(msgStr) { //v1.0
			  status=msgStr;
			  document.msg_returnValue = true;
			}
			
			

				// update the width of "main" 

				
				function fixWidth() { 
					
					winWidth=document.all?document.body.clientWidth:window.innerWidth; 
					winHeight=document.all?document.body.clientHeight:window.innerHeight;
					var d = document.getElementById("main"); 
					x = ( winWidth / 2 ) - ( 800 / 2 );					
					y = ( winHeight / 2 ) - ( 750 / 2 ); 
					if ( x < 0 )  x = 0;
					if ( y < 0 )  y = 0; 
					d.style.marginLeft = x;					
					d.style.marginTop = 0;
					d.style.visibility = "visible";				
				}

				
				function expand() { 
				 document.getElementById("bar").style.height=370;
				}

				function contract() { 
					document.getElementById("bar").style.height=100;
				}
				

			// Add a div to page .. 

			function addDiv(name,pos,zindex,width,height,x,y,html) { 				

				var bodyRef = document.getElementById("main"); 

				if ( name != "" )	{

					var newPara = document.createElement("div");							
					bodyRef.appendChild(newPara);			
					newPara.style.position=pos; 
					newPara.style.width = width; 
					newPara.style.height = height; 
					newPara.style.left = x; 
					newPara.style.top = y;			 
					newPara.id = name;
	//				newPara.style.overflow="hidden";	
					newPara.style.zIndex = zindex; 
					newPara.innerHTML = html; 	

				}
			}
	
			
			// Take a single string and split in to arguments and pass to addDiv .. 
			function splitArgs(param) { 
				 myArray = param.split("||");
				addDiv(myArray[0],myArray[1],myArray[2],myArray[3],myArray[4],myArray[5],myArray[6],myArray[7]); 
			}


			// Take a single string and split in to arguments and pass to addDiv .. 
			function splitArgs_decode(param) { 
				 myArray = param.split("||");
				addDiv(myArray[0],myArray[1],myArray[2],myArray[3],myArray[4],myArray[5],myArray[6], decodeBase64(myArray[7]) ); 
			}

			// Extra code to make IE work correctly with FScommand .. 

			var ns = (document.layers)? true: false
			var ie = (document.all)? true: false
			var b = (ns)? "Netscape": (ie) ?"Explorer" : " an out-dated browser!?!"
	
			if  ( b == "Explorer" ) {

				var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;	
			
				// Handle all the FSCommand messages in a Flash movie.
				function container_DoFSCommand(command, args) {
					var containerObj = isInternetExplorer ? document.all.container : document.container;
					if ( command == "addDiv" ) splitArgs(args);																														
				}
								
				// Handle all the FSCommand messages in a Flash movie.
				function top_menu_bar_56_DoFSCommand(command, args) {
					var top_menu_bar_56Obj = isInternetExplorer ? document.all.top_menu_bar_56 : document.top_menu_bar_56;
					if ( command == "expand" ) expand(); 
					if ( command == "contract" ) 	contract(); 				
				}

				// Hook for Internet Explorer.
				if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && 				navigator.userAgent.indexOf("Windows 3.1") == -1) {
					document.write('<script language=\"VBScript\"\>\n');
					document.write('On Error Resume Next\n');
				
					document.write('Sub container_FSCommand(ByVal command, ByVal args)\n');
					document.write('	Call container_DoFSCommand(command, args)\n');
					document.write('End Sub\n');
			
					document.write('Sub top_menu_bar_56_FSCommand(ByVal command, ByVal args)\n');
					document.write('	Call top_menu_bar_56_DoFSCommand(command, args)\n');
					document.write('End Sub\n');
			
					document.write('</script\>\n');
				}	

			}		
			
			function get_version(ve) { if ( ve == "DE" ) document.write("3.5"); }
			
			
			
			// -----------------------------------------------------------------------------
			// Flash 8 Detection Script
			// -----------------------------------------------------------------------------
			
			// -----------------------------------------------------------------------------
			// Globals
			// Major version of Flash required
			var requiredMajorVersion = 8;
			// Minor version of Flash required
			var requiredMinorVersion = 0;
			// Revision of Flash required
			var requiredRevision = 0;
			// the version of javascript supported
			var jsVersion = 1.0;
			// -----------------------------------------------------------------------------
			
			// Detect Client Browser type
			var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
			var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
			var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
			jsVersion = 1.1;
			// JavaScript helper required to detect Flash Player PlugIn version information
			function JSGetSwfVer(i){
				// NS/Opera version >= 3 check for Flash plugin in plugin array
				if (navigator.plugins != null && navigator.plugins.length > 0) {
					if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
						var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			      var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
						descArray = flashDescription.split(" ");
						tempArrayMajor = descArray[2].split(".");
						versionMajor = tempArrayMajor[0];
						versionMinor = tempArrayMajor[1];
						if ( descArray[3] != "" ) {
							tempArrayMinor = descArray[3].split("r");
						} else {
							tempArrayMinor = descArray[4].split("r");
						}
	      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
	          flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
	      	} else {
						flashVer = -1;
					}
				}
				// MSN/WebTV 2.6 supports Flash 4
				else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
				// WebTV 2.5 supports Flash 3
				else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
				// older WebTV supports Flash 2
				else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
				// Can't detect in all other cases
				else {
					flashVer = -1;
				}
				return flashVer;
			} 
			// If called with no parameters this function returns a floating point value 
			// which should be the version of the Flash Player or 0.0 
			// ex: Flash Player 7r14 returns 7.14
			// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
			function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
			{
			 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
			   	// loop backwards through the versions until we find the newest version	
				for (i=25;i>0;i--) {	
					if (isIE && isWin && !isOpera) {
						versionStr = VBGetSwfVer(i);
					} else {
						versionStr = JSGetSwfVer(i);		
					}
					if (versionStr == -1 ) { 
						return false;
					} else if (versionStr != 0) {
						if(isIE && isWin && !isOpera) {
							tempArray         = versionStr.split(" ");
							tempString        = tempArray[1];
							versionArray      = tempString .split(",");				
						} else {
							versionArray      = versionStr.split(".");
						}
						versionMajor      = versionArray[0];
						versionMinor      = versionArray[1];
						versionRevision   = versionArray[2];
						
						versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
						versionNum        = parseFloat(versionString);
			        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
						if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
							return true;
						} else {
							return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
						}
					}
				}	
				return (reqVer ? false : 0.0);
			}
			
			
			function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}