﻿/*
 * utf-8 common.js by wilson mar, with help from friends and the kindness of strangers.
 */

var prefsLoaded = false;
var defaultFontSize = 70;
var currentFontSize = defaultFontSize;
var currentStyle = "White";
var currentLang = "en";
var currentTextOnlyBool = "off";
var currentHandheldBool = "off";
var currentPrintBool    = "off";

// window.onload = common_init;

function common_init(){
	if(!prefsLoaded){
		cookie = readCookie("fontSize");
		currentFontSize = cookie ? cookie : defaultFontSize;
		setFontSize(currentFontSize);
		
		cookie 			= readCookie("pageColor");
		currentStyle = cookie ? cookie : "White";
		setColor(currentStyle);

		currentLang 		= readCookie("lang");

		currentTextOnlyBool 	= readCookie("textonly");
		setTextOnly(currentTextOnlyBool);

		currentHandheldBool   	= readCookie("handheld");
		currentPrintBool    	= readCookie("print");

		prefsLoaded = true;
	}
}

window.onunload = saveSettings;

function saveSettings(){
  createCookie("fontSize", currentFontSize, 365);
  createCookie("pageColor",currentStyle, 365);
  createCookie("lang",     currentLang, 365);
  createCookie("textonly", currentTextOnlyBool, 365);
  createCookie("handheld",   currentHandheldBool, 365);
  createCookie("print",    currentPrintBool, 365);

// function exitpop(){ my_window= window.open ("","mywindow1","status=1,width=350,height=150"); 
// my_window.document.write('Thanks for visiting');  
}

function revertStyles(){

	currentFontSize = defaultFontSize;
	changeFontSize(0);
	
	currentStyle = "White";
	setColor("White");
}
function toggleTextOnly(){

	if(currentTextOnlyBool == "off"){
		setTextOnly("on");
	}else{
		setTextOnly("off");
	}
}
function setTextOnly(switcher){
	currentTextOnlyBool = switcher;
	// repaint screen for changes to take effect.
//	saveSettings();
	// FUTURE: Should refresh screen now.
}

function changeFontSize(sizeDifference){
	currentFontSize = parseInt(currentFontSize) + parseInt(sizeDifference * 5);

	if(currentFontSize > 100){
		currentFontSize = 100;
	}else if(currentFontSize < 60){
		currentFontSize = 60;
	}
	setFontSize(currentFontSize);
}
function setFontSize(fontSize){
	var stObj = (document.getElementById) ? document.getElementById('content_area') : document.all('content_area');
	document.body.style.fontSize = fontSize + '%';
}

function toggleColors(){

	if(currentStyle == "White"){
		setColor("Black");
	}else{
		setColor("White");
	}
}
function setColor(color){
	d=new Date();
	if(color != "White"){
		document.body.className = 'dark';
		currentStyle = "Black";
	}else{
		document.body.className = '';
		currentStyle = "White";
	}
}
function switchColor(e){ // Invoked with onmouseover="switchColor('0');" 
	switch(e){
		case 0:
			element=document.getElementById("c0");
			if( currentStyle == "White" ){
				element.src="img/toolbar/gb_contrast_toggle_b.png";
			}else{
				element.src="img/toolbar/gb_contrast_toggle.png";
			}
//			element.alt='"Composition with Red, Yellow, and Blue" by Piet Mondrian';
		default: 
			element=document.getElementById("c3");
			if( currentStyle == "White" ){
				element.src="img/toolbar/gb_reset_b.png";
			}else{
				element.src="img/toolbar/gb_reset.png";
			}
			break
	}
}

//                                 0        1        2         3            4         5         6
var dt_desc       = new makeArray("Year"  ,"Month" ,"Day"    ,"Week"      ,"Hour"   ,"Minute" ,"Second","Season");
var dt_desc_en    = new makeArray("Year"  ,"Month" ,"Day"    ,"Week"      ,"Hour"   ,"Minute" ,"Second");
var dt_desc_es    = new makeArray("Año"   ,"Mes"   ,"Día"    ,"Semana"    ,"Hora"   ,"Minuto" ,"Segundo");
var dt_desc_fr    = new makeArray("Année" ,"Mois"  ,"Jour"   ,"Semaine"   ,"Heure"  ,"Minute" ,"Segundo");
var dt_desc_de    = new makeArray("Jahr"  ,"Monat" ,"Tag"    ,"Woche"     ,"Stunde" ,"Minute" ,"Sekunde");
var dt_desc_it    = new makeArray("Anno"  ,"Mese"  ,"Giorno" ,"Settimana" ,"Ora"    ,"Minuto" ,"Secondo");
var dt_desc_ru    = new makeArray("god"  ,"Mesyatsy" ,"Day"    ,"Week"      ,"Hour"   ,"Minute" ,"Second");
var dt_desc_pt    = new makeArray("Ano"   ,"Mês"   ,"Dia"    ,"Semana"    ,"Hora"   ,"Minuto" ,"Segundo");
	// From http://www.cjvlang.com/Dow/dowchin.html
var dt_desc_zh_CN = new makeArray("年"     ,"月"     ,"日"      ,"周"         ,"点"      ,"分"      ,"秒");
var dt_desc_ja    = new makeArray("年"     ,"月"     ,"日"      ,"周"         ,"点"      ,"分"      ,"秒");
var dt_desc_ko    = new makeArray("Year"  ,"Month" ,"Day"    ,"Week"      ,"Hour"   ,"Minute" ,"Second");

//var lang_id = new makeArray("en"     ,"es"     ,"fr"      ,"de"     ,"it"      ,"pt"       ,"ru",    ,"zh-CN"                       ,"ja"          ,"ko");
//var lang_tx = new makeArray("English","Español","Français","Deutsch","Italiano","Português","Russian Cyrillic","中文 (简体) Chinese (Simplified)","Japanese","한국어 Korean");

