
/////////////////////////////////////////////////////////////////////////////////////////////
var NL = '\n';
/////////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////////
function oPage( p, w, h, title ){
	///////////////////////////////
	if(!w) w = 440;
	if(!h) h = 260;
	if(!title) title = '';
	var features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+',dependent=1';
	window.popUpWin = window.open(p, title, features);
	window.popUpWin.focus();
	///////////////////////////////
}
/////////////////////////////////////////////////////////////////////////////////////////////
function writeFlash( xName, xPath, W, H, xVars, xTrasp, xReturn ){
	///////////////////////////////
	xVars += "&appExt=php";
	var HTML = '';
	HTML += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' +
					'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ' + 
					'width="' + W + '" height="' + H + '" id="' + xName + '" align="middle">' + 
					'<param name="FlashVars" value="' + xVars + '">' + 
					'<param name="allowScriptAccess" value="sameDomain">' + 
					'<param name="movie" value="' + xPath + '">';
	if( xTrasp==true ){
		HTML += '<param name="wmode" value="transparent">';
	}
	HTML += '<embed FlashVars="' + xVars + '" src="' + xPath + '" width="' + W + '" height="' + H + '" name="' + xName + '" align="middle" ';
	if( xTrasp==true ){
		HTML += 'wmode="transparent" ';
	}
	HTML += 'swLiveConnect="true" ' + 
					'allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" /> ' + 
					'</object>';
	///////////////////////////////
	if( xReturn==true ){
		return HTML;
	} else {
		document.write( HTML );
	}
	///////////////////////////////
}
/////////////////////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////////////////////
SwfControlVersion = function(){
	///////////////////////////////
	var version;
	var axo;
	var e;
	///////////////////////////////
	try {
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch(e){	}
	if (!version)	{
		try {
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			version = "6,0,21,0";
			axo.AllowScriptAccess = "always";
			version = axo.GetVariable("$version");
		} catch(e){	}
	}
	if (!version)	{
		try {
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch(e){	}
	}
	if (!version)	{
		try {
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "3,0,18,0";
		} catch(e){
		}
	}
	if (!version)	{
		try {
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "2,0,0,11";
		} catch(e){
			version = -1;
		}
	}
	///////////////////////////////
	return version;
	///////////////////////////////
}
/////////////////////////////////////////////////////////////////////////////////////////////
SwfGetVersion = function(){
	///////////////////////////////
	var flashVer = -1;
	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;
	///////////////////////////////
	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;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) 	flashVer = 4;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) 	flashVer = 3;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) 			flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = this.SwfControlVersion();
	}	
	///////////////////////////////
	flashVer = String(flashVer).replace('WIN ', '');
	///////////////////////////////
	return flashVer;
	///////////////////////////////
}
/////////////////////////////////////////////////////////////////////////////////////////////




/////////////////////////////////////////////////////////////////////////////////////////////
function submitCommonForm( xForm, xURL ){
	var myForm = document.getElementById( xForm );
	if( xURL ){
		myForm.action = myForm.action + xURL;
	}
	myForm.submit();
}
/////////////////////////////////////////////////////////////////////////////////////////////
function getDivStyle( xTg ){
	if( document.layers ){ 
		return eval('document.'+xTg); 
	}else if( document.all ){ 
		return eval('document.all.'+xTg+'.style'); 
	}
	var xDiv = document.getElementById(xTg);
	if( xDiv ) return xDiv.style;
	return;
}
/////////////////////////////////////////////////////////////////////////////////////////////
function setDivView( xDiv ){
	//////////////////////////////////// 
	var curDiv = getDivStyle(xDiv);
	//////////////////////////////////// 
	if(curDiv.display == "none"){

		curDiv.display = "";
		document.getElementById("bt"+xDiv).className = "click"+xDiv+"open";

	}else{
	
		curDiv.display = "none";
		document.getElementById("bt"+xDiv).className = "click"+xDiv;
		
	}
	//////////////////////////////////// 
}
/////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////////////////// JSON
FromJSON = function( xStr ){
	///////////////////////////////
	var Obj = eval('('+xStr+')');
	///////////////////////////////
	return Obj;
	///////////////////////////////
}
/////////////////////////////////////////////////////////////////////////////////////////////

