//
// Entireweb JavaScript helpers
// Copyright (C) 2003-2009 WorldLight.com AB
// Written by Fredrik Andersson
//
//
//


//////////////////////////////////////////////////
//
// BASE FUNCTIONALITY
//

function ob(id) {
  return document.getElementById(id);
}

function show(o) {
  if (o) {
    o.style.visibility = 'visible';
    o.style.display = 'inline';
  }
}

function hide(o) {
  if (o) {
    o.style.visibility = 'hidden';
    o.style.display = 'none';
  }
}

function isvis(o) {
  if (o && o.style.visibility == 'visible')
    return true;
  return false;
}
function vis(o) {
  if (o && o.style.visibility == 'visible')
    return true;
  return false;
}

function place(b,x,y) {
  if (b && b.style) {
    b.style.top=(Math.round(y)) + 'px';
    b.style.left=(Math.round(x)) + 'px';
  }
}

function fp(obj) {
  var curleft = curtop = 0;
  if (obj.offsetParent) {
    curleft = obj.offsetLeft;
    curtop = obj.offsetTop;
    while (obj = obj.offsetParent) {
      curleft += obj.offsetLeft;
      curtop += obj.offsetTop;
    }
  }
  return [curleft,curtop];
}

function ae(obj, type, fn) { 
	if (obj.addEventListener) 
		obj.addEventListener(type, fn, false);
  else if (obj.attachEvent) { 
    obj["e"+type+fn] = fn; 
    obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } 
    obj.attachEvent("on"+type, obj[type+fn]); 
  } 
} 
function d2h(d){
  var hD="0123456789ABCDEF";
  var h = hD.substr(d&15,1);
  while(d>15){d>>=4;h=hD.substr(d&15,1)+h;}
  if (h.length == 1) h = "0" + h;
  return h;
}

function hv(d){
  switch(d){
  case '1': return 1;
  case '2': return 2;
  case '3': return 3;
  case '4': return 4;
  case '5': return 5;
  case '6': return 6;
  case '7': return 7;
  case '8': return 8;
  case '9': return 9;
  case 'A': case 'a': return 10;
  case 'B': case 'b': return 11;
  case 'C': case 'c': return 12;
  case 'D': case 'd': return 13;
  case 'E': case 'e': return 14;
  case 'F': case 'f': return 15;
  }
  return 0;
}

function gbw(){
    if (window.innerWidth)
        return window.innerWidth;
    else if (document.documentElement && document.documentElement.clientWidth != 0)
        return document.documentElement.clientWidth;
    else if (document.body)
			return document.body.clientWidth;
    return 0;
}


//////////////////////////////////////////////////
//
// QUERY CLEANUP
//

function trim(s){return s.replace(/^\s+|\s+$/g,"");}
function ltrim(s){return s.replace(/^\s+/,"");}
function rtrim(s){return s.replace(/\s+$/,"");}
function entireweb_qany(qany){var anys=qany.match(/\S+\b/g);var q='';if(anys!=null&&anys.length){q=anys[0];for(i=1;i<anys.length-1;i++)q+=' OR '+anys[i];if(anys.length-1 >0)q+=' OR '+anys[anys.length-1];}return q;}
function entireweb_qnot(qnot){var nots=qnot.match(/\S+\b/g);var q='';if(nots!=null&&nots.length){for(i=0;i<nots.length;i++){if(nots[i].charAt(0)=='-')q+=nots[i]+' ';else q+='-'+nots[i]+' ';}}return q;}
function entireweb_qp(qp){var q='';if(qp.length >1){if(qp.charAt(0)=='"' && qp.charAt(qp.length-1)=='"')q+=qp;else if(qp.charAt(0)=='"')q+=qp+'"';else if (qp.charAt(qp.length-1)=='"')q+='"'+qp;else q+='"'+qp+'"';}return q;}
function entireweb_qall(qall){return qall;}
function entireweb_qhost(qhost){var i=qhost.indexOf("://");if(i>=0)qhost=qhost.substring(i+3);var j=qhost.indexOf("/");if(j>=0)qhost=qhost.substring(0,j);if(qhost.length>0)qhost='host:'+qhost;return qhost;}
function entireweb_qpage(qpage){var j=qpage.indexOf("/");if(j>=0)qpage=qpage.substring(j+1,qpage.length);if(qpage.length>0)qpage='page:'+qpage;return qpage;}
function entireweb_qft(qft){if(qft.length)qft='filetype:'+qft;return qft;}
function entireweb_qip(qip){if(qip.length)qip='ip:'+qip;return qip;}
function entireweb_s(str){if(str.length&&str.charAt(str.length-1)!=' ')return(' ');return('');}


