<!-- 
function go(url){
	if (url!='default')
		window.location=url;
}

function confirmDelete(form, id, item){
	if(confirm("Are you sure you want to delete '" + item + "'?")){
		form.id.value = id;
		return true;
	}
	else
		return false;
	return false;
}

function editInPlace(id) {
	if(document.getElementById(id) && document.getElementById('edit_' + id)) {
		toggleTwo('edit_' + id, id);
	}
}

function show(elementId) { 
	if(document.getElementById(elementId)) {
		document.getElementById(elementId).style.display = 'block';
	}
}

function hide(elementId) { 
	if(document.getElementById(elementId)) {
		document.getElementById(elementId).style.display = 'none';
	}
}

function toggle(elementId) { 
	if (document.getElementById(elementId).style.display == 'none')
		document.getElementById(elementId).style.display = 'block';
	else
		document.getElementById(elementId).style.display = 'none'; 
}

function toggleTwo(elementId, elementIdTwo) { 
	if (document.getElementById(elementId).style.display == 'none') {
		document.getElementById(elementId).style.display = 'block';
		document.getElementById(elementIdTwo).style.display = 'none';
	}
	else if (document.getElementById(elementIdTwo).style.display == 'none') {
		document.getElementById(elementIdTwo).style.display = 'block';
		document.getElementById(elementId).style.display = 'none';
	}
	else
		document.getElementById(elementId).style.display = 'none'; 
}

function doLogIn() {
	hide('adSenseLinkUnit');
	hide('statusMessage');
	hide('xtraPromoCircle');
	show('login');
	hide('searchLabel');
	document.loginForm.username.focus();
}

function doLogOut() {
	hide('adSenseLinkUnit');
	hide('statusMessage');
	hide('xtraPromoCircle');
	hide('searchLabel');
	show('login');
}

function showStatusMessage() {
	
	hide('adSenseLinkUnit');
	hide('adSenseTopSlot');
	hide('statusMessage');
	hide('xtraPromoCircle');
	hide('searchLabel');
	
	show('statusMessage');
	
}

function hideStatusMessage() {
	
	hide('statusMessage');
	
	show('adSenseLinkUnit');
	show('adSenseTopSlot');
	show('xtraPromoCircle');
	show('searchLabel');

}

function writeStatusMessage(message, type) {
	hide('adSenseLinkUnit');
	hide('adSenseTopSlot');
	hide('statusMessage');
	hide('xtraPromoCircle');
	hide('searchLabel');
	if (type == 'ok')
		className = 'green';
	else 
		className = 'red';
	document.getElementById('statusMessageContent').innerHTML = '<span class=' + className + '>' +  message + '</span>';
	show('statusMessage');
}

function trim(str) {
	chars = " ";
    return ltrim(rtrim(str, chars), chars);
}

// Chars you can trim for...
// ---------------------------------------------
// " " (ASCII 32 (0x20)), an ordinary space. 
// "\t" (ASCII 9 (0x09)), a tab. 
// "\n" (ASCII 10 (0x0A)), a new line (line feed). 
// "\r" (ASCII 13 (0x0D)), a carriage return. 
// "\0" (ASCII 0 (0x00)), the NUL-byte. 
// "\x0B" (ASCII 11 (0x0B)), a vertical tab.
// --------------------------------------------- 

function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

function isNumeric(sText) {
   var ValidChars = "0123456789";
   var IsNumber = true;
   var Char;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) {
         IsNumber = false;
      }
   }
   return IsNumber;
}

function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

function levelSelect (level) {
	document.levelForm.level[level].checked = true;
	document.levelForm.submit();
}

function checkDesignerInput (option) {
	if (option == -1){
		alert("When the Designer/Design Company is not in the list, please fill it out with the Trivia.\nThanks!");
	}
}

function confirmSpamSubmit(form, id, item){
	if(confirm("Are you sure you want to report '" + item + "' as SPAM?")){
		window.location = '/guestbook/spam/' + id;
		return true;
	}
	else
		return false;
	return false;
}

