//js/ajax.js"></script>
/* Simple AJAX Code-Kit (SACK) v1.6.1 */
/* c2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence,
   see documentation or authors website for more details */

function sack(file) {
    this.xmlhttp = null;

    this.resetData = function() {
	this.method = "POST";
	this.queryStringSeparator = "?";
	this.argumentSeparator = "&";
	this.URLString = "";
	this.encodeURIString = true;
	this.execute = false;
	this.element = null;
	this.elementObj = null;
	this.requestFile = file;
	this.vars = new Object();
	this.responseStatus = new Array(2);
    };

    this.resetFunctions = function() {
	this.onLoading = function() { };
	this.onLoaded = function() { };
	this.onInteractive = function() { };
	this.onCompletion = function() { };
	this.onError = function() { };
	this.onFail = function() { };
    };

    this.reset = function() {
	this.resetFunctions();
	this.resetData();
    };

    this.createAJAX = function() {
	try {
	    this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e1) {
	    try {
		this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (e2) {
		this.xmlhttp = null;
	    }
	}

	if (! this.xmlhttp) {
	    if (typeof XMLHttpRequest != "undefined") {
		this.xmlhttp = new XMLHttpRequest();
	    } else {
		this.failed = true;
	    }
	}
    };

    this.setVar = function(name, value){
	this.vars[name] = Array(value, false);
    };

    this.encVar = function(name, value, returnvars) {
	if (true == returnvars) {
	    return Array(encodeURIComponent(name), encodeURIComponent(value));
	} else {
	    this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
	}
    }

    this.processURLString = function(string, encode) {
	encoded = encodeURIComponent(this.argumentSeparator);
	regexp = new RegExp(this.argumentSeparator + "|" + encoded);
	varArray = string.split(regexp);
	for (i = 0; i < varArray.length; i++){
	    urlVars = varArray[i].split("=");
	    if (true == encode){
		this.encVar(urlVars[0], urlVars[1]);
	    } else {
		this.setVar(urlVars[0], urlVars[1]);
	    }
	}
    }

    this.createURLString = function(urlstring) {
	if (this.encodeURIString && this.URLString.length) {
	    this.processURLString(this.URLString, true);
	}

	if (urlstring) {
	    if (this.URLString.length) {
		this.URLString += this.argumentSeparator + urlstring;
	    } else {
		this.URLString = urlstring;
	    }
	}

	// prevents caching of URLString
	this.setVar("rndval", new Date().getTime());

	urlstringtemp = new Array();
	for (key in this.vars) {
	    if (false == this.vars[key][1] && true == this.encodeURIString) {
		encoded = this.encVar(key, this.vars[key][0], true);
		delete this.vars[key];
		this.vars[encoded[0]] = Array(encoded[1], true);
		key = encoded[0];
	    }

	    urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
	}
	if (urlstring){
	    this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
	} else {
	    this.URLString += urlstringtemp.join(this.argumentSeparator);
	}
    }

    this.runResponse = function() {
	eval(this.response);
    }

    this.runAJAX = function(urlstring) {
	if (this.failed) {
	    this.onFail();
	} else {
	    this.createURLString(urlstring);
	    if (this.element) {
		this.elementObj = document.getElementById(this.element);
	    }
	    if (this.xmlhttp) {
		var self = this;
		if (this.method == "GET") {
		    totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
		    this.xmlhttp.open(this.method, totalurlstring, true);
		} else {
		    this.xmlhttp.open(this.method, this.requestFile, true);
		    try {
			this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		    } catch (e) { }
		}

		this.xmlhttp.onreadystatechange = function() {
		    switch (self.xmlhttp.readyState) {
			case 1:
			    self.onLoading();
			    break;
			case 2:
			    self.onLoaded();
			    break;
			case 3:
			    self.onInteractive();
			    break;
			case 4:
			    self.response = self.xmlhttp.responseText;
			    self.responseXML = self.xmlhttp.responseXML;
			    self.responseStatus[0] = self.xmlhttp.status;
			    self.responseStatus[1] = self.xmlhttp.statusText;

			    if (self.execute) {
				self.runResponse();
			    }

			    if (self.elementObj) {
				elemNodeName = self.elementObj.nodeName;
				elemNodeName.toLowerCase();
				if (elemNodeName == "input"
				|| elemNodeName == "select"
				|| elemNodeName == "option"
				|| elemNodeName == "textarea") {
				    self.elementObj.value = self.response;
				} else {
				    self.elementObj.innerHTML = self.response;
				}
			    }
			    if (self.responseStatus[0] == "200") {
				self.onCompletion();
			    } else {
				self.onError();
			    }

			    self.URLString = "";
			    break;
		    }
		};

		this.xmlhttp.send(this.URLString);
	    }
	}
    };

    this.reset();
    this.createAJAX();
}

//js/ajax-dynamic-list.js"></script>
var ajaxBox_offsetX = 0;
var ajaxBox_offsetY = 0;
var ajax_list_externalFile = '/chart.php';	// Path to external file
var minimumLettersBeforeLookup = 1;	// Number of letters entered before a lookup is performed.

var ajax_list_objects = new Array();
var ajax_list_cachedLists = new Array();
var ajax_list_activeInput = false;
var ajax_list_activeItem;
var ajax_list_optionDivFirstItem = false;
var ajax_list_currentLetters = new Array();
var ajax_optionDiv = false;
var ajax_optionDiv_iframe = false;

var ajax_list_MSIE = false;
if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0)ajax_list_MSIE=true;