//////////////////////////////////////////////////
//
// SPEEDYVIEW
//

function SpeedyView(url, index) {
  var x = ob("speedyview" + index);
  if (x) {
    if (x.getAttribute("height") <= 1 || url.innerHTML != locPreviewClose) {
      x.setAttribute("src", url);
      x.setAttribute("height", "280");
      x.setAttribute("width", "100%");
      x.setAttribute("frameborder", "1");
      show(x);
      url.innerHTML = locPreviewClose;
    }
    else {
      hide(x);
      x.setAttribute("height", "0");
      x.setAttribute("width", "0");
      x.setAttribute("src", "");
      x.setAttribute("frameborder", "0");
      url.innerHTML = locPreviewOpen;
    }
  }
}


//////////////////////////////////////////////////
//
// RESOLUTION-DEPENDENT CSS
//

function gbh(){
    if (window.innerHeight)
        return window.innerHeight;
    else if (document.documentElement && document.documentElement.clientHeight != 0)
        return document.documentElement.clientHeight;
    else if (document.body)
			return document.body.clientHeight;
    return 0;
}
function cly(d){
   var i, a;
   for (i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++)
	  if (a.getAttribute("title") != null &&
				a.getAttribute("title") != "" &&
				a.getAttribute("title") != "default") a.disabled = true;
   for (i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++)
	   if (a.getAttribute("title") == d) a.disabled = false;
}


//////////////////////////////////////////////////
//
// FADE
//

function fadeNavOver(id, basecolor, flashcolor){
  var v = ob(id);	
  if (v) {	
    v['fadeBaseColor'] = basecolor;
    v['fadeFlashColor'] = flashcolor;
    v['fadeStart'] = 0;
    v.style['backgroundColor'] = '#' + flashcolor;
    clearTimeout(v['fadeTimer']);
  }
}
function fadeNavOut(id){
  var v = ob(id);
  if (v) {
    var d = new Date();
    v['fadeStart'] = d.getMilliseconds();
    fadeTick(id, 200);
  }
}
function fadeTick(id, fadetime){
  var v = ob(id);
  var bg0 = new String(v['fadeFlashColor']);
  var bg1 = new String(v['fadeBaseColor']);
  var d = new Date();
  var tick = (d.getMilliseconds() - v['fadeStart']);
  if (v && bg0.length == 6 && bg1.length == 6){
    var bg = new RGBColor(v.style['backgroundColor']);
    bg = bg.toHex();
    bg = bg.toLowerCase();
    if (tick < 0 && tick > -50) tick = 0;
    else if (tick < 0 || tick >= fadetime){v.style['backgroundColor']="#"+bg1; clearTimeout(v['fadeTimer']); v['fadeTimer'] = 0; return;}
    if (bg == bg1) { clearTimeout(v['fadeTimer']); v['fadeTimer'] = 0; return; }
    r0 = 16*hv(bg0.substring(0,1)) + hv(bg0.substring(1,2));
    g0 = 16*hv(bg0.substring(2,3)) + hv(bg0.substring(3,4));
    b0 = 16*hv(bg0.substring(4,5)) + hv(bg0.substring(5,6));
    r1 = 16*hv(bg1.substring(0,1)) + hv(bg1.substring(1,2));
    g1 = 16*hv(bg1.substring(2,3)) + hv(bg1.substring(3,4));
    b1 = 16*hv(bg1.substring(4,5)) + hv(bg1.substring(5,6));
    r = Math.min(255, r0 + (r1 - r0) * tick / fadetime);
    g = Math.min(255, g0 + (g1 - g0) * tick / fadetime);
    b = Math.min(255, b0 + (b1 - b0) * tick / fadetime);
    v.style['backgroundColor'] = "#" + d2h(Math.round(r)) + "" + d2h(Math.round(g)) + ""  + d2h(Math.round(b));
    v['fadeTimer'] = setTimeout("fadeTick('" + id + "', " + fadetime + ");", 10);
  }
}