//                        0        1       2         3        4        5     6
var days         = new makeArray("Sunday"    ,"Monday"  ,"Tuesday","Wednesday","Thursday","Friday","Saturday");
var days_abbr    = new makeArray("Sun"       ,"Mon"     ,"Tue"    ,"Wed"      ,"Thu"     ,"Fri"   ,"Sat");
var days_de = new makeArray("Sonntag"   ,"Montag"  ,"Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
var days_abbr_de      = new makeArray("Son"   ,"Mon"  ,"Die","Mit","Don","Fre","Sam");
var days_es      = new makeArray("Domingo"   ,"Lunes"   ,"Martes","Miércoles","Jueves","Viernes","Sábado");
var days_abbr_es = new makeArray("Dom"   ,"Lun"   ,"Mar","Mié","Jue","Vie","Sáb");
var days_fi      = new makeArray("Sunnuntai"   ,"Maanantai"   ,"Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai");
var days_abbr_fi      = new makeArray("Sun"   ,"Maa"   ,"Tii","Kes","Tor","Per","Lau");
var days_it      = new makeArray("Domenica"  ,"Lunedì"  ,"Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
var days_abbr_it = new makeArray("Dom"  ,"Lun"  ,"Mar","Mer","Gio","Ven","Sab");
var days_ru      = new makeArray("воскресенье","понедельник","вторник","среда","четверг","пятница","суббота");
var days_ru_en = new makeArray("Voskresenye","Ponedelnik","Vtornik","Sreda","Chetverg","Pyatnitsa","Subbota");
var days_pt      = new makeArray("Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sabado");
var days_fr      = new makeArray("Dimanche"  ,"Lundi"   ,"Mardi","Mercredi","Jeudi","Vendredi","Samedi");
var days_abbr_fr = new makeArray("Dim"       ,"Lun"     ,"Mar"  ,"Mer"     ,"Jeu"  ,"Ven"     ,"Sam");
//                                Sun         Moon        Mars    Mercury    Jupiter Venus      Saturn
	// fr From http://www.tondering.dk/claus/cal/node8.html
var days_zh_CN   = new makeArray("周日"        ,"周一"      ,"周二"     ,"周三"       ,"周四"      ,"周五"    ,"周六");
var days_ko      = new makeArray("일요일"  ,"월요일"   ,"화요일","수요일","목요일","금요일","토요일");
var days_ja      = new makeArray("日曜日"    ,"月曜日"  ,"火曜日"  ,"水曜日" ,"木曜日"   ,"金曜日" ,"土曜日");
//                                Sun day     Moon        Fire     Water        Wood       Gold       Earth
	// From http://www.cjvlang.com/Dow/dowjpn.html
var months       = new makeArray("January","February","March","April","May","June","July","August","September","October","November","December");
var months_abbr = new makeArray("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var months_abbr_fr = new makeArray("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic");
var months_abbr_de = new makeArray("Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez");
var months_es = new makeArray("Ene","Feb","Marzo","April","May","June","July","August","September","October","November","December");
var months_abbr_es = new makeArray("Ene","Feb","Mar","Abr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var months_fi = new makeArray("Tam","Hel","Maa","Huh","Tou","Kes","Hei","Elo","Syy","Lok","Mar","Jou");
var months_ja = new makeArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var months_ru = new makeArray("январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь");
var months_ko = new makeArray("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	// Based on http://home.unilang.org/wiki3/index.php/Russian_months
function format_time(t) {
   var Day = t.getDay();
   var Date = t.getDate();
   var Month = t.getMonth();
   var Year = getFullYear(t);
   timeString = "";
   timeString += days[Day];
   timeString += " ";
   timeString += months[Month];
   timeString += " ";
   timeString += Date;
   timeString += ", ";
   timeString += Year;
   return timeString;
}
// formatDate : a PHP date like function, for formatting date strings
// authored by Svend Tofte <www.svendtofte.com> the code is in the public domain
// see http://www.svendtofte.com/code/date_format/
// and http://www.php.net/date
//
// thanks to 
//  - Daniel Berlin <mail@daniel-berlin.de>, major overhaul and improvements
//  - Matt Bannon, correcting some stupid bugs in my days-in-the-months list!
//
// input : format string
// time : epoch time (seconds, and optional)
//
// if time is not passed, formatting is based on 
// the current "this" date object's set time.
//
// supported switches are
// a, A, B, c, d, D, F, g, G, h, H, i, I (uppercase i), j, l (lowecase L), 
// L, m, M, n, N, O, P, r, s, S, t, U, w, W, y, Y, z, Z
// 
// unsupported (as compared to date in PHP 5.1.3)
// T, e, o
//
// Some (not all) predefined format strings from PHP 5.1.1, which 
// offer standard date representations.
// See: http://www.php.net/manual/en/ref.datetime.php#datetime.constants
//
// Atom      "2005-08-15T15:52:01+00:00" Date.DATE_ATOM    = "Y-m-d\\TH:i:sP";
// ISO-8601  "2005-08-15T15:52:01+0000"  Date.DATE_ISO8601 = "Y-m-d\\TH:i:sO";
// RFC 2822  "Mon, 15 Aug 2005 15:52:01 +0000" Date.DATE_RFC2822 = "D, d M Y H:i:s O";
// W3C       "2005-08-15T15:52:01+00:00" Date.DATE_W3C     = "Y-m-d\\TH:i:sP";

Date.prototype.formatDate = function (input,time,to_lang) {
    
    var daysLong =    ["Sunday", "Monday", "Tuesday", "Wednesday", 
                       "Thursday", "Friday", "Saturday"];
    var daysShort =   ["Sun", "Mon", "Tue", "Wed", 
                       "Thu", "Fri", "Sat"];
    var monthsShort = ["Jan", "Feb", "Mar", "Apr",
                       "May", "Jun", "Jul", "Aug", "Sep",
                       "Oct", "Nov", "Dec"];
    var monthsLong =  ["January", "February", "March", "April",
                       "May", "June", "July", "August", "September",
                       "October", "November", "December"];

    var switches = { // switches object
        
        a : function () {
            // Lowercase Ante meridiem and Post meridiem
            return date.getHours() > 11? "pm" : "am";
        },
        
        A : function () {
            // Uppercase Ante meridiem and Post meridiem
            return (this.a().toUpperCase ());
        },
    
        B : function (){
            // Swatch internet time. code simply grabbed from ppk,
            // since I was feeling lazy:
            // http://www.xs4all.nl/~ppk/js/beat.html
            var off = (date.getTimezoneOffset() + 60)*60;
            var theSeconds = (date.getHours() * 3600) + 
                             (date.getMinutes() * 60) + 
                              date.getSeconds() + off;
            var beat = Math.floor(theSeconds/86.4);
            if (beat > 1000) beat -= 1000;
            if (beat < 0) beat += 1000;
            if ((String(beat)).length == 1) beat = "00"+beat;
            if ((String(beat)).length == 2) beat = "0"+beat;
            return beat;
        },
        
        c : function () {
            // ISO 8601 date (e.g.: "2004-02-12T15:19:21+00:00"), as per
            // http://www.cl.cam.ac.uk/~mgk25/iso-time.html
            return (this.Y() + "-" + this.m() + "-" + this.d() + "T" + 
                    this.h() + ":" + this.i() + ":" + this.s() + this.P());
        },
        
        d : function () {
            // Day of the month, 2 digits with leading zeros
            var j = String(this.j());
            return (j.length == 1 ? "0"+j : j);
        },
        
        D : function () {
            // A textual representation of a day, three letters
            return daysShort[date.getDay()];
        },
        
        F : function () {
            // A full textual representation of a month
            return monthsLong[date.getMonth()];
        },
        
        g : function () {
            // 12-hour format of an hour without leading zeros
            return date.getHours() > 12? date.getHours()-12 : date.getHours();
        },
        
        G : function () {
            // 24-hour format of an hour without leading zeros
            return date.getHours();
        },
        
        h : function () {
            // 12-hour format of an hour with leading zeros
            var g = String(this.g());
            return (g.length == 1 ? "0"+g : g);
        },
        
        H : function () {
            // 24-hour format of an hour with leading zeros
            var G = String(this.G());
            return (G.length == 1 ? "0"+G : G);
        },
        
        i : function () {
            // Minutes with leading zeros
            var min = String (date.getMinutes ());
            return (min.length == 1 ? "0" + min : min);
        },
        
        I : function () {
            // Whether or not the date is in daylight saving time (DST)
            // note that this has no bearing in actual DST mechanics,
            // and is just a pure guess. buyer beware.
            var noDST = new Date ("January 1 " + this.Y() + " 00:00:00");
            return (noDST.getTimezoneOffset () == 
                    date.getTimezoneOffset () ? 0 : 1);
        },
        
        j : function () {
            // Day of the month without leading zeros
            return date.getDate();
        },
        
        l : function () {
            // A full textual representation of the day of the week:
		if( to_lang == 'de' ){
			daysLong = days_de;
		}else if( to_lang == 'es' ){
			daysLong = days_es;
		}else if( to_lang == 'fr' ){
			daysLong = days_fr;
		}else if( to_lang == 'it' ){
			daysLong = days_it;
		}else if( to_lang == 'pt' ){
			daysLong = days_pt;
		}else if( to_lang == 'ru' ){
			daysLong = days_ru;
		}else if( to_lang == 'zh-CN' ){
			daysLong = days_zh_CN;
		}else if( to_lang == 'ko' ){
			daysLong = days_ko;
		}else if( to_lang == 'ja' ){
			daysLong = days_ja;
		}else{
		//	daysLong = daysLong;
		}
        	return daysLong[date.getDay()];
	},
        
        L : function () {
            // leap year or not. 1 if leap year, 0 if not.
            // the logic should match iso's 8601 standard.
            // http://www.uic.edu/depts/accc/software/isodates/leapyear.html
            var Y = this.Y();
            if (         
                (Y % 4 == 0 && Y % 100 != 0) ||
                (Y % 4 == 0 && Y % 100 == 0 && Y % 400 == 0)
                ) {
                return 1;
            } else {
                return 0;
            }
        },
        
        m : function () {
            // Numeric representation of a month, with leading zeros
            var n = String(this.n());
            return (n.length == 1 ? "0"+n : n);
        },
        
        M : function () {
            // A short textual representation of a month, three letters
            return monthsShort[date.getMonth()];
        },
        
        n : function () {
            // Numeric representation of a month, without leading zeros
            return date.getMonth()+1;
        },
        
        N : function () {
            // ISO-8601 numeric representation of the day of the week
            var w = this.w();
            return (w == 0 ? 7 : w);
        },
        
        O : function () {
            // Difference to Greenwich time (GMT) in hours
            var os = Math.abs(date.getTimezoneOffset());
            var h = String(Math.floor(os/60));
            var m = String(os%60);
            h.length == 1? h = "0"+h:1;
            m.length == 1? m = "0"+m:1;
            return date.getTimezoneOffset() < 0 ? "+"+h+m : "-"+h+m;
        },
        
        P : function () {
            // Difference to GMT, with colon between hours and minutes
            var O = this.O();
            return (O.substr(0, 3) + ":" + O.substr(3, 2));
        },      
        
        r : function () {
            // RFC 822 formatted date
            var r; // result
            //  Thu         ,     21               Dec              2000
            r = this.D() + ", " + this.d() + " " + this.M() + " " + this.Y() +
            //    16          :    01          :    07               0200
            " " + this.H() + ":" + this.i() + ":" + this.s() + " " + this.O();
            return r;
        },

        s : function () {
            // Seconds, with leading zeros
            var sec = String (date.getSeconds ());
            return (sec.length == 1 ? "0" + sec : sec);
        },        
        
        S : function () {
            // English ordinal suffix for the day of the month, 2 characters
            switch (date.getDate ()) {
                case  1: return ("st"); 
                case  2: return ("nd"); 
                case  3: return ("rd");
                case 21: return ("st"); 
                case 22: return ("nd"); 
                case 23: return ("rd");
                case 31: return ("st");
                default: return ("th");
            }
        },
        
        t : function () {
            // thanks to Matt Bannon for some much needed code-fixes here!
            var daysinmonths = [null,31,28,31,30,31,30,31,31,30,31,30,31];
            if (this.L()==1 && this.n()==2) return 29; // ~leap day
            return daysinmonths[this.n()];
        },
        
        U : function () {
            // Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
            return Math.round(date.getTime()/1000);
        },

        w : function () {
            // Numeric representation of the day of the week
            return date.getDay();
        },
        
        W : function () {
            // Weeknumber, as per ISO specification:
            // http://www.cl.cam.ac.uk/~mgk25/iso-time.html
        
            var DoW = this.N ();
            var DoY = this.z ();

            // If the day is 3 days before New Year's Eve and is Thursday or earlier,
            // it's week 1 of next year.
            var daysToNY = 364 + this.L () - DoY;
            if (daysToNY <= 2 && DoW <= (3 - daysToNY)) {
                return 1;
            }

            // If the day is within 3 days after New Year's Eve and is Friday or later,
            // it belongs to the old year.
            if (DoY <= 2 && DoW >= 5) {
                return new Date (this.Y () - 1, 11, 31).formatDate ("W");
            }
            
            var nyDoW = new Date (this.Y (), 0, 1).getDay ();
            nyDoW = nyDoW != 0 ? nyDoW - 1 : 6;

            if (nyDoW <= 3) { // First day of the year is a Thursday or earlier
                return (1 + Math.floor ((DoY + nyDoW) / 7));
            } else {  // First day of the year is a Friday or later
                return (1 + Math.floor ((DoY - (7 - nyDoW)) / 7));
            }
        },
        
        y : function () {
            // A two-digit representation of a year
            var y = String(this.Y());
            return y.substring(y.length-2,y.length);
        },        
        
        Y : function () {
            // A full numeric representation of a year, 4 digits
    
            // we first check, if getFullYear is supported. if it
            // is, we just use that. ppks code is nice, but wont
            // work with dates outside 1900-2038, or something like that
            if (date.getFullYear) {
                var newDate = new Date("January 1 2001 00:00:00 +0000");
                var x = newDate .getFullYear();
                if (x == 2001) {              
                    // i trust the method now
                    return date.getFullYear();
                }
            }
            // else, do this:
            // codes thanks to ppk:
            // http://www.xs4all.nl/~ppk/js/introdate.html
            var x = date.getYear();
            var y = x % 100;
            y += (y < 38) ? 2000 : 1900;
            return y;
        },

        
        z : function () {
            // The day of the year, zero indexed! 0 through 366
            var t = new Date("January 1 " + this.Y() + " 00:00:00");
            var diff = date.getTime() - t.getTime();
            return Math.floor(diff/1000/60/60/24);
        },

        Z : function () {
            // Timezone offset in seconds
            return (date.getTimezoneOffset () * -60);
        }        
    
    }

    function getSwitch(str) {
        if (switches[str] != undefined) {
            return switches[str]();
        } else {
            return str;
        }
    }

    var date;
    if (time) {
        var date = new Date (time);
    } else {
        var date = this;
    }

    var formatString = input.split("");
    var i = 0;
    while (i < formatString.length) {
        if (formatString[i] == "\\") {
            // this is our way of allowing users to escape stuff
            formatString.splice(i,1);
        } else {
            formatString[i] = getSwitch(formatString[i]);
        }
        i++;
    }
    
    return formatString.join("");
}
function common_getDtFormalFmtByLang(to_lang) {
	if( to_lang == 'en' ){ // no D H:i a
		dtfmt="l F j, Y";
	}else if( to_lang == 'es' ){
		dtfmt="l d.m.Y";
	}else if( to_lang == 'fr' ){
		dtfmt="l d.m.Y";
	}else if( to_lang == 'it' ){
		dtfmt="l d.m.Y";
	}else if( to_lang == 'ja' ){
		dtfmt="l Y年m月d日";
	}else if( to_lang == 'zh-CN' ){
		dtfmt="l Y年m月d日";
	}else if( to_lang == 'ko' ){
		dtfmt="l Y年m月d日";
	}else if( to_lang == 'de' ){
		dtfmt="l d.m.Y";
	}else if( to_lang == 'pt' ){
		dtfmt="l d.m.Y";
	}else if( to_lang == 'ru' ){
		dtfmt="l d.m.Y";
	}else{
		dtfmt="l Y-m-d";
	}
	return dtfmt;
}
function common_getDtLongFmtByLang(to_lang) {
	if( to_lang == 'en' ){ 
		dtfmt="D, d M Y H:i a";
	}else if( to_lang == 'es' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'fr' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'it' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'ja' ){
		dtfmt="Y年m月d日 H:i:s O";
	}else if( to_lang == 'zh-CN' ){
		dtfmt="Y年m月d日 H:i:s O";
	}else if( to_lang == 'ko' ){
		dtfmt="Yë…„ mì›” dì¼ Hì‹œ ië¶„ sì´ˆ O";
		// Korean http://search.cpan.org/~aero/Lingua-KO-DateTime-0.03/lib/Lingua/KO/DateTime.pm#___top
		// datetime : 1994ë…„ 10ì›” 13ì¼ 04ì‹œ 54ë¶„ 34ì´ˆ
	}else if( to_lang == 'de' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'pt' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'ru' ){
		dtfmt="l d.m.Y H:i:s O";
	}else{
		dtfmt="Y-m-d H:i:s O";
	}
	return dtfmt;
}
function common_getDtShortFmtByLang(to_lang) {
	if( to_lang == 'en' ){ // no  H:i a
		dtfmt="D, d M Y";
	}else if( to_lang == 'es' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'fr' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'it' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'ja' ){
		dtfmt="Y年m月d日 H:i:s O";
	}else if( to_lang == 'zh-CN' ){
		dtfmt="Y年m月d日 H:i:s O";
	}else if( to_lang == 'ko' ){
		dtfmt="Yë…„ mì›” dì¼ Hì‹œ ië¶„ sì´ˆ O";
	}else if( to_lang == 'de' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'pt' ){
		dtfmt="l d.m.Y H:i:s O";
	}else if( to_lang == 'ru' ){
		dtfmt="l d.m.Y H:i:s O";
	}else{
		dtfmt="Y-m-d H:i:s O";
	}
	return dtfmt;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
};

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
};

function disableForm(theform) { 
  if (document.all || document.getElementById) { 
    for (i = 0; i < theform.length; i++) { 
      var tempobj = theform.elements[i]; 
      if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset") 
        tempobj.disabled = true; 
    } 
    return true; 
  } 
  else { 
    return true; 
  } 
} 

// Call using: onClick="return(mybutton(this.form));"
var pressed_flag = 0;
function mybutton(form) {
  if (pressed_flag == 0) {
    pressed_flag = 1;
    return true;
  }
  else {
    return false;
  }
}
function common_frmGS(){ // Google search
	var URL=document.frmGS.site.options[document.frmGS.site.selectedIndex].value;
	window.location.href=URL+frmGS.keyword.value;
}
function frmSo(){ // Google search
	var URL=document.frmS.site.options[document.frmS.site.selectedIndex].value;
	window.location.href=URL+frmS.keyword.value;
}
function frmSearch(){
	var URL=document.frmS.site.options[document.frmS.site.selectedIndex].value;
	window.location.href=URL+frmS.q.value;
}
function formHandler(){
	var URL = document.form.site.options[document.form.site.selectedIndex].value;
	window.location.href = URL;
}
function alsoThisPage(){
	var URL = document.alsoThisPage.site.options[document.alsoThisPage.site.selectedIndex].value;
	window.location.href = URL;
}
function inThisPage(){
	var URL = document.ThisPage.ThisPage.options[document.ThisPage.ThisPage.selectedIndex].value;
	window.location.href = URL;
}
function extraDivxFormHandler(){
	var URL = document.extraDivx.extraDivx.options[document.extraDivx.extraDivx.selectedIndex].value;
	window.location.href = URL;
}
function extraDiv1FormHandler(){
	var URL = document.extraDiv1.extraDiv1.options[document.extraDiv1.extraDiv1.selectedIndex].value;
	window.location.href = URL;
}
function extraDiv2FormHandler(){
	var URL = document.extraDiv2.extraDiv2.options[document.extraDiv2.extraDiv2.selectedIndex].value;
	window.location.href = URL;
}
function extraDiv3FormHandler(){
	var URL = document.extraDiv3.extraDiv3.options[document.extraDiv3.extraDiv3.selectedIndex].value;
	window.location.href = URL;
}
function extraDiv4FormHandler(){
	var URL = document.extraDiv4.extraDiv4.options[document.extraDiv4.extraDiv4.selectedIndex].value;
	window.location.href = URL;
}
function takemsgv(verif) {

  if( verif == "" ){
	alert('Please help us block spam bots. Type "asdf" under "Please retype:". Thanks.');
	return 0;
  }else if( verif != 'asdf'){
	alert('Verification code does not match. Sorry for the inconvenience. Please try again.');
	return 0;
  }
	if (document.all){
		var xMax = screen.width, yMax = screen.height;
	}else if (document.layers){
//		alert('there');
		var xMax = window.outerWidth, yMax = window.outerHeight;
	}else{
		var xMax = 640, yMax=480;
	}
	var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
	//	alert('xMax='+xMax+' yMax'+yMax+' xOffset='+xOffset+' yOffset'+yOffset);
//	winparms='width=400,height=350,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'';
	winparms='width=400,height=350';
//		alert(winparms);
//	window.open ("msgthanks.htm","Thank you",winparms);
//	window.open ("msgthanks.htm","Thank you","status=1,toolbar=1");

//	alert('here');
	document.fmCmt.ref.value=document.referrer;document.fmCmt.submit();
// Clear forms within Javascript: http://textsnippets.com/posts/show/215
}
function takemsg() {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
    window.open('msgthanks.htm','Thank you','width=400,height=350,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
   document.fmCmt.ref.value=document.referrer;document.fmCmt.submit();
}

function LinkOut(){
	return confirm("You are now leaving this web site!\nDo you want to continue?");
}

function makeArray() {
     for (i = 0; i<makeArray.arguments.length; i++)
         this[i] = makeArray.arguments[i];
 }
 
function getFullYear(d) {
    var y = d.getYear();
    if (y < 1000) {y += 1900};
    return y;
}
// This will be deprecated for common_write_translate_date(s,languse):
function common_write_translation_buttons(s) {
	t1='<a ref=\"nofollow\" target=\"_blank\" href=\"http://translate.google.com/translate?u=http%3A%2F%2Fwww.wilsonmar.com%2F';
	t2='&amp;langpair=en%7C';
	t3='&amp;hl=en&amp;ie=UTF-8&amp;oe=UTF-8&amp;prev=%2Flanguage_tools\"><img alt=\"'; // align=\"left\" 
	t4='\" src=\"img/flags/';
	t5='\" height=\"14\" width=\"20\" border=\"0\" ';
	t6=' /></a>'; // <img align=\"left\" src=\"img/space.gif\" alt=\"\" width=\"5\" height=\"5\" border=\"0\" />';

//	document.write( t6 );
to_lang='es';
lang_img='es.gif';
	document.write( t1 + s + t2 + to_lang + t3 + 'Español' + t4 + lang_img + t5 + t6 );
to_lang='fr';
lang_img='fr.gif';
	document.write( t1 + s + t2 + to_lang + t3 + 'Français' + t4 + lang_img + t5 + t6 );
to_lang='de';
lang_img='de.gif';
	document.write( t1 + s + t2 + to_lang + t3 + 'Deutsch' + t4 + lang_img + t5 + t6 );
to_lang='it';
lang_img='it.gif';
	document.write( t1 + s + t2 + to_lang + t3 + 'Italiano' + t4 + lang_img + t5 + t6 );
to_lang='pt';
lang_img='pt.gif';
	document.write( t1 + s + t2 + to_lang + t3 + 'Português' + t4 + lang_img + t5 + t6 );
lang_img='flags/ru.png';
	ru_1='<a ref=\"nofollow\" target=\"_blank\" href=\"http://www.online-translator.com/url/tran_url.asp?lang=en&template=General&cp1=NO&cp2=NO&autotranslate=1&transliterate=1&direction=er&url=www.wilsonmar.com/';
	ru_3='"><img alt=\"';
	ru_4='\" src=\"img/';
	document.write( ru_1 + s + ru_3 + 'Cyrillic Russian' + ru_4 + lang_img + t5 + t6 );
to_lang='zh-CN';
lang_img='cn.gif';
	document.write( t1 + s + t2 + to_lang + t3 + '中文 (简体) Chinese (Simplified)' + t4 + lang_img + t5 + t6 );
to_lang='ja';
lang_img='jp.gif';
	document.write( t1 + s + t2 + to_lang + t3 + '日本語 Japanese' + t4 + lang_img + t5 + t6 );
to_lang='ko';
lang_img='ko.gif';
	document.write( t1 + s + t2 + to_lang + t3 + '한국어 Korean' + t4 + lang_img + t5 + t6 );
}

function common_write_translate_date( s , languse )
{
	t1='<a target=\"_blank\" href=\"http://translate.google.com/translate?u=http%3A%2F%2Fwww.wilsonmar.com%2F';
	t2='&amp;langpair=en%7C';
	t3='&amp;hl=en&amp;ie=UTF-8&amp;oe=UTF-8&amp;prev=%2Flanguage_tools\" onmouseover="getLang(\'';
	t3b = '\',\'' + languse +'\');"><img alt=\"';
	t4='\" src=\"img/flags/';
	t5='\" height=\"14\" width=\"20\" border=\"0\" ';
	t6=' /></a>'; // <img align=\"left\" src=\"img/space.gif\" alt=\"\" width=\"5\" height=\"5\" border=\"0\" />';
	if( languse == '0' ){
		more='&nbsp;';
	}else{
		more=' ';
	}

to_lang='es';
lang_img='es.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + 'Español' + t4 + lang_img + t5 + t6 + more );
to_lang='fr';
lang_img='fr.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + 'Français' + t4 + lang_img + t5 + t6 + more );
to_lang='de';
lang_img='de.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + 'Deutsch' + t4 + lang_img + t5 + t6 + more );
to_lang='it';
lang_img='it.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + 'Italiano' + t4 + lang_img + t5 + t6 + more );
to_lang='pt';
lang_img='pt.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + 'Português' + t4 + lang_img + t5 + t6 + more );
to_lang='ru';
lang_img='ru.png';
	ru_1='<a target=\"_blank\" href=\"http://www.online-translator.com/url/tran_url.asp?lang=en&template=General&cp1=NO&cp2=NO&autotranslate=1&transliterate=1&direction=er&url=www.wilsonmar.com/';
	ru_3='\" onmouseover="getLang(\'';
	document.write( ru_1 + s + ru_3 + to_lang + t3b + 'Cyrillic Russian' + t4 + lang_img + t5 + t6 + more );
to_lang='zh-CN';
lang_img='cn.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + '中文 (简体) Chinese (Simplified)' + t4 + lang_img + t5 + t6 + more );
to_lang='ja';
lang_img='jp.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + '日本語 Japanese' + t4 + lang_img + t5 + t6 + more );
to_lang='ko';
lang_img='ko.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + '한국어 Korean' + t4 + lang_img + t5 + t6 + more );

	if( languse >= '2' ){
to_lang='en';
lang_img='en.gif';
	document.write( t1 + s + t2 + to_lang + t3 + to_lang + t3b + 'US English (Default)' + t4 + lang_img + t5 + t6 + more );
	}
	if( languse == '1' ){
		theDate = new Date();
		fmtdt=theDate.formatDate("l, F d, Y g:i a",window.document.lastModified,currentLang);
		document.write( '<a class="fmtdt" title="Last modified date" href="0whatnew.htm"><span id="modifydate">'+ fmtdt + '</span></a>' );
	}
}
function common_write_modifydate() {
	theDate = new Date();
	fmtdt=theDate.formatDate(common_getDtFormalFmtByLang(currentLang),window.document.lastModified,currentLang);
	document.write( '<div class="modifydate"><a class="fmtdt" title="Last modified date" href="0whatnew.htm"><span id="modifydate">'+ fmtdt + ' </span></a></div>' );
	document.write( '<br />' );
}
function getLang(to_lang) {
	currentLang = to_lang;
	saveSettings();

	if( to_lang == 'de' ){
		dt_desc = dt_desc_de;
	}else if( to_lang == 'es' ){
		dt_desc = dt_desc_es;
	}else if( to_lang == 'fr' ){
		dt_desc = dt_desc_fr;
	}else if( to_lang == 'it' ){
		dt_desc = dt_desc_it;
	}else if( to_lang == 'pt' ){
		dt_desc = dt_desc_pt;
	}else if( to_lang == 'ru' ){
		dt_desc = dt_desc_ru;
	}else if( to_lang == 'zh-CN' ){
		dt_desc = dt_desc_zh_CN;
	}else if( to_lang == 'ko' ){
		dt_desc = dt_desc_ko;
	}else if( to_lang == 'ja' ){
		dt_desc = dt_desc_ja;
	}else{
		dt_desc = dt_desc_en;
	}
	mod_dt_inputs(); // in every module that uses this library.

	return fmtdt;
}
function common_write_feed_buttons(url,d)
{ // Caller: function common_write_feed_buttons('http://www.wilsonmar.com/rss2/perftest2.xml','Performance and Capacity Management');
// <!-- <li><a accesskey="R" target="_blank" href="http://www.netspade.com/tools/rss?uri=http%3A%2F%2Fwilsonmar.com%2Frss2%2Fperftest2.xml">
//	<img src="img/htm.gif" alt="Submit Netspade RSS preview" /></a></li> -->
	document.write( '<ul id="resources">' );
	document.write( '<li><a target="_blank" href="http://feeds.my.aol.com/add.jsp?url=' + url +'">' );
	document.write( '	<img src="img/logos/myaol_cta1.gif" alt="Add My AOL" width="63" height="14" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://fusion.google.com/add?feedurl=http%3A//www.wilsonmar.com/rss2/perftest2.xml">' );
	document.write( '	<img src="img/logos/add-to-google-plus.gif" alt="Add to Google Homepage or Google Reader" width="91" height="17" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://www.bloglines.com/sub/' + url +'">' );
	document.write( '	<img src="img/logos/addbloglines.gif" alt="Submit to Bloglines" width="91" height="17" /></a></li>' );
// <!-- a target="_blank" href="http://e.my.yahoo.com/config/promo_content?.module=ycontent&amp;.url=http://www.wilsonmar.com/perftest2.xml" -->
	document.write( '<li><a target="_blank" href="http://www.feedster.com/myfeedster.php?action=addrss&rssurl=' + url +'&confirm=no">' );
	document.write( '	<img src="img/logos/feedster.gif" alt="Add to Feedster" width="91" height="17" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://add.my.yahoo.com/rss?url=http%3A//www.wilsonmar.com/rss2/perftest2.xml">' );
	document.write( '	<img src="img/myyahoo.gif" width="91" height="17" alt="Add to My Yahoo" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://www.netvibes.com/subscribe.php?url=' + url +'&t=' + d +'">' );
	document.write( '	<img src="img/logos/add2netvibes.gif" alt="Add to Netvibes" width="91" height="17" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://client.pluck.com/pluckit/prompt.aspx?GCID=C12286x053&a=' + url +'&t=' + d +'">' );
	document.write( '	<img src="img/logos/pluspluck.png" alt="Submit to Pluck OPML outlines" width="91" height="17" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=' + url +'">' );
	document.write( '	<img src="img/logos/ngsub1.gif" alt="Submit to Newsgator" width="91" height="17" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://my.msn.com/addtomymsn.armx?id=rss&ut=http%3A//www.wilsonmar.com/rss2/perftest.htm">' );
	document.write( '	<img src="img/logos/rssmymsn.gif" width="91" height="17" alt="Add My MSN" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://www.live.com/?add=' + url +'">' );
	document.write( '	<img src="img/logos/WRFeed.png" alt="Add to Microsoft Live.com" width="92" height="17" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://my.feedlounge.com/external/subscribe?url=' + url +'">' );
	document.write( '	<img src="img/logos/feedlounge.gif" alt="Add to Feedlounge" width="91" height="17" /></a></li>' );
	document.write( '<li><a target="_blank" href="http://www.technorati.com/?cc=9822unfsz3' + url +'">' );
	document.write( '	<img src="img/logos/technorati.png" alt="Add to Technorati" width="91" height="12" /></a></li>' );
	document.write( '</ul>' );
}
function common_write_bookmark_buttons(p,d,x,t)
{ 
url='http://www.wilsonmar.com/'+p;
//	document.write( "&nbsp;<span style='cursor:hand;text-decoration:underline;'onclick='window.external.addFavorite(location.href,document.title);'></span>" );
	document.write( '&nbsp;<a href="javascript:window.external.addFavorite(' +"'"+url+"','"+d+"'"+ ');">' );
	document.write( '<img src="img/icon/favorites.jpg" alt="Add to browser favorites" width="17" /></a>' );
//img/icon/favadd.jpg
	document.write( '&nbsp;<a target="_blank" href="http://www.google.com/bookmarks/mark?op=add&hl=en&amp;title=' + d + '&amp;bkmk=' + url + '&labels=' + t +'"><img src="http://www.google.com/favicon.ico" alt="add Google Bookmark" width="38" height="38" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=' + url + '&title=' + d + '&top=1' +'"><img src="http://favorites.live.com/favicon.ico" alt="add to Windows Live" width="38" height="38" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://mystuff.ask.com/mysearch/QuickWebSave?v=1.2&t=webpages&title=' + d + '&url='+ url +'"><img src="http://www.ask.com/favicon.ico" alt="Ask" width="16" height="16" /></a>' );
//	document.write( '&nbsp;<a target="_blank" href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url=' + url + '&amp;title='+ d +'"><img src="http://www.blinklist.com/favicon.ico" alt="blinklist" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://co.mments.com/track?url=' + url + '&title=' + d +'"><img src="http://co.mments.com/favicon.ico" alt="co.mments" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.diigo.com/post?url=' + url + '&title='+d+'"><img src="http://www.diigo.com/favicon.ico" alt="Diigo" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://del.icio.us/post?url=' + url + '&amp;title=' + d +'"><img src="http://del.icio.us/favicon.ico" alt="del.icio.us" width="38" height="38" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://digg.com/submit?phase=2&amp;url=' + url + '&title=' + d+'&bodytext='+x+'"><img src="img/logos/digg.png" alt="Digg this!" width="38" height="38" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.dropjack.com/submit.php?url=' + url+'"><img src="http://www.dropjack.com/favicon.ico" alt="Dropjack" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.facebook.com/share.php?u=' + url +'"><img src="http://www.facebook.com/favicon.ico" alt="Facebook" width="38" height="38" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://cgi.fark.com/cgi/fark/edit.pl?new_url=' + url + '&=' + d + '&new_comment=http%3A%2F%2Fwww.wilsonmar.com&linktype=Misc"><img src="img/logos/fark.png" alt="Fark" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.furl.net/storeIt.jsp?u=' + url + '&amp;t=' + d + '"><img src="img/logos/furl.png" alt="furl" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://ma.gnolia.com/beta/bookmarklet/add?url=' + url + '&amp;title=' + d + '" title="Ma.gnolia"><img src="img/logos/magnolia.png" alt="Ma.gnolia" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.mister-wong.de/index.php?action=addurl&bm_url=' + url + '&bm_description=' + d + '"><img src="http://www.oraclebrains.com/download/obsocialbookmarker/images/misterwong.png" alt="Mister Wong Deutch" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.mister-wong.fr/index.php?action=addurl&bm_url=' + url + '&bm_description=' + d + '"><img src="http://www.oraclebrains.com/download/obsocialbookmarker/images/misterwong.png" alt="Mister Wong Français" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.mister-wong.ru/index.php?action=addurl&bm_url=' + url + '&bm_description=' + d + '"><img src="http://www.oraclebrains.com/download/obsocialbookmarker/images/misterwong.png" alt="Mister Wong Russian" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.mister-wong.es/index.php?action=addurl&bm_url=' + url + '&bm_description=' + d + '"><img src="http://www.oraclebrains.com/download/obsocialbookmarker/images/misterwong.png" alt="Mister Wong Español" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.rojo.com/submit/?title=' + d + '&url=' + url + '"><img src="img/logos/rojo.gif" alt="Rojo" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.netscape.com/submit/?U=' + url + '&T=' + d + '"><img src="http://www.netscape.com/favicon.ico" alt="Netscape Propeller" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=' + url + '&title=' + d + '"><img src="img/logos/netvouz16.gif" alt="Netvouz" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=' + url + '&h=' + d + '"><img src="img/logos/newsvine.png" alt="NewsVine" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.rawsugar.com/tagger/?turl=' + url + '&title=' + d + '&editorInitialized=1'+'"><img src="http://www.oraclebrains.com/download/obsocialbookmarker/images/rawsugar.png" alt="Rawsugar" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://segnalo.com/post.html.php?url=' + url + '&title=' + d + '"><img src="img/logos/segnalo.gif" alt="Segnalo" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.shadows.com/features/tcr.htm?url=' + url + '&amp;title=' + d + '"><img src="img/logos/shadows.png" alt="Shadows" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=' + url + '&title=' + d + '"><img src="img/logos/simpy.png" alt="Simpy" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://slashdot.org/bookmark.pl?url=' + url + '&title=' + d + '"><img src="http://slashdot.org/favicon.ico" alt="Slashdot this!" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.spurl.net/spurl.php?url=' + url + '&title=' + d + '"><img src="img/logos/spurl.png" alt="Spurl Backflip" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.squidoo.com/lensmaster/bookmark?' + url + '"><img src="http://www.squidoo.com/favicon.ico" alt="Squiddo" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.stumbleupon.com/submit?url=' + url + '&title=' + d + '"><img src="http://www.stumbleupon.com/favicon.ico" alt="Stumble it!" width="38" height="38" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://www.rawsugar.com/tagger/?turl=' + url + '&amp;tttl=' + d +'"><img src="img/logos/rawsugar.png" alt="RawSugar" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://reddit.com/submit?url=' + url + '&amp;title=' + d + '" title="Reddit"><img src="http://reddit.com/favicon.ico" alt="Reddit" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=' + url + '&amp;title=' + d + '&amp;tags=&amp;summary=' + x + '&tags=' + t + '"><img src="img/logos/tailrank.png" alt="TailRank" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://technorati.com/faves?add=' + url +'"><img src="http://technorati.com/favicon.ico" alt="Add to Technorati Favorites!" width="38" height="38" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://wists.com/r.php?c=&r=' + url + '&title=' + d + '&tags=' +t+ '"><img src="img/logos/wists.png" alt="wists" width="16" height="16" /></a>' );
	document.write( '&nbsp;<a target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=' + url + '&=' + d + '&tag='+ t + '&d='+ x +'"><img src="img/logos/yahoomyweb.png" alt="yahoomyweb" width="16" height="16" /></a>' );
	document.write( '&nbsp; ' );
// Myspace total.gif, hi5.gif, friendster.gif, xanga.gif, freewebs.gif, typepad.gif, livejournal.gif
}
function common_img_show(file,width,height,alt){
	if( currentTextOnlyBool == "off" ){
		document.write('<div style=\"float:right;margin-right:20px;\">'
		+ '<img src=\"' + file  +'\"' 
		+ ' width=\"'  + width  +'\"' 
		+ ' height=\"' + height +'\"' 
		+ ' alt=\"'    + alt    +'\"' 
		+ ' border=\"0\" /></div>');
	}
}
function common_img_align_right(){
	if( currentTextOnlyBool == "off" ){
		document.write(' align=\"right\" ');
	}
}
function common_img_begin(){
	if( currentTextOnlyBool == "on" ){
		document.write('<!--');
	}
}
function common_img_end(){
	if( currentTextOnlyBool == "on" ){
		document.write('-->');
	}
}
function common_paypal_donate(url){
	x1='<input type=\"hidden\" name=\"';
	x2='\" value=\"';
	x='<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">';
	x=x+ x1 + 'cmd' + x2 + '_xclick\">';
	x=x+ x1 + 'business' + x2 + 'wilsonmar' + '@hot' + 'mai' + 'l.com\">';
	x=x+ x1 + 'item_name' + x2 + 'Donation\">';
	x=x+ x1 + 'item_number' + x2 + url +'\">';
	x=x+ x1 + 'no_shipping' + x2 + '1\">';
	x=x+ x1 + 'return' + x2 + 'http://www.wilsonmar.com/msgthanks.htm\">';
	x=x+ x1 + 'cancel_return' + x2 + 'http://www.wilsonmar.com/default.asp\">';
	x=x+ x1 + '<input type=\"image\" align=right src=\"img/paypal.gif\" width=\"62\" height=\"31\" name=\"submit\" alt=\"Donate money with PayPal\">';
	x=x+ x1 + '</form>';
	document.write(x);
}
function common_content_start(p,b,d){
x="";
	x=x+'<div class=\"rightnav\">';
	x=x+'<a href="#Feedback"><img src="img/icon/chat.gif" width="16" height="16" alt="Talk about this!" border="0"/></a>&nbsp;';
//	x=x+'<a href=\"Javascript:window.print();\">';
//	x=x+'<img src=\"img/toolbar/prt.gif\" width=\"16\" height=\"16\" alt=\"Print to printer\" border=\"0\" /></a>&nbsp;';
	x=x+'<a href=\"#TopMenu\"><img src=\"img/top1a.gif\" width=\"16\" height=\"16\" alt=\"Go to Top of this page.\" border=\"0\" /></a>';
	x=x+'</div>';

	x=x+'<a name=\"' + b +'\"></a>';
	x=x+'<h2><a href=\"#' + b +'\"><img src=\"img/itemthis.gif\" alt=\"';
	x=x+'Set screen'; // FUTURE: Translate this.
	x=x+'\" width=\"17\" height=\"17\" border=\"0\" /></a>';
	x=x+ '&nbsp;'+ d+'</h2>';
	document.write(x);
}
function common_content_end(p,b){
//	document.write('</p></ul>');
}