var currentListIndex = 0;

function ajax_getTopPos(inputObj)
{
    
  var returnValue = inputObj.offsetTop;
  while((inputObj = inputObj.offsetParent) != null){
    returnValue += inputObj.offsetTop;
  }
  return returnValue;
}
function ajax_list_cancelEvent()
{
    return false;
}

function ajax_getLeftPos(inputObj)
{
  var returnValue = inputObj.offsetLeft;
  while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetLeft;
  
  return returnValue;
}

function ajax_option_setValue(e,inputObj)
{
    if(!inputObj)inputObj=this;
    var tmpValue = inputObj.innerHTML;
    if(ajax_list_MSIE)tmpValue = inputObj.innerText;else tmpValue = inputObj.textContent;
    if(!tmpValue)tmpValue = inputObj.innerHTML;
    ajax_list_activeInput.value = tmpValue;
    if(document.getElementById(ajax_list_activeInput.name + '_hidden'))document.getElementById(ajax_list_activeInput.name + '_hidden').value = inputObj.id; 
    ajax_options_hide();
}

function ajax_options_hide()
{
    if(ajax_optionDiv)ajax_optionDiv.style.display='none';	
    if(ajax_optionDiv_iframe)ajax_optionDiv_iframe.style.display='none';
}

function ajax_options_rollOverActiveItem(item,fromKeyBoard)
{
    if(ajax_list_activeItem)ajax_list_activeItem.className='optionDiv';
    item.className='optionDivSelected';
    ajax_list_activeItem = item;
    
    if(fromKeyBoard){
	if(ajax_list_activeItem.offsetTop>ajax_optionDiv.offsetHeight){
	    ajax_optionDiv.scrollTop = ajax_list_activeItem.offsetTop - ajax_optionDiv.offsetHeight + ajax_list_activeItem.offsetHeight + 2 ;
	}
	if(ajax_list_activeItem.offsetTop<ajax_optionDiv.scrollTop)
	{
	    ajax_optionDiv.scrollTop = 0;	
	}
    }
}

function ajax_option_list_buildList(letters,paramToExternalFile)
{
    
    ajax_optionDiv.innerHTML = '';
    ajax_list_activeItem = false;
    if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length<=1){
	ajax_options_hide();
	return;			
    }
    
    
    
    ajax_list_optionDivFirstItem = false;
    var optionsAdded = false;
    for(var no=0;no<ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length;no++){
	if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()][no].length==0)continue;
	optionsAdded = true;
	var div = document.createElement('DIV');
	var items = ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()][no].split(/###/gi);
	
	if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length==1 && ajax_list_activeInput.value == items[0]){
	    ajax_options_hide();
	    return;						
	}
	
	
	div.innerHTML = items[items.length-1];
	div.id = items[0];
	div.className='optionDiv';
	div.onmouseover = function(){ ajax_options_rollOverActiveItem(this,false) }
	div.onclick = ajax_option_setValue;
	if(!ajax_list_optionDivFirstItem)ajax_list_optionDivFirstItem = div;
	ajax_optionDiv.appendChild(div);
    }	
    if(optionsAdded){
	ajax_optionDiv.style.display='block';
	if(ajax_optionDiv_iframe)ajax_optionDiv_iframe.style.display='';
	ajax_options_rollOverActiveItem(ajax_list_optionDivFirstItem,true);
    }
		
}

function ajax_option_list_showContent(ajaxIndex,inputObj,paramToExternalFile,whichIndex)
{
    if(whichIndex!=currentListIndex)return;
    var letters = inputObj.value;
    var content = ajax_list_objects[ajaxIndex].response;
    var elements = content.split('|');
    ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()] = elements;
    ajax_option_list_buildList(letters,paramToExternalFile);
    
}

function ajax_option_resize(inputObj)
{
    ajax_optionDiv.style.top = (ajax_getTopPos(inputObj) + inputObj.offsetHeight + ajaxBox_offsetY) + 'px';
    ajax_optionDiv.style.left = (ajax_getLeftPos(inputObj) + ajaxBox_offsetX) + 'px';
    if(ajax_optionDiv_iframe){
	ajax_optionDiv_iframe.style.left = ajax_optionDiv.style.left;
	ajax_optionDiv_iframe.style.top = ajax_optionDiv.style.top;			
    }		
    
}