function hex2websafe(hexColor) {
	//alert(hexColor);
	var colorArray = new Array();
	colorArray[0] = hexColor.substring(0,1) + '';
	colorArray[1] = hexColor.substring(2,3) + '';
	colorArray[2] = hexColor.substring(4,5) + '';
	
    for (var i = 0; i < 3; i++) {
       switch (colorArray[i]) {
         case "1":
	         colorArray[i]="0";
	         break;
         case "2":
         case "4":
	         colorArray[i]="3";
	         break;
         case "5":
         case "7":
	         colorArray[i]="6";
	         break;
         case "8":
         case "a":
	         colorArray[i]="9";
	         break;
         case "b":
         case "d":
	         colorArray[i]="c";
	         break;
         case "e":
	         colorArray[i]="f";
	         break;
		}
   }
  //webSafeColor = colorArray[0].colorArray[0].colorArray[1].colorArray[1].colorArray[2].colorArray[2];
  var webSafeColor = colorArray[0] + colorArray[1] + colorArray[2] + '';
  return webSafeColor;
}

function get_gl20pte_color(webSafeColor) {
	for (i in gl20pte_colors) {
		if(gl20pte_colors[i] == webSafeColor) {
			return i;
		}
	}
	return '?';
} 

//---------------------------------------------------------------------

var myImages=new Array();

function preloadImages(){ 
	for (i=0;i<preloadImages.arguments.length;i++) { 
		myImages[i]=new Image();
		myImages[i].src=preloadImages.arguments[i] ;
	} 
}

/*preloadImages("/images/spacer.gif",

"/images/logo.gif",
"/images/dash.gif",
"/images/dummyLarge.gif",
"/images/dummyNano.gif",
"/images/dummySmall.gif",

"/images/games/memory/cardOpenBg.gif",
"/images/games/memory/cardDeck.gif",
"/images/games/memory/open.gif",

"/images/timeline/scrollLeft.gif",
"/images/timeline/scrollRight.gif",
"/images/timeline/tlConnect.gif",
"/images/timeline/tlConnectDot.gif",
"/images/timeline/tlConnectNano.gif",
"/images/timeline/tlConnectNanoDot.gif",
"/images/timeline/tlDot.gif",
"/images/timeline/tlNormal.gif",
"/images/timeline/tlSkip.gif",
"/images/timeline/tlStart.gif",
"/images/timeline/tlStop.gif",

"/images/timeline/controller/back.gif",
"/images/timeline/controller/fastback.gif",
"/images/timeline/controller/fastforward.gif",
"/images/timeline/controller/forward.gif",
"/images/timeline/controller/stop.gif",

"/images/corners/3optionsBar_tdBg01.gif",
"/images/corners/3optionsBar_tdBg02.gif",
"/images/corners/3optionsBar_tdBg03.gif",
"/images/corners/3optionsBar_tdBg04.gif",
"/images/corners/3optionsBar_tdBg05.gif",
"/images/corners/3optionsBar_tdBg06.gif",
"/images/corners/3optionsBar_tdBg07.gif",
"/images/corners/fff1a8_3px-l-l.gif",
"/images/corners/fff1a8_3px-l-r.gif",
"/images/corners/fff1a8_3px-u-l.gif",
"/images/corners/fff1a8_3px-u-r.gif",		

"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_cut.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_cut_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_copy.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_paste.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_undo.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_undo_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_redo.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_redo_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_insertorderedlist.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_insertunorderedlist.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_hyperlink.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_unlink.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_unlink_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_image_prop.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_flash_prop.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_inserthorizontalrule.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_cleanup.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_toggle_borders.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_toggle_borders_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_bold.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_italic.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_underline.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_strikethrough.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_justifyleft.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_justifycenter.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_justifyright.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_justifyfull.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_indent.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_outdent.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_fore_color.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_bg_color.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_superscript.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_subscript.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_create.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_prop.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_prop_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_prop.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_prop_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_row_insert.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_row_insert_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_column_insert.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_column_insert_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_row_delete.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_row_delete_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_column_delete.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_column_delete_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_merge_right.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_merge_right_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_merge_down.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_merge_down_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_split_horizontal.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_split_horizontal_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_split_vertical.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_table_cell_split_vertical_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_design.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_design_off.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_html.gif", 
"/plugins/spaw/plugins/core/lib/theme/spaw2/img/tb_html_off.gif");
*/
//-->
