﻿var theSwf;

function GetParam(name)
{
	var start=location.search.indexOf("?"+name+"=");
	if (start<0) start=location.search.indexOf("&"+name+"=");
 	if (start<0) return '';
 	start += name.length+2;
 	var end=location.search.indexOf("&",start)-1;
 	if (end<0) end=location.search.length;
 	var result=location.search.substring(start,end);
 	var result='';
 	for(var i=start;i<=end;i++)
 	{
 		var c=location.search.charAt(i);
 		result=result+(c=='+'?' ':c);
 	}
 	return unescape(result);
}

function getTree()
{
	var loc = String(location);
	loc.replace('\\','/');
	var sitePath = loc.split("//")[1];
	var siteSplit = sitePath.split("/");
	var siteSplitIndex = 1;
	if (loc.indexOf("html")!=-1) siteSplitIndex = 2;
	this["lang"] = siteSplit[siteSplitIndex];
	var tree = new Array();
	for (var i=(1+siteSplitIndex); i<siteSplit.length; i++)
		{
			var txt = siteSplit[i].split("#")[0];
			txt = txt.split("_")[0];
			txt = String(txt).replace(".html","");
			txt = String(txt).replace(".htm","");
			tree.push(String(txt));
		}
	return tree;
}

function genFlash(file, width, height, id, vars) {
	vars = "loc=" + location + "&" + vars;
	vars = "currentLoc=" + getTree()[0] + "&" + vars;
	if (typeof(path)!='undefined')
		{
			vars = "path=" + path + "&" + vars;
			vars = "xmlPath=" + path + "xml/" + "&" + vars;
		}

	tempHTML = '	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'" id="'+id+'" name="'+id+'">';
	tempHTML += '	<param name="movie" value="'+file+'">';
	tempHTML += '	<param name="quality" value="high">';
	tempHTML += '	<param name="menu" value="false">';
	tempHTML += '	<param name="wmode" value="transparent">';
	tempHTML += '	<param name="scale" value="noscale">';
	tempHTML += '	<param name="salign" value="">';
	
	if (vars != null) {
		tempHTML += '	<param name="flashVars" value="'+vars+'">';
		tempHTML += '	<embed src="'+file+'" flashVars="'+vars+'" salign="" quality="high" scale="noscale" wmode="transparent" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" id="'+id+'" name="'+id+'"></embed>';
	} else {
		tempHTML += '	<embed src="'+file+'" salign="TL" quality="high" scale="noscale" wmode="transparent" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" id="'+id+'" name="'+id+'"></embed>';
	}
	
	tempHTML += '	</object>';
	
	document.write(tempHTML);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}