function ajax_showOptions(inputObj,paramToExternalFile,e)
{
    if(e.keyCode==13 || e.keyCode==9)return;
    if(ajax_list_currentLetters[inputObj.name]==inputObj.value)return;
    if(!ajax_list_cachedLists[paramToExternalFile])ajax_list_cachedLists[paramToExternalFile] = new Array();
    ajax_list_currentLetters[inputObj.name] = inputObj.value;
    if(!ajax_optionDiv){
	ajax_optionDiv = document.createElement('DIV');
	ajax_optionDiv.id = 'ajax_listOfOptions';	
	document.body.appendChild(ajax_optionDiv);
	
	if(ajax_list_MSIE){
	    ajax_optionDiv_iframe = document.createElement('IFRAME');
	    ajax_optionDiv_iframe.border='0';
	    ajax_optionDiv_iframe.style.width = ajax_optionDiv.clientWidth + 'px';
	    ajax_optionDiv_iframe.style.height = ajax_optionDiv.clientHeight + 'px';
	    ajax_optionDiv_iframe.id = 'ajax_listOfOptions_iframe';
	    
	    document.body.appendChild(ajax_optionDiv_iframe);
	}
	
	var allInputs = document.getElementsByTagName('INPUT');
	for(var no=0;no<allInputs.length;no++){
	    if(!allInputs[no].onkeyup)allInputs[no].onfocus = ajax_options_hide;
	}			
	var allSelects = document.getElementsByTagName('SELECT');
	for(var no=0;no<allSelects.length;no++){
	    allSelects[no].onfocus = ajax_options_hide;
	}

	var oldonkeydown=document.body.onkeydown;
	if(typeof oldonkeydown!='function'){
	    document.body.onkeydown=ajax_option_keyNavigation;
	}else{
	    document.body.onkeydown=function(){
		oldonkeydown();
	    ajax_option_keyNavigation() ;}
	}
	var oldonresize=document.body.onresize;
	if(typeof oldonresize!='function'){
	    document.body.onresize=function() {ajax_option_resize(inputObj); };
	}else{
	    document.body.onresize=function(){oldonresize();
	    ajax_option_resize(inputObj) ;}
	}
	    
    }
    
    if(inputObj.value.length<minimumLettersBeforeLookup){
	ajax_options_hide();
	return;
    }
	    

    ajax_optionDiv.style.top = (ajax_getTopPos(inputObj) + inputObj.offsetHeight + ajaxBox_offsetY) + 'px';
    ajax_optionDiv.style.left = (ajax_getLeftPos(inputObj) + ajaxBox_offsetX) + 'px';
    if(ajax_optionDiv_iframe){
	ajax_optionDiv_iframe.style.left = ajax_optionDiv.style.left;
	ajax_optionDiv_iframe.style.top = ajax_optionDiv.style.top;			
    }
    
    ajax_list_activeInput = inputObj;
    ajax_optionDiv.onselectstart =  ajax_list_cancelEvent;
    currentListIndex++;
    if(ajax_list_cachedLists[paramToExternalFile][inputObj.value.toLowerCase()]){
	ajax_option_list_buildList(inputObj.value,paramToExternalFile,currentListIndex);			
    }else{
	var tmpIndex=currentListIndex/1;
	ajax_optionDiv.innerHTML = '';
	var ajaxIndex = ajax_list_objects.length;
	ajax_list_objects[ajaxIndex] = new sack();
	var url = ajax_list_externalFile + '?' + paramToExternalFile + '&domain=' + inputObj.value.replace(" ","+");
	ajax_list_objects[ajaxIndex].requestFile = url;	// Specifying which file to get
	ajax_list_objects[ajaxIndex].onCompletion = function(){ ajax_option_list_showContent(ajaxIndex,inputObj,paramToExternalFile,tmpIndex); };	// Specify function that will be executed after file has been found
	ajax_list_objects[ajaxIndex].runAJAX();		// Execute AJAX function		
    }
    
	
}

function ajax_option_keyNavigation(e)
{
    if(document.all)e = event;
    
    if(!ajax_optionDiv)return;
    if(ajax_optionDiv.style.display=='none')return;
    
    if(e.keyCode==38){	// Up arrow
	if(!ajax_list_activeItem)return;
	if(ajax_list_activeItem && !ajax_list_activeItem.previousSibling)return;
	ajax_options_rollOverActiveItem(ajax_list_activeItem.previousSibling,true);
    }
    
    if(e.keyCode==40){	// Down arrow
	if(!ajax_list_activeItem){
	    ajax_options_rollOverActiveItem(ajax_list_optionDivFirstItem,true);
	}else{
	    if(!ajax_list_activeItem.nextSibling)return;
  	    ajax_options_rollOverActiveItem(ajax_list_activeItem.nextSibling,true);
	}
    }
    
    if(e.keyCode==13 || e.keyCode==9){	// Enter key or tab key
	if(ajax_list_activeItem && ajax_list_activeItem.className=='optionDivSelected')ajax_option_setValue(false,ajax_list_activeItem);
	if(e.keyCode==13)return false; else return true;
    }
    if(e.keyCode==27){	// Escape key
	ajax_options_hide();			
    }
}