//////////////////////////////////////////////////
//
// MOUSEOVER POPUPS
//

var ewMouseOverTimerArray = new Object();
var ewMouseOutTimerArray = new Object();
var ewMouseOverUniqIdArray = new Object();

function ewMouseOverExecutor(popupObjectId, preEval) {
 clearTimeout(ewMouseOverTimerArray[popupObjectId]);
 ewMouseOverTimerArray[popupObjectId] = 0;
 if ((po=ob(popupObjectId)))
  show(po);
}
function ewMouseOutExecutor(popupObjectId) {
 clearTimeout(ewMouseOutTimerArray[popupObjectId]);
 ewMouseOutTimerArray[popupObjectId] = 0;
 clearTimeout(ewMouseOverTimerArray[popupObjectId]);
 ewMouseOverTimerArray[popupObjectId] = 0;
 ewMouseOverUniqIdArray[popupObjectId] = '';
 if ((po=ob(popupObjectId)))
   hide(po);
}
function ewMouseOverKillSpeed(popupObjectId, speed) {
  if ((po=ob(popupObjectId))) {
	 clearTimeout(ewMouseOutTimerArray[popupObjectId]);
   ewMouseOutTimerArray[popupObjectId] = setTimeout('ewMouseOutExecutor(\"'+popupObjectId+'\");', speed);
 }
}
function ewMouseOverKill(popupObjectId) {
	ewMouseOverKillSpeed(popupObjectId, 500);
}
function ewMousePlace(po, posx, posy, w) {
	if (document.body && posx + w > document.body.clientWidth)
  	place(po, posx-w,posy+2);
  else
    place(po, posx+2,posy+2);
}
function ewMouseOverMover(popupObjectId, event, w) {
  var posx = 0;
  var posy = 0;
  if (!event) var event = window.event;
  if (event.pageX || event.pageY)   {
    posx = event.pageX;
    posy = event.pageY;
  }
  else if (event.clientX || event.clientY)  {
    posx = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
    posy = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
  }

  clearTimeout(ewMouseOutTimerArray[popupObjectId]);
  ewMouseOutTimerArray[popupObjectId] = 0;
  if ((po=ob(popupObjectId)))
		ewMousePlace(po, posx, posy, w);
}
function ewMouseOverWaiter(uniqId, popupObjectId, preEval, event, w) {
  var posx = 0;
  var posy = 0;
  if (!event) var event = window.event;
  if (event.pageX || event.pageY)   {
    posx = event.pageX;
    posy = event.pageY;
  }
  else if (event.clientX || event.clientY)  {
    posx = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
    posy = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
  }

  clearTimeout(ewMouseOutTimerArray[popupObjectId]);
  ewMouseOutTimerArray[popupObjectId] = 0;

  if ((po=ob(popupObjectId))) {
    if (uniqId != ewMouseOverUniqIdArray[popupObjectId] ||
        !isvis(po) || ewMouseOverTimerArray[popupObjectId] != 0) {
			var waitTime = 1000;
		  for (var x in ewMouseOverUniqIdArray) {
				if (ewMouseOverUniqIdArray[x] != '' && x != popupObjectId) {
			  	waitTime = 200;
					ewMouseOverKillSpeed(x, 100);
				}
			}
			ewMousePlace(po, posx, posy, w);
      ewMouseOverUniqIdArray[popupObjectId] = uniqId;
      eval(preEval);
      ewMouseOverTimerArray[popupObjectId] = setTimeout('ewMouseOverExecutor(\"'+popupObjectId+'\",\"'+preEval+'\");', waitTime);
    }
		ewMousePlace(po, posx, posy, w);
  }
}

var ewCtxhelpRunningId = 0;

function ctxhelpPrepare(key,width,height) {
  if ((v = ob('ctxhelpcontainer'))) {
    v.style.width = width + 'px';
    v.style.height = height + 'px';
  }
  if ((v = ob('ctxhelpiframe'))) {
    v.style.width = width + 'px';
    v.style.height = height + 'px';
    v.src = '/ctxhelp/?section=' + key;
  }
}

