tbn_browse                  = new Image(0,0);
tbn_browse.src              = "http://images.deviantart.com/styles/default/toolbar/main/browse.gif";
tbn_browse_over             = new Image(0,0);
tbn_browse_over.src         = "http://images.deviantart.com/styles/default/toolbar/main/browse_hover.gif";
tbn_devpack                 = new Image(0,0);
tbn_devpack.src             = "http://images.deviantart.com/styles/default/toolbar/main/devpacks.gif";
tbn_devpack_over            = new Image(0,0);
tbn_devpack_over.src        = "http://images.deviantart.com/styles/default/toolbar/main/devpacks_hover.gif";
tbn_soft                    = new Image(0,0);
tbn_soft.src                = "http://images.deviantart.com/styles/default/toolbar/main/software.gif";
tbn_soft_over               = new Image(0,0);
tbn_soft_over.src           = "http://images.deviantart.com/styles/default/toolbar/main/software_hover.gif";
tbn_mosaics                 = new Image(0,0);
tbn_mosaics.src             = "http://images.deviantart.com/styles/default/toolbar/main/mosaics.gif";
tbn_mosaics_over            = new Image(0,0);
tbn_mosaics_over.src        = "http://images.deviantart.com/styles/default/toolbar/main/mosaics_hover.gif";
tbn_forum                   = new Image(0,0);
tbn_forum.src               = "http://images.deviantart.com/styles/default/toolbar/main/forum.gif";
tbn_forum_over              = new Image(0,0);
tbn_forum_over.src          = "http://images.deviantart.com/styles/default/toolbar/main/forum_hover.gif";
tbn_submit                  = new Image(0,0);
tbn_submit.src              = "http://images.deviantart.com/styles/default/toolbar/main/submit.gif";
tbn_submit_over             = new Image(0,0);
tbn_submit_over.src         = "http://images.deviantart.com/styles/default/toolbar/main/submit_hover.gif";
tbn_services                = new Image(0,0);
tbn_services.src            = "http://images.deviantart.com/styles/default/toolbar/main/services.gif";
tbn_services_over           = new Image(0,0);
tbn_services_over.src       = "http://images.deviantart.com/styles/default/toolbar/main/services_hover.gif";
tbn_daprints                = new Image(0,0);
tbn_daprints.src            = "http://images.deviantart.com/styles/default/toolbar/main/daprints.gif";
tbn_daprints_over           = new Image(0,0);
tbn_daprints_over.src       = "http://images.deviantart.com/styles/default/toolbar/main/daprints_hover.gif";
tbn_daprintssingle          = new Image(0,0);
tbn_daprintssingle.src      = "http://images.deviantart.com/styles/default/toolbar/main/daprintssingle.gif";
tbn_daprintssingle_over     = new Image(0,0);
tbn_daprintssingle_over.src = "http://images.deviantart.com/styles/default/toolbar/main/daprintssingle_hover.gif";
tbn_help                    = new Image(0,0);
tbn_help.src                = "http://images.deviantart.com/styles/default/toolbar/main/help.gif";
tbn_help_over               = new Image(0,0);
tbn_help_over.src           = "http://images.deviantart.com/styles/default/toolbar/main/help_hover.gif";
tbn_emoticons               = new Image(0,0);
tbn_emoticons.src           = "http://images.deviantart.com/styles/default/toolbar/main/emoticons.gif";
tbn_emoticons_over          = new Image(0,0);
tbn_emoticons_over.src      = "http://images.deviantart.com/styles/default/toolbar/main/emoticons_hover.gif";
tbn_popup                   = new Image(0,0);
tbn_popup.src               = "http://images.deviantart.com/styles/default/toolbar/main/popup.gif";
tbn_popup_over              = new Image(0,0);
tbn_popup_over.src          = "http://images.deviantart.com/styles/default/toolbar/main/popup_hover.gif";
tbn_shout                   = new Image(0,0);
tbn_shout.src               = "http://images.deviantart.com/styles/default/toolbar/main/shout.gif";
tbn_shout_over              = new Image(0,0);
tbn_shout_over.src          = "http://images.deviantart.com/styles/default/toolbar/main/shout_hover.gif";
tbn_devmag                  = new Image(0,0);
tbn_devmag.src              = "http://images.deviantart.com/styles/default/toolbar/main/devmag.gif";
tbn_devmag_over             = new Image(0,0);
tbn_devmag_over.src         = "http://images.deviantart.com/styles/default/toolbar/main/devmag_hover.gif";

function submitonce(theform) {
 if (document.all || document.getElementById) {
  // hunt down "submit" and "reset"
  for (i=0;i<theform.length;i++) {
   var tempobj=theform.elements[i];
   if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset") {
    tempobj.disabled=true;
   }
  }
 }
}

function displayHTML(form) {
 var inf = form.comments.value;
 var subj = form.subject.value;
 inf = URLEncode(inf);
 subj = URLEncode(subj);
 window.open('http://www.deviantart.com/misc/preview.php?c=' + inf + '&s=' + subj, 'preview', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=510,height=600');
}

function expandDiv(tahw) {
  table_contract = new Image(1,1);
  table_contract.src = "http://images.deviantart.com/shared/t-open.gif";
  table_expand = new Image(1,1);
  table_expand.src = "http://images.deviantart.com/shared/t-close.gif";
  what  = tahw + "_menu"
  where = tahw + "_table"
  gotox  = tahw + "_link"
  if (document.getElementById(what).style.display == "none") {
    document.getElementById(what).style.display = "";
    where.src = table_expand.src;
    gotox.href = "http://urine.deviantart.com/set.php?t=" + tahw + "&value=1"
  } else {
    document.getElementById(what).style.display = "none";
    where.src = table_contract.src;
    gotox.href = "http://urine.deviantart.com/set.php?t=" + tahw + "&value=0"
  }
}

function popUp(URL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=510,height=600');");
}

function swooshinstall(URL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=150');");
}

function URLEncode(plaintext) {
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetci
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	//var plaintext = document.URLForm.F1.value;
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for
	//document.URLForm.F2.value = encoded;
	return(encoded);
}