document.documentElement.onclick = autoHideList;

function autoHideList(e)
{
    if(document.all)e = event;
    
    if (e.target) source = e.target;
	else if (e.srcElement) source = e.srcElement;
	if (source.nodeType == 3) // defeat Safari bug
	    source = source.parentNode;		
    if(source.tagName.toLowerCase()!='input' && source.tagName.toLowerCase()!='textarea')ajax_options_hide();
    
}

//js/AC_RunActiveContent.js"></script>
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
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;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	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;
		}
	}
	// 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;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }
  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "id":
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

//js/swfobject.js"></script>
/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;


//js/main.js"></script>
	var requiredMajorVersion = 9;
	var requiredMinorVersion = 0;
	var requiredRevision = 45;
	
	function ShowChart ()
	{
		var url1 = document.getElementById("url1").value;
		var url2 = document.getElementById("url2").value;
		var url3 = document.getElementById("url3").value;
		var region = document.getElementById('region').value;
		var info = document.getElementById('info').value;
		if (region == 'by')
		{
			document.getElementById("lireg_by").className = "activesort";
			document.getElementById("lireg_all").className = "";
		}
		else
		{
			document.getElementById("lireg_all").className = "activesort";
			document.getElementById("lireg_by").className = "";
		}
		if (info == 'views')
		{
			document.getElementById("liinfo_hi").className = "activesort";
			document.getElementById("liinfo_vis").className = "";
		}
		else
		{
			document.getElementById("liinfo_vis").className = "activesort";
			document.getElementById("liinfo_hi").className = "";
		}
		
		if (url1 == "" && url2 == "" && url3 == "") return;
		var so = new SWFObject("/charts.swf", "audgraph", "640", "340", "6", "white");
		so.addParam("menu", "true");
		so.addParam("allowfullscreen", "true");
		so.addParam("allowscriptaccess", "sameDomain");
		so.addParam("scale", "noscale");
		so.addParam("salign", "TL");
		so.addParam("wmode", "opaque");
		so.addParam("quality", "high");
		so.addParam("play", "true");
		so.addParam("devicefont", "false");
		so.addParam("align", "middle");
		so.addParam("menu", "true");
		so.addVariable("library_path", "/charts_library");
		so.addVariable("xml_source", "/chart.php%3Faction%3Dhits%26url1%3D"+url1+"%26url2%3D"+url2+"%26url3%3D"+url3+"%26region%3D"+region+"%26info%3D"+info);
		so.write("graphflash");
	}
 
 function clearbox (id)
 	{
	document.getElementById(id+'_old').value = document.getElementById(id).value;
	document.getElementById(id).value = ""
	}

 function returnbox (id)
 	{
	if (document.getElementById(id).value == "") document.getElementById(id).value = document.getElementById(id+'_old').value	
	}

 function sel_change (id)
	 {	
	 if (document.getElementById(id).className != "sel_menu_act")
			{
			document.getElementById("top_news_div").style.visibility = "hidden";
			document.getElementById("top_news_div").style.display = "none";
			document.getElementById("top_news").className = "sel_menu_pas";

			document.getElementById("top_chart_div").style.visibility = "hidden";
			document.getElementById("top_chart_div").style.display = "none";
			document.getElementById("top_chart").className = "sel_menu_pas";

			document.getElementById("top_research_div").style.visibility = "hidden";
			document.getElementById("top_research_div").style.display = "none";	
			document.getElementById("top_research").className = "sel_menu_pas";
			
			document.getElementById(id+"_div").style.visibility = "visible";
			document.getElementById(id+"_div").style.display = "block";	
			document.getElementById(id).className = "sel_menu_act";
			}
	 }

 function sel_over (id)
 	{
	if (document.getElementById(id).className != "sel_menu_act")
			{	
			document.getElementById(id).className = "sel_menu_hov";
			}
  }

 function sel_out (id)
  {
	if (document.getElementById(id).className != "sel_menu_act")
			{	
			document.getElementById(id).className = "sel_menu_pas";
			}		
	}

 function getContentTop(id,fil){
    var ajax = new sack();
    ajax.requestFile = fil;
    ajax.method = "POST";
    ajax.onCompletion = function(){
	document.getElementById(id).innerHTML = ajax.response;
    };
    ajax.runAJAX();
 }