function ctxhelp(key,width,height) {
  if (typeof width == "undefined")
   width = 200;
  if (typeof width == "undefined")
   height = 120;
 document.write('<img src="http://media.entireweb.com/images/pages/query/help.gif" width="13" height="13" ' +
      'onMouseOut="src=\'http://media.entireweb.com/images/pages/query/help.gif\'; ewMouseOverKill(\'ctxhelpcontainer\');" ' +
      'onMouseMove="ewMouseOverMover(\'ctxhelpcontainer\',event,280);" ' +
      'onMouseOver="src=\'http://media.entireweb.com/images/pages/query/help_over.gif\'; ' +
      '  ewMouseOverWaiter(\''+key+''+(++ewCtxhelpRunningId)+'\',\'ctxhelpcontainer\',\'ctxhelpPrepare(\\\''+key+'\\\','+width+','+height+')\',event,280);">');
}


//////////////////////////////////////////////////
//
// AJAX
//

function ajaxcall(url,responsefn) {
  var xhr;
  try{xhr = new ActiveXObject('Msxml2.XMLHTTP');}
  catch(e) {
    try{xhr = new ActiveXObject('Microsoft.XMLHTTP');}
    catch(e2){
    	try{xhr = new XMLHttpRequest();}
      catch(e3){return false;}
    }
  }
  xhr.onreadystatechange = function(){if(xhr.readyState==4&&xhr.status==200)responsefn(xhr.responseText);};
  xhr.open("GET",url,true); 
  xhr.send(null);
	return true;
}
 

//////////////////////////////////////////////////
//
// RGB CLASS
//

/**
 * A class to parse color values
 * @author Stoyan Stefanov <sstoo@gmail.com>
 * @link   http://www.phpied.com/rgb-color-parser-in-javascript/
 * @license Use it if you like it
 */
function RGBColor(color_string) {
  this.ok = false;
  if (color_string.charAt(0) == '#')
    color_string = color_string.substr(1,6);
  color_string = color_string.replace(/ /g,'');
  color_string = color_string.toLowerCase();

  var color_defs = [
    {
      re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
      example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
      process: function (bits){
  return [
    parseInt(bits[1]),
    parseInt(bits[2]),
    parseInt(bits[3])
                ];
      }
    },
        {
    re: /^(\w{2})(\w{2})(\w{2})$/,
    example: ['#00ff00', '336699'],
    process: function (bits){
      return [
                    parseInt(bits[1], 16),
                    parseInt(bits[2], 16),
                    parseInt(bits[3], 16)
        ];
    }
        },
    {
      re: /^(\w{1})(\w{1})(\w{1})$/,
      example: ['#fb0', 'f0f'],
      process: function (bits){
  return [
    parseInt(bits[1] + bits[1], 16),
    parseInt(bits[2] + bits[2], 16),
    parseInt(bits[3] + bits[3], 16)
                ];
      }
    }
    ];

  for (var i = 0; i < color_defs.length; i++) {
    var re = color_defs[i].re;
    var processor = color_defs[i].process;
    var bits = re.exec(color_string);
    if (bits) {
      channels = processor(bits);
      this.r = channels[0];
      this.g = channels[1];
      this.b = channels[2];
      this.ok = true;
    }
  }

  this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
  this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);
  this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);

  this.toRGB = function () {
    return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
  }
  this.toHex = function () {
    var r = this.r.toString(16);
    var g = this.g.toString(16);
    var b = this.b.toString(16);
    if (r.length == 1) r = '0' + r;
    if (g.length == 1) g = '0' + g;
    if (b.length == 1) b = '0' + b;
    return r + g + b;
  }
}



//////////////////////////////////////////////////
//
// AC_RunActiveContent
//

//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, noEmbed) { // FREDRIK: noEmbed 
  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] + '" /> ';
	  if (noEmbed != "")
	    str += noEmbed; // FREDRIK
	  str += '</object>';
  }
  else {
    str += '<embed ';
    for (var i in embedAttrs)
      str += i + '="' + embedAttrs[i] + '" ';
    str += '> ';
	  if (noEmbed != "")
		  str += '<noembed>' + noEmbed + '</noembed>'; // FREDRIK
	  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, ret.params['noembed']);
}
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, ret.params['noembed']);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  ret.params["noembed"] = "";
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "noembed":
        ret.params[args[i]] = args[i+1];
        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":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      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;
}

