Another Optical Illusion

Click image for larger view

ContrastIll

The two gray boxes are the same color. To, prove it, copy the code, save it as an html file and click the top box. The backgrounds will disappear, showing their true color. To restore the backgrounds, click the bottom box.

Here is the code:

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’&gt;
<html xmlns=’http://www.w3.org/1999/xhtml’&gt;
<head profile=’http://gmpg.org/xfn/11′&gt;
<title>Contrast Illusion</title>
<style type=’text/css’>
body {margin-left:0;margin-right:0;font:normal normal normal 12px Arial; white-space: pre-wrap}
a{ text-decoration: }
:link { color: rgb(0, 0, 255) }
:visited {color :rgb(100, 0,100) }
:hover { }
:active { }
#top{position: absolute; left: 25% ; top:0 ; width:50% ; height:50% ;background: #EEFFEE; border: 1px solid black }
#bottom{position: absolute; left:25% ; top:50% ; width:50% ; height:50% ;background: #662233 ; border: 1px solid black }
.d1, .d2{position: absolute; left:42% ; width:16% ; height:40% ;background: #888888 }
.d1{top: 5%}
.d2{top: 55%}
</style>
</head>
<body>
<div id=”top”></div>
<div id=”bottom”></div>
<div class=”d1″ onclick=’document.getElementById(“top”).style.visibility=”hidden”; document.getElementById(“bottom”).style.visibility=”hidden”;’></div>
<div class=”d2″ onclick=’document.getElementById(“top”).style.visibility=”visible”; document.getElementById(“bottom”).style.visibility=”visible”;’></div>
</body>
</html>

 

This is a very simple illusion. It consists of two background layers and two gray divisions.
Each division has a single onclick event, the first to hide the background layers and the second to show them.

<div class=”d1″ onclick=’document.getElementById(“top”).style.visibility=”hidden”; document.getElementById(“bottom”).style.visibility=”hidden”;’></div>
<div class=”d2″ onclick=’document.getElementById(“top”).style.visibility=”visible”; document.getElementById(“bottom”).style.visibility=”visible”;’></div>

A Universal Currency Converter

This is a PHP app that allows you to get real-time currency quotes on your phone or tablet. Being a PHP file you need a preprocessor on your mobile device.There is an app caleed Bit Web Server that works quite well for this purpose. If you use it, modify the php.ini file to read error reporting = E_ALL & -E_NOTICE or you will get a bunch of annoying notices.

Here is the code

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’&gt;
<html xmlns=’http://www.w3.org/1999/xhtml’&gt;
<head profile=’http://gmpg.org/xfn/11′&gt;
<title>Currency Converter</title>
<style type=’text/css’>
body {margin-left:0;margin-right:0;font:normal normal 700 30pt Arial; white-space: pre-wrap}
a{ text-decoration: }
:link { color: rgb(0, 0, 255) }
:visited {color :rgb(100, 0,100) }
:hover { }
:active { }
input {font:normal normal 700 30pt Arial }
button {font:normal normal 700 30pt Arial }
#t3 {width: 90% }
</style>
</head>
<body>
<?php
$mult = $_POST [‘t1’];
if ($mult != “Amount to Convert”) {
$from = substr ($_POST[‘s1’],0,3);
$to = substr ($_POST[‘s2’],0,3);
$fr = $_POST[‘s1’];
$t = $_POST[‘s2′];
$dstr= “http://download.finance.yahoo.com/d/quotes.csv?s=&#8221; . $from . $to .”=X&f=l1″;
$fil = file_get_contents ($dstr);
$val = strval (round ($fil * $mult, 2));
if (strlen ($val) – strpos ($val,”.”) < 3) $val = $val .”0″;
}
?>
<form action=”Converter.php” method=”post”>
<input type=”text” id=”t1″ name=”t1″ value=”Amount to Convert” />
<input type=”text” id=”t2″ name=”t2″ value='<?php echo (“Value – ” . $val); ?>’ /><input type=”text” id=”t3″ name=”t3″ value='<?php echo ($fr . ” – ” . $t); ?>’ />

From <select id=”s1″ name=”s1″ >
<option>ADF Andorran Franc</option>
<option>ADF Andorran Franc</option>
<option>ADP Andorran Peseta</option>
<option>AED United Arab Emirates Dirham</option>
<option>AFA Afghanistan Afghani</option>
<option>ALL Albanian Lek</option>
<option>ANG Neth Antilles Guilder</option>
<option>AON Angolan New Kwanza</option>
<option>ARS Argentine Peso</option>
<option>ATS Austrian Schilling</option>
<option>AUD Australian Dollar</option>
<option>AWG Aruba Florin</option>
<option>BBD Barbados Dollar</option>
<option>BDT Bangladesh Taka</option>
<option>BEF Belgian Franc</option>
<option>BGN Bulgarian Lev</option>
<option>BHD Bahraini Dinar</option>
<option>BIF Burundi Franc</option>
<option>BMD Bermuda Dollar</option>
<option>BND Brunei Dollar</option>
<option>BOB Bolivian Boliviano</option>
<option>BRL Brazilian Real</option>
<option>BTN Bhutan Ngultrum</option>
<option>BWP Botswana Pula</option>
<option>BZD Belize Dollar</option>
<option>CAD Canadian Dollar</option>
<option>CFA Communaute Financiere Africaine</option>
<option>CHF Confederazione Helvetica (Swiss ) Franc</option>
<option>CLP Chilean Peso</option>
<option>CNY Chinese Yuan</option>
<option>COP Colombian Peso</option>
<option>CRC Costa Rica Colon</option>
<option>CUP Cuban Peso</option>
<option>CVE Cape Verde Escudo</option>
<option>CYP Cyprus Pound</option>
<option>CZK Czech Koruna</option>
<option>DEM Deutch Mark</option>
<option>DJF Dijibouti Franc</option>
<option>DKK Danish Krone</option>
<option>DKR Dutch Kronas</option>
<option>DMK Deutsch Mark</option>
<option>DOP Dominican Peso</option>
<option>DZD Algerian Dinar</option>
<option>ECS Ecuadorian Sucre</option>
<option>ECU European Currency Unit</option>
<option>EDY Euro Dollar And Yen</option>
<option>EEK Estonian Kroon</option>
<option>EGP Egyptian Pound</option>
<option>ESP Spanish Peseta</option>
<option>ETB Ethiopian Birr</option>
<option>EUR Euro</option>
<option>FIM Finnish Markka</option>
<option>FJD Fiji Dollar</option>
<option>FKP Falkland Islands Pound</option>
<option>FRF French Franc</option>
<option>GBP British Pound</option>
<option>GHC Ghanian Cedi</option>
<option>GIP Gibraltar Pound</option>
<option>GMD Gambian Dalasi</option>
<option>GNF Guinea Franc</option>
<option>GRD Greek Drachma</option>
<option>GTQ Guatemala Quetzal</option>
<option>GYD Guyana Dollar</option>
<option>HKD Hong Kong Dollar</option>
<option>HNL Honduras Lempira</option>
<option>HRK Croatian Kuna</option>
<option>HTG Haiti Gourde</option>
<option>HUF Hungarian Forint</option>
<option>IDR Indonesian Rupiah</option>
<option>IEP Irish Punt</option>
<option>ILS Israeli Shekel</option>
<option>INR Indian Rupee</option>
<option>IQD Iraqi Dinar</option>
<option>IRR Iranian Rial</option>
<option>ISK Iceland Krona</option>
<option>ITL Italian Lira</option>
<option>JMD Jamaican Dollar</option>
<option>JOD Jordanian Dinar</option>
<option>JPY Japanese Yen</option>
<option>KES Kenyan Shilling</option>
<option>KHR Cambodia Riel</option>
<option>KMF Comoros Franc</option>
<option>KPW North Korean Won</option>
<option>KRW Korean Won</option>
<option>KWD Kuwaiti Dinar</option>
<option>KYD Cayman Islands Dollar</option>
<option>KZT Kazakhstan Tenge</option>
<option>LAK Lao Kip</option>
<option>LBP Lebanese Pound</option>
<option>LIR Italian Lira</option>
<option>LKR Sri Lanka Rupee</option>
<option>LRD Liberian Dollar</option>
<option>LSD Lower Slobovian Dinar</option>
<option>LSL Lesotho Loti</option>
<option>LTL Lithuanian Litas</option>
<option>LUF Luxembourg Franc</option>
<option>LVL Latvian Lat</option>
<option>LYD Libyan Dinar</option>
<option>MAD Moroccan Dirham</option>
<option>MDL Moldovan Leu</option>
<option>MGF Malagasy Franc</option>
<option>MKD Macedonian Denar</option>
<option>MMK Myanmar Kyat</option>
<option>MNT Mongolian Tugrik</option>
<option>MOP Macau Pataca</option>
<option>MRO Mauritania Ouguiya</option>
<option>MTL Maltese Lira</option>
<option>MUR Mauritius Rupee</option>
<option>MVR Maldives Rufiyaa</option>
<option>LIR Italian Lira</option>
<option>LKR Sri Lanka Rupee</option>
<option>LRD Liberian Dollar</option>
<option>LSD Lower Slobovian Dinar</option>
<option>LSL Lesotho Loti</option>
<option>LTL Lithuanian Litas</option>
<option>LUF Luxembourg Franc</option>
<option>LVL Latvian Lat</option>
<option>LYD Libyan Dinar</option>
<option>MAD Moroccan Dirham</option>
<option>MDL Moldovan Leu</option>
<option>MGF Malagasy Franc</option>
<option>MKD Macedonian Denar</option>
<option>MMK Myanmar Kyat</option>
<option>MNT Mongolian Tugrik</option>
<option>MOP Macau Pataca</option>
<option>MRO Mauritania Ouguiya</option>
<option>MTL Maltese Lira</option>
<option>MUR Mauritius Rupee</option>
<option>MVR Maldives Rufiyaa</option>
<option>MWK Malawi Kwacha</option>
<option>MXN Mexican Peso</option>
<option>MXP Mexican Peso</option>
<option>MYR Malaysian Ringgit</option>
<option>MZM Mozambique Metical</option>
<option>NAD Namibian Dollar</option>
<option>NGN Nigerian Naira</option>
<option>NIO Nicaragua Cordoba</option>
<option>NIS New Israeli Shekel</option>
<option>NLG Netherlands (Dutch) Guilder</option>
<option>NOK Norwegian Krone</option>
<option>NPR Nepalese Rupee</option>
<option>NZD New Zealand Dollar</option>
<option>OMR Omani Rial</option>
<option>PAB Panama Balboa</option>
<option>PEN Peruvian Nuevo Sol</option>
<option>PGK Papua New Guinea Kina</option>
<option>PHP Philippine Peso</option>
<option>PKR Pakistani Rupee</option>
<option>PLN Polish NEW Zloty</option>
<option>PLZ Polish Zloty</option>
<option>PTE Portuguese Escudo</option>
<option>PYG Paraguayan Guarani</option>
<option>QAR Qatar Rial</option>
<option>RlS Iranian Rial</option>
<option>ROL Romanian Leu</option>
<option>RP Indonesian Rupiah</option>
<option>RSD Republic of Serbia Dinar</option>
<option>RUB Russian Rouble</option>
<option>RWF Rwanda Franc</option>
<option>SAR Saudi Arabian Riyal</option>
<option>SBD Solomon Islands Dollar</option>
<option>SCR Seychelles Rupee</option>
<option>SDD Sudanese Dinar</option>
<option>SEK Swedish Krona</option>
<option>SFR Swiss Francs</option>
<option>SGD Singapore Dollar</option>
<option>SGP Singapore Dollars</option>
<option>SHP St . Helena Pound</option>
<option>SIT Slovenian Tolar</option>
<option>SKK Slovak Koruna</option>
<option>SLL Sierra Leone Leone</option>
<option>SOS Somali Shilling</option>
<option>SRG Surinam Guilder</option>
<option>STD Sao Tome Dobra</option>
<option>SVC El Salvador Colon</option>
<option>SYP Syrian Pound</option>
<option>SZL Swaziland Lilageni</option>
<option>TEC Transaction Exchange Currency</option>
<option>THB Thai Baht</option>
<option>TND Tunisian Dinar</option>
<option>TOP Tonga Pa ‘anga</option>
<option>TRL Turkish Lira</option>
<option>TRY New Turkish Lira</option>
<option>TTD Trinidad & Tobago Dollar</option>
<option>TWD Taiwan Dollar</option>
<option>TZS Tanzanian Shilling</option>
<option>UAH Ukraine Hryvnia</option>
<option>UGS Uganda Shilling</option>
<option>UGX Ugandan Shilling</option>
<option>UNK Unknown</option>
<option>USD United States Dollar</option>
<option>UYP Uruguayan Peso</option>
<option>UYU Uruguay Peso</option>
<option>UZS Uzbekistan Sum</option>
<option>VEB Venezuelan Bolivar</option>
<option>VND Vietnam Dong</option>
<option>VUV Vanuatu Vatu</option>
<option>WST Samoa Tala</option>
<option>XAF Communaute Financiere <option>Africaine Franc (Cameroon)</option>
<option>XBT Bitcoin</option>
<option>XPF Pacific Franc</option>
<option>XPT Platinum Ounces</option>
<option>YER Yemen Riyal</option>
<option>YTL New Turkish Lira</option>
<option>YUM Yugoslav Dinar</option>
<option>YUN Yugoslav Dinar</option>
<option>ZAR South African Rand</option>
<option>ZBD Zimbabwe Dollar</option>
<option>ZMK Zambian Kwacha</option>
<option>ZWD Zimbabwe Dollar</option>
</select>

To <select id=”s2″ name=”s2″>
<option>ADF Andorran Franc</option>
<option>ADF Andorran Franc</option>
<option>ADP Andorran Peseta</option>
<option>AED United Arab Emirates Dirham</option>
<option>AFA Afghanistan Afghani</option>
<option>ALL Albanian Lek</option>
<option>ANG Neth Antilles Guilder</option>
<option>AON Angolan New Kwanza</option>
<option>ARS Argentine Peso</option>
<option>ATS Austrian Schilling</option>
<option>AUD Australian Dollar</option>
<option>AWG Aruba Florin</option>
<option>BBD Barbados Dollar</option>
<option>BDT Bangladesh Taka</option>
<option>BEF Belgian Franc</option>
<option>BGN Bulgarian Lev</option>
<option>BHD Bahraini Dinar</option>
<option>BIF Burundi Franc</option>
<option>BMD Bermuda Dollar</option>
<option>BND Brunei Dollar</option>
<option>BOB Bolivian Boliviano</option>
<option>BRL Brazilian Real</option>
<option>BTN Bhutan Ngultrum</option>
<option>BWP Botswana Pula</option>
<option>BZD Belize Dollar</option>
<option>CAD Canadian Dollar
<option>CFA Communaute Financiere Africaine</option>
<option>CHF Confederazione Helvetica (Swiss ) Franc</option>
<option>CLP Chilean Peso</option>
<option>CNY Chinese Yuan</option>
<option>COP Colombian Peso</option>
<option>CRC Costa Rica Colon</option>
<option>CUP Cuban Peso</option>
<option>CVE Cape Verde Escudo</option>
<option>CYP Cyprus Pound</option>
<option>CZK Czech Koruna</option>
<option>DEM Deutch Mark</option>
<option>DJF Dijibouti Franc</option>
<option>DKK Danish Krone</option>
<option>DKR Dutch Kronas</option>
<option>DMK Deutsch Mark</option>
<option>DOP Dominican Peso</option>
<option>DZD Algerian Dinar</option>
<option>ECS Ecuadorian Sucre</option>
<option>ECU European Currency Unit</option>
<option>EDY Euro Dollar And Yen</option>
<option>EEK Estonian Kroon</option>
<option>EGP Egyptian Pound</option>
<option>ESP Spanish Peseta</option>
<option>ETB Ethiopian Birr</option>
<option>EUR Euro</option>
<option>FIM Finnish Markka</option>
<option>FJD Fiji Dollar</option>
<option>FKP Falkland Islands Pound</option>
<option>FRF French Franc</option>
<option>GBP British Pound</option>
<option>GHC Ghanian Cedi</option>
<option>GIP Gibraltar Pound</option>
<option>GMD Gambian Dalasi</option>
<option>GNF Guinea Franc</option>
<option>GRD Greek Drachma</option>
<option>GTQ Guatemala Quetzal</option>
<option>GYD Guyana Dollar</option>
<option>HKD Hong Kong Dollar</option>
<option>HNL Honduras Lempira</option>
<option>HRK Croatian Kuna</option>
<option>HTG Haiti Gourde</option>
<option>HUF Hungarian Forint</option>
<option>IDR Indonesian Rupiah</option>
<option>IEP Irish Punt</option>
<option>ILS Israeli Shekel</option>
<option>INR Indian Rupee</option>
<option>IQD Iraqi Dinar</option>
<option>IRR Iranian Rial</option>
<option>ISK Iceland Krona</option>
Il<option>ITL Italian Lira</option>
<option>JMD Jamaican Dollar</option>
<option>JOD Jordanian Dinar</option>
<option>JPY Japanese Yen</option>
<option>KES Kenyan Shilling</option>
<option>KHR Cambodia Riel</option>
<option>KMF Comoros Franc</option>
<option>KPW North Korean Won</option>
<option>KRW Korean Won</option>
<option>KWD Kuwaiti Dinar</option>
<option>KYD Cayman Islands Dollar</option>
<option>KZT Kazakhstan Tenge</option>
<option>LAK Lao Kip</option>
<option>LBP Lebanese Pound</option>
<option>LIR Italian Lira</option>
<option>LKR Sri Lanka Rupee</option>
<option>LRD Liberian Dollar</option>
<option>LSD Lower Slobovian Dinar</option>
<option>LSL Lesotho Loti</option>
<option>LTL Lithuanian Litas</option>
<option>LUF Luxembourg Franc</option>
<option>LVL Latvian Lat</option>
<option>LYD Libyan Dinar</option>
<option>MAD Moroccan Dirham</option>
<option>MDL Moldovan Leu</option>
<option>MGF Malagasy Franc</option>
<option>MKD Macedonian Denar</option>
<option>MMK Myanmar Kyat</option>
<option>MNT Mongolian Tugrik</option>
<option>MOP Macau Pataca</option>
<option>MRO Mauritania Ouguiya</option>
<option>MTL Maltese Lira</option>
<option>MUR Mauritius Rupee</option>
<option>MVR Maldives Rufiyaa</option>
<option>LIR Italian Lira</option>
<option>LKR Sri Lanka Rupee</option>
<option>LRD Liberian Dollar</option>
<option>LSD Lower Slobovian Dinar</option>
<option>LSL Lesotho Loti</option>
<option>LTL Lithuanian Litas</option>
<option>LUF Luxembourg Franc</option>
<option>LVL Latvian Lat</option>
<option>LYD Libyan Dinar</option>
<option>MAD Moroccan Dirham</option>
<option>MDL Moldovan Leu</option>
<option>MGF Malagasy Franc</option>
<option>MKD Macedonian Denar</option>
<option>MMK Myanmar Kyat</option>
<option>MNT Mongolian Tugrik</option>
<option>MOP Macau Pataca</option>
<option>MRO Mauritania Ouguiya</option>
<option>MTL Maltese Lira</option>
<option>MUR Mauritius Rupee</option>
<option>MVR Maldives Rufiyaa</option>
<option>MWK Malawi Kwacha</option>
<option>MXN Mexican Peso</option>
<option>MXP Mexican Peso</option>
<option>MYR Malaysian Ringgit</option>
<option>MZM Mozambique Metical</option>
<option>NAD Namibian Dollar</option>
<option>NGN Nigerian Naira</option>
<option>NIO Nicaragua Cordoba</option>
<option>NIS New Israeli Shekel</option>
<option>NLG Netherlands (Dutch) Guilder</option>
<option>NOK Norwegian Krone</option>
<option>NPR Nepalese Rupee</option>
<option>NZD New Zealand Dollar</option>
<option>OMR Omani Rial</option>
<option>PAB Panama Balboa</option>
<option>PEN Peruvian Nuevo Sol</option>
<option>PGK Papua New Guinea Kina</option>
<option>PHP Philippine Peso</option>
<option>PKR Pakistani Rupee</option>
<option>PLN Polish NEW Zloty</option>
<option>PLZ Polish Zloty</option>
<option>PTE Portuguese Escudo</option>
<option>PYG Paraguayan Guarani</option>
<option>QAR Qatar Rial</option>
<option>RlS Iranian Rial</option>
<option>ROL Romanian Leu</option>
<option>RP Indonesian Rupiah</option>
<option>RSD Republic of Serbia Dinar</option>
<option>RUB Russian Rouble</option>
<option>RWF Rwanda Franc</option>
<option>SAR Saudi Arabian Riyal</option>
<option>SBD Solomon Islands Dollar</option>
<option>SCR Seychelles Rupee</option>
<option>SDD Sudanese Dinar</option>
<option>SEK Swedish Krona</option>
<option>SFR Swiss Francs</option>
<option>SGD Singapore Dollar</option>
<option>SGP Singapore Dollars</option>
<option>SHP St . Helena Pound</option>
SIT Slovenian Tolar</option>
<option>SKK Slovak Koruna</option>
<option>SLL Sierra Leone Leone</option>
<option>SOS Somali Shilling</option>
<option>SRG Surinam Guilder</option>
<option>STD Sao Tome Dobra</option>
<option>SVC El Salvador Colon</option>
<option>SYP Syrian Pound</option>
<option>SZL Swaziland Lilageni</option>
<option>TEC Transaction Exchange Currency</option>
<option>THB Thai Baht</option>
<option>TND Tunisian Dinar</option>
<option>TOP Tonga Pa ‘anga</option>
<option>TRL Turkish Lira</option>
<option>TRY New Turkish Lira</option>
<option>TTD Trinidad & Tobago Dollar</option>
<option>TWD Taiwan Dollar</option>
<option>TZS Tanzanian Shilling</option>
<option>UAH Ukraine Hryvnia</option>
<option>UGS Uganda Shilling</option>
<option>UGX Ugandan Shilling</option>
<option>UNK Unknown</option>
<option>USD United States Dollar</option>
<option>UYP Uruguayan Peso</option>
<option>UYU Uruguay Peso</option>
<option>UZS Uzbekistan Sum</option>
<option>VEB Venezuelan Bolivar</option>
<option>VND Vietnam Dong</option>
<option>VUV Vanuatu Vatu</option>
<option>WST Samoa Tala</option>
XAF Communaute Financiere Africaine <option>Franc (Cameroon)</option>
<option>XBT Bitcoin</option>
<option>XPF Pacific Franc</option>
<option>XPT Platinum Ounces</option>
<option>YER Yemen Riyal</option>
<option>YTL New Turkish Lira</option>
<option>YUM Yugoslav Dinar</option>
<option>YUN Yugoslav Dinar</option>
<option>ZAR South African Rand</option>
<option>ZBD Zimbabwe Dollar</option>
<option>ZMK Zambian Kwacha</option>
<option>ZWD Zimbabwe Dollar</option>
</select>

<button type=”submit” name=”submit” value=”submit”>Convert</button>
</form>

</body>
</html>

It has a self-calling form with three text inputs, two select controls and a submit button.

Here is the PHP

<?php
$mult = $_POST [‘t1’];
if ($mult != “Amount to Convert”) {
$from = substr ($_POST[‘s1’],0,3);
$to = substr ($_POST[‘s2’],0,3);
$fr = $_POST[‘s1’];
$t = $_POST[‘s2′];
$dstr= “http://download.finance.yahoo.com/d/quotes.csv?s=&#8221; . $from . $to .”=X&f=l1″;
$fil = file_get_contents ($dstr);
$val = strval (round ($fil * $mult, 2));
if (strlen ($val) – strpos ($val,”.”) < 3) $val = $val .”0″;
}
?>

$mult stores the amount to convert and is obtained by a post from the first input box.
$from, $to, $fr and $t are the currencies from the select controls, $from and $to having the symbols extracted.
$dstr is the string to link to finance.yahoo,com quotes for the conversion.
In one step, the command file_get_contents puts a string value from the website in the variable $fil.
$val, which is the value in the to currency is obtained by multiplying the exchange rate by the amount to be converted and limiting the output to two decimal places.
If the final decimal value is a zero, it would normally not be displayed, so the last line appends the zero if that happens.

<input type=”text” id=”t2″ name=”t2″ value='<?php echo (“Value – ” . $val); ?>’ />
displays the value in the to currency.

<input type=”text” id=”t3″ name=”t3″ value='<?php echo ($fr . ” – ” . $t); ?>’ />
displays the currencies that were converted.

Here is how the GUI looks, using an android phone with Dolphin as the browser:

Click image for larger view

ConverterGUI

To convert,choose a from currency from the top list, a to currency from the bottom list, enter the amount to convert in the top input box and hit the convert button.

Here is how it looks after converting Britisah Pounds to Brazilian Real:

Click image for larger view

pound2real

Create Your Own Offline Translator

Here is the situation: you are in a foreign country, you don’t know the language and the people do not know your language. You have a phone and there are online translators, but your plan does not cover that country and wifi is almost nonexistent. This post will discuss a customized translator that you can create.
The main file has a Spanish translator built in. other languages are added as javascript files.

Here are the codes:

Main File

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’&gt;
<html xmlns=’http://www.w3.org/1999/xhtml’&gt;
<head profile=’http://gmpg.org/xfn/11′&gt;
<title>Translate</title>
<style type=’text/css’>
body {margin-left:0;margin-right:0;font:normal normal 800 15px Arial; white-space: pre-wrap}
a{ text-decoration: }
:link { color: rgb(0, 0, 255) }
:visited {color :rgb(100, 0,100) }
:hover { }
:active { }
#e1 {position: relative; width: 100%;}
#t1, #t2, #t3, #t4{position: relative; width: 100% ; font:normal normal 800 30pt Arial; height: 60pt; border: 2px solid black}
#s1, #s2{position: relative; font:normal normal 800 30pt Arial }
#s3{position: relative; font:normal normal 800 30pt Arial ; width: 100%}
</style>
</head>
<body><input type=”text” id=”t2″ name=”t2″ value=”Spanish – ” /><input type=”text” id=”t3″ name=”t3″ value=”German – ” /><input type=”text” id=”t4″ name=”t4″ value=”French – ” /><select name=”s1″ id=”s1″>
<option >Choose Second Person Form</option>
<option >Familiar</option>
<option >Formal</option>
<option >Plural</option>
</select>
<select name=”s3″ id=”s3″ onchange=’translate();’>
<option >Choose Phrase</option>
<option >How do I get to the airport</option>
<option >I am</option>
<option >The moon is bright tonight</option>
<option >I want to go home</option>
<option >You are</option>
<option >How much does that cost</option>
<option >When do we eat</option>
<option >Could you please repeat that more slowly</option>
</select>
<div id=”e1″></div>

<script type=’text/javascript’ src=”german.js”></script>
<script type=’text/javascript’ src=”french.js”></script>
<script type=’text/javascript’>

var tst=””;

function translate () {
tst = document.getElementById (“s3”).value;
document.getElementById (“e1″).innerHTML=””;
document.getElementById (“t2”).value = “Spanish – “;
document.getElementById (“t3”).value = “German – “;
document.getElementById (“t4”).value = “French – “;

if ( tst == “I am”) {
document.getElementById (“t2”).value += “Yo soy”;
translate2 (tst);
translate3 (tst);
}

if ( tst == “When do we eat”) {
document.getElementById (“t2”).value += “Cu\xE1ndo comemos”;
translate2 (tst);
translate3 (tst);
}

if ( tst == “The moon is bright tonight”) {
document.getElementById (“t2”).value += “La luna es brillante esta noche”;
translate2 (tst);
translate3 (tst);
}

if ( tst == “How much does that cost”) {
document.getElementById (“t2”).value += “Cuanto cuesta eso”;
translate2 (tst);
translate3 (tst);
}

if ( tst == “How do I get to the airport”) {
document.getElementById (“t2”).value += “Como puedo llegar al aeropuerto”;
document.getElementById (“e1″).innerHTML=’Spanish <audio controls=”controls”> <source src=”getAirportSp.mp3″ /> <source src=”getAirportSp.ogg” /> </audio>’;
translate2 (tst);
translate3 (tst);
}

if (tst == “You are”) {
if (document.getElementById (“s1”).value == “Familiar”) document.getElementById (“t2”).value += “T\xFA eres”;
if (document.getElementById (“s1”).value == “Formal”) document.getElementById (“t2”).value += “Usted es”;
if (document.getElementById (“s1”).value == “Plural”) document.getElementById (“t2”).value += “Ustedes son”;
translate2 (tst);
translate3(tst);
}

if (tst == “Could you please repeat that more slowly”) {
if (document.getElementById (“s1”).value == “Familiar”) document.getElementById (“t2”).value += “puedes por favor repetir m\xE1s despacio”;

if (document.getElementById (“s1”).value == “Formal”) {
document.getElementById (“t2”).value += “puede por favor repetir m\xE1s despacio”;
document.getElementById (“e1″).innerHTML=’Spanish <audio controls=”controls”> <source src=”RepeatSlowlySp.mp3″ /> <source src=”RepeatSlowlySp.ogg” /> </audio>’;
}

if (document.getElementById (“s1”).value == “Plural”) document.getElementById (“t2”).value += “pueden por favor repetir m\xE1s despacio”;
translate2 (tst);
translate3(tst);
}

if ( tst == “I want to go home”) {
document.getElementById (“t2”).value += “Quiero ir a casa”;
translate2 (tst);
translate3 (tst);
}

}
</script>
</body>
</html>

Here is a German file:

function translate2 (tst2) {
document.getElementById (“t3”).value = “German – “;if ( tst2 == “The moon is bright tonight”) document.getElementById (“t3”).value += “Der Mond ist hell heute Abend”;if ( tst2 == “How do I get to the airport”) {
document.getElementById (“t3”).value += “Wie komme ich zum Flughaven”;
document.getElementById (“e1″).innerHTML +='<br /><br />German <audio controls=”controls”> <source src=”GetAirportGe.mp3″ /> <source src=”GetAirportGe.ogg” /> </audio>’;
}if ( tst2 == “How much does that cost”) document.getElementById (“t3”).value += “Wieviel kostet das”;if ( tst2 == “I am”) document.getElementById (“t3”).value += “Ich bin”;

if ( tst2 == “When do we eat”) document.getElementById (“t3”).value += “Wann Essen wir”;

if ( tst2 == “I want to go home”) document.getElementById (“t3”).value += “Ich will nach Hause gehen”;

if ( tst2 == “You are”) {
if (document.getElementById (“s1”).value == “Familiar”) document.getElementById (“t3”).value += “Du bist”;
if (document.getElementById (“s1”).value == “Formal”) document.getElementById (“t3”).value += “Sie sind”;
if (document.getElementById (“s1”).value == “Plural”) document.getElementById (“t3”).value += “Ihr seid”;
}

if ( tst2 == “Could you please repeat that more slowly”) {
if (document.getElementById (“s1”).value == “Familiar”) document.getElementById (“t3”).value += “Kanst du das bitte wiederholen mehr langsam”;;
if (document.getElementById (“s1”).value == “Formal”) document.getElementById (“t3”).value += “K\xF6nnten Sie das bitte wiederholen mehr langsam”;
if (document.getElementById (“s1”).value == “Plural”) document.getElementById (“t3”).value += “K\xF6nnten Sie das bitte wiederholen mehr langsam”;;
}

}

Here is a French file:

function translate3 (tst2) {
document.getElementById (“t4”).value = “French – “;if ( tst2 == “The moon is bright tonight”) document.getElementById (“t4”).value += “La lune est brillante ce soir”;if ( tst2 == “How do I get to the airport”) document.getElementById (“t4”).value += “Comment puis-je arriver \xE0 l’a\xE9roport”;if ( tst2 == “How much does that cost”) document.getElementById (“t4”).value += “Combien \xE7a c\xF4ute”;if ( tst2 == “I am”) document.getElementById (“t4”).value += “Je suis”;

if ( tst2 == “When do we eat”) document.getElementById (“t4”).value += “Quand mangeons nous”;

if ( tst2 == “I want to go home”) {
document.getElementById (“t4”).value += “Je veux rentrer chez moi”;
document.getElementById (“e1″).innerHTML +='<br /><br /><br /><br />French <audio controls=”controls”> <source src=”ReturnHomeFr.mp3″ /> <source src=”ReturnHomeFr.ogg” /> </audio>’;
}

if ( tst2 == “You are”) {
if ( document.getElementById (“s1”).value == “Familiar”) document.getElementById (“t4”).value += “Tu es”;
if ( document.getElementById (“s1”).value == “Formal” || document.getElementById (“s1”).value == “Plural” ) document.getElementById (“t4”).value += “Vous \xEAttes”;
}
if ( tst2 == “Could you please repeat that more slowly”) {
if ( document.getElementById (“s1”).value == “Familiar”) document.getElementById (“t4”).value += “peux-du s’ il vous pla\xEEt r\xE9p\xE9ter que plus lentement”;
if ( document.getElementById (“s1”).value == “Formal” || document.getElementById (“s1”).value == “Plural” ) document.getElementById (“t4”).value += “pourriez-vous s’ il vous pla\xEEt r\xE9p\xE9ter que plus lentement”;
}

}

The phrases are stored as items of a select control. Clicking a phrase triggers an onchange event which calls the translate() function:
<select name=”s3″ id=”s3″ onchange=’translate();’>

The translate() function parses the information, displays the Spanish translation and calls similar functions in the German and French javascript files.
if ( tst == “I am”) {
document.getElementById (“t2”).value += “Yo soy”;
translate2 (tst);
translate3 (tst);
}

For some phrases I have included an audio. This is done by embedding a player in a division. Here is an example of one of those:
if ( tst == “How do I get to the airport”) {
document.getElementById (“t2”).value += “Como puedo llegar al aeropuerto”;
document.getElementById (“e1″).innerHTML=’Spanish <audio controls=”controls”> <source src=”getAirportSp.mp3″ /> <source src=”getAirportSp.ogg” /> </audio>’;
translate2 (tst);
translate3 (tst);
}

Since there are three second person forms, clicking one determines which type of second person will be displayed
<select name=”s1″ id=”s1″>
<option >Choose Second Person Form</option>
<option >Familiar</option>
<option >Formal</option>
<option >Plural</option>
</select>

This snippet shows the second person code with an audio for the formal singular
if (tst == “Could you please repeat that more slowly”) {
if (document.getElementById (“s1”).value == “Familiar”) document.getElementById (“t2”).value += “puedes por favor repetir m\xE1s despacio”;

if (document.getElementById (“s1”).value == “Formal”) {
document.getElementById (“t2”).value += “puede por favor repetir m\xE1s despacio”;
document.getElementById (“e1″).innerHTML=’Spanish <audio controls=”controls”> <source src=”RepeatSlowlySp.mp3″ /> <source src=”RepeatSlowlySp.ogg” /> </audio>’;
}

if (document.getElementById (“s1”).value == “Plural”) document.getElementById (“t2”).value += “pueden por favor repetir m\xE1s despacio”;
translate2 (tst);
translate3(tst);
}

To change languages just insert the new from and to phrases over the exising ones, leaving everything else the same. To add new phrases, just copy and paste from the existing template and modify the phrases.

To be safe, if you add audios include mp3 and ogg version.

Since the three languages I have here include accented characters. I have included a file with their javascript codes.

I do not know if this code works for all browsers. I t works for both PC and mobile Firefox as well as other Gecko based browsers. It also works for the webkit based SlimBoat.

Here is how the interface looks on my Android phone using the Firefox for mobile browser

Click image for larger view

GUI

Here is how it looks after choosing a phrase

Click image for larger view

Result

As can be seen, Clips can be added to hear how the phrases sound.

This translator can be customized for translating from any language to any other language. For a new language, just create a new js file, using the ones displayed for templates.

The files included in this translator can be obtained form the following  source

HTML as a Word Processor

It has long been my belief that HTML has been underutilzed as a vehicle for documents.
Here is an example of a “document” that can be created with HTML. This was written with the notepad.html file I had described earlier:
Click image for larger view
2 Page

Here is the code:

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’&gt;
<html xmlns=’http://www.w3.org/1999/xhtml’&gt;
<head profile=’http://gmpg.org/xfn/11′&gt;
<title>2 Page</title>
<style type=’text/css’>
body {margin-left:0;margin-right:0;font:normal normal normal 12px Arial; white-space: pre-wrap}
a{ text-decoration: }
:link { color: rgb(0, 0, 255) }
:visited {color :rgb(100, 0,100) }
:hover { }
:active { }
body {margin-left:0;margin-right:0;  height: 1736pt}
#canvas{position: relative; width: 100%;; left:10%; top: -50pt;}
table{position: relative; width: 602pt; left: 50%; margin-left: -301pt;top: 450pt; border: 6px ridge; border-collapse: collapse; empty-cells: show}
td{position: relative; border: 6px ridge}
.letter{position:absolute;padding:10pt 36pt;width:612pt;height:828pt;left:50%; top: 10pt;background-color:#FAFADD;border-width:0;font:normal normal 400 10px cancunn; margin-left: -384pt; border: 1pt solid black; white-space: pre-wrap}.page2{position:absolute;padding:10pt 36pt;width:612pt;height:828pt;left:50%; top: 868pt;background-color:#FAFADD;border-width:0;font:normal normal normal 13pt Times New Roman; margin-left: -384pt; border: 1pt solid black; white-space: pre-wrap}
@font-face { font-family: ‘cancunn’;
src: url(‘cancunn-webfont.eot’);
src: url(‘cancunn-webfont.eot?#iefix’) format(’embedded-opentype’),
url(‘cancunn-webfont.woff’) format(‘woff’),
url(‘cancunn-webfont.ttf’) format(‘truetype’),
url(‘cancunn-webfont.svg#cancunn’) format(‘svg’);
font-weight: normal;
font-style: normal;
}
@font-face { font-family: ‘snellk’;
src: url(‘snellk-webfont.eot’);
src: url(‘snellk-webfont.eot?#iefix’) format(’embedded-opentype’),
url(‘snellk-webfont.woff’) format(‘woff’),
url(‘snellk-webfont.ttf’) format(‘truetype’),
url(‘snellk-webfont.svg#snellk’) format(‘svg’);
font-weight: normal;
font-style: normal;
}
.s1{font:normal normal 800 20px snellk}
.s2{font:italic normal 800 16px Times New Roman; color: red}
svg{position: absolute; width: 98%; height: 200pt; top: 0; left: 1%; background: #EEFFF8}
</style><script type=”text/JavaScript” src=”jsDraw2D.js”></script>
<script type=”text/JavaScript”>
var str = “”; var str2=””;
var i = 0;
function draw() {var gr = new jsGraphics(document.getElementById(“canvas”));
points = new Array(new jsPoint(65,656),  new jsPoint(60,595),  new jsPoint(65,532),  new jsPoint(67,450),  new jsPoint(83,375),  new jsPoint(92,335),  new jsPoint(104,291),  new jsPoint(117,241),  new jsPoint(135,189),  new jsPoint(158,159),  new jsPoint(186,112),  new jsPoint(227,76),  new jsPoint(261,59),  new jsPoint(293,58),  new jsPoint(345,53),  new jsPoint(391,62),  new jsPoint(433,77),  new jsPoint(470,98),  new jsPoint(509,152),  new jsPoint(529,200),  new jsPoint(556,330),  new jsPoint(551,383),  new jsPoint(537,420),  new jsPoint(522,444),  new jsPoint(493,489),  new jsPoint(487,537),  new jsPoint(502,583),  new jsPoint(545,626),  new jsPoint(563,661),  new jsPoint(563,661));
gr.fillClosedCurve(new jsColor(“#553311”), points);points2 = new Array(new jsPoint(282,661),  new jsPoint(259,588),  new jsPoint(218,552),  new jsPoint(183,465),  new jsPoint(172,415),  new jsPoint(163,374),  new jsPoint(181,347),  new jsPoint(183,291),  new jsPoint(217,246),  new jsPoint(267,214),  new jsPoint(332,204),  new jsPoint(381,211),  new jsPoint(428,240),  new jsPoint(461,285),  new jsPoint(493,320),  new jsPoint(506,346),  new jsPoint(524,319),  new jsPoint(538,311),  new jsPoint(550,328),  new jsPoint(545,362),  new jsPoint(543,389),  new jsPoint(525,433),  new jsPoint(509,438),  new jsPoint(494,438),  new jsPoint(493,487),  new jsPoint(489,521),  new jsPoint(488,552),  new jsPoint(505,587),  new jsPoint(544,623),  new jsPoint(561,667));
gr.fillClosedCurve(new jsColor(“#FFEECC”), points2);points3 = new Array(new jsPoint(251,579),  new jsPoint(278,602),  new jsPoint(301,620),  new jsPoint(324,630),  new jsPoint(345,631),  new jsPoint(370,625),  new jsPoint(385,621),  new jsPoint(401,613),  new jsPoint(414,603),  new jsPoint(427,592),  new jsPoint(445,580),  new jsPoint(455,570),  new jsPoint(466,560),  new jsPoint(473,547),  new jsPoint(479,534),  new jsPoint(483,524),  new jsPoint(489,505),  new jsPoint(492,491),  new jsPoint(493,482),  new jsPoint(493,474));
gr.drawCurve(new jsPen( new jsColor(“black”),2),  points3);

points4 = new Array(new jsPoint(280,537),  new jsPoint(300,537),  new jsPoint(319,537),  new jsPoint(335,537),  new jsPoint(348,536),  new jsPoint(361,534),  new jsPoint(375,534),  new jsPoint(397,529),  new jsPoint(394,543),  new jsPoint(385,550),  new jsPoint(377,558),  new jsPoint(370,563),  new jsPoint(362,569),  new jsPoint(350,572),  new jsPoint(338,574),  new jsPoint(328,571),  new jsPoint(316,570),  new jsPoint(307,565),  new jsPoint(299,561),  new jsPoint(285,555));
gr.fillClosedCurve(new jsColor(“#FF5599”), points4);
gr.drawCurve(new jsPen( new jsColor(“#DD3366”),2),  points4);

points5 = new Array(new jsPoint(310,548),  new jsPoint(310,548),  new jsPoint(337,547),  new jsPoint(360,545),  new jsPoint(360,549),  new jsPoint(346,554),  new jsPoint(341,554),  new jsPoint(332,556),  new jsPoint(310,548),  new jsPoint(310,548));
gr.fillClosedCurve(new jsColor(“#EEEEEE”), points5);

points6 = new Array(new jsPoint(350,375),  new jsPoint(342,414),  new jsPoint(351,446),  new jsPoint(365,464),  new jsPoint(367,485),  new jsPoint(358,501),  new jsPoint(341,502),  new jsPoint(322,502),  new jsPoint(308,503),  new jsPoint(293,491),  new jsPoint(293,475),  new jsPoint(300,463),  new jsPoint(305,447),  new jsPoint(308,435),  new jsPoint(306,405),  new jsPoint(303,400),  new jsPoint(298,392),  new jsPoint(295,383));
gr.drawCurve(new jsPen( new jsColor(“#996633”),2),  points6);

points7 = new Array(new jsPoint(359,384),  new jsPoint(376,376),  new jsPoint(392,373),  new jsPoint(406,373),  new jsPoint(420,374),  new jsPoint(437,379),  new jsPoint(436,393),  new jsPoint(427,399),  new jsPoint(417,406),  new jsPoint(406,407),  new jsPoint(374,403),  new jsPoint(374,403));
gr.fillClosedCurve(new jsColor(“#EEEEEE”), points7);
gr.drawClosedCurve(new jsPen( new jsColor(“#333333”),2),  points7);

points8 = new Array(new jsPoint(212,406),  new jsPoint(212,406),  new jsPoint(238,389),  new jsPoint(249,388),  new jsPoint(266,389),  new jsPoint(280,393),  new jsPoint(285,404),  new jsPoint(272,420),  new jsPoint(262,422),  new jsPoint(248,423),  new jsPoint(227,419),  new jsPoint(227,419));
gr.fillClosedCurve(new jsColor(“#EEEEEE”), points8);
gr.drawClosedCurve(new jsPen( new jsColor(“#333333”),2),  points8);

points9 = new Array(new jsPoint(502,437),  new jsPoint(496,432),  new jsPoint(499,416),  new jsPoint(500,400),  new jsPoint(507,371),  new jsPoint(508,360),  new jsPoint(505,345));
gr.drawCurve(new jsPen( new jsColor(“black”),2),  points9);

gr.fillCircle(new jsColor(“#AAAAFF”),new jsPoint(250,406)  ,  16);
gr.fillCircle(new jsColor(“#AAAAFF”),new jsPoint(398,390)  ,  16);
gr.fillCircle(new jsColor(“black”),new jsPoint(250,406)  ,  5);
gr.fillCircle(new jsColor(“black”),new jsPoint(398,390)  ,  5);

points10 = new Array(new jsPoint(351,364),  new jsPoint(372,359),  new jsPoint(395,355),  new jsPoint(417,352),  new jsPoint(436,353),  new jsPoint(452,361),  new jsPoint(442,362),  new jsPoint(428,362),  new jsPoint(415,366),  new jsPoint(401,369),  new jsPoint(383,372),  new jsPoint(364,372));
gr.fillClosedCurve(new jsColor(“#553311”),  points10);

points11 = new Array(new jsPoint(189,388),  new jsPoint(197,383),  new jsPoint(212,375),  new jsPoint(238,372),  new jsPoint(265,372),  new jsPoint(290,380),  new jsPoint(282,386),  new jsPoint(267,384),  new jsPoint(251,384),  new jsPoint(237,384),  new jsPoint(222,383),  new jsPoint(207,387));
gr.fillClosedCurve(new jsColor(“#553311”),  points11);

points12 = new Array(new jsPoint(522,352),  new jsPoint(528,334),  new jsPoint(538,321),  new jsPoint(539,340),  new jsPoint(537,363),  new jsPoint(528,389),  new jsPoint(523,418),  new jsPoint(507,430),  new jsPoint(510,415),  new jsPoint(515,387));
gr.drawClosedCurve(new jsPen( new jsColor(“black”),2),  points12);
}
</script>

</head>
<body onload=’draw();’>

<div class=”letter”>
<center><span style=”font-size: 19px;” >Antioxidents</span></center>
<span style=”background: #EFFF08;” >Antioxidents</span>  are chemicals that prevent harmful effects of <i><u><span style=”background: #99CCFF  ;” >free-radicals</span>, highly reactive transient chemicals</u></i>.  Therefore I shall begin with a brief description of free-radicals. Most atoms in molecules are joined by what is known as a <span class=”s2″> covalent bond, a bond in which each atom contributes one electron and they share the paired electrons as a bond</span>. If enough energy is supplied, the necessary amount varying according to the strength of the bond, the bond can be cleaved. If one atom gets both electrons, there is ionization; if each gets one atom, there is free-radical formation. Although some free-radicals can be stabilized, and stable free-radicals can be purchased, <span class=”s2″>in most cases they are highly reactive and stabilize themselves often by extracting an atom from another molecule, leading to the formation of a new free-radical</span>. Often these secondary free-radicals are molecules of <span class=”s2″> DNA or Protein</span>, leading to genetic problems and tissue damage.

The problem largely arises from the use of <span style=”background: #FF8888″>Oxygen</span>, which is in actuality a diradical. <span style=”background: #FF8888″>Oxygen</span> can react with unsaturated bonds, such as those in fatty acids to form <span class=”s2″> Peroxides</span>, chemicals containing an O-O bond. <span class=”s2″>The Oxygen-Oxygen bond is weak and can be cleaved to form two reactive free-radicals</span>.

Many of the free-radical fighting agents are naturally made. These are either enzymes, or other biochemicals that are generally prepared by enzymes. Often these enzymes depend on essential nutrients as cofactors for their function. One such enzyme is <span class=”s1″> superoxide dismutase</span> , which contains <span style=”background: #FFCC99  ;” >Copper</span> and <span style=”background: #BBBBBB  ;” >Zinc</span>. <span class=”s1″> Superoxide dismutase</span> converts the superoxide anion to water and hydrogen peroxide. The hydrogen peroxide is then neutralized by an enzyme called <span class=”s1″> catalase</span>, which contains <span style=”background: #AA7755″>Iron</span>. Another set of enzymes are the <span class=”s1″> Peroxidases</span>. Most <span class=”s1″> Peroxidases</span> contain <span class=”s2″> Heme</span>, the <span style=”background: #AA7755″>Iron</span> containing substrate that is also found in <span class=”s2″>Hemoglobin and Myoglobin</span>. Indeed, <span class=”s2″>Hemoglobin has Peroxidase activity</span>, which is exploited in its forensic determination. Another important <span class=”s1″> Peroxidase</span>, <span class=”s1″a> glutathione peroxidase</span> contains <span class=”s2″>Selenium</span>. Another endogenous (formed from within) antioxidant is <span class=”s2″>Uric Acid, a byproduct of the breakdown of the Purine parts of Nucleic Acids</span>. A key enzyme in the formation of Uric Acid, <span class=”s1″> xanthine oxidase</span>, is derived from <span class=”s2″>Molybdenum</span>, <span style=”background: #AA7755″>Iron</span> and <span class=”s2″>Riboflavin</span>.

Exogenous (from outside) antioxidants fall into mostly two categories, <span class=”s2″>the Phenols, including the Polyphenols, and the Carotenoids</span>, which are highly unsaturated long chain molecules, where the unsaturation is said to be conjugated. Vitamin C is an Enol, which although not a Phenol, is chemically related. There are also <span style=”background: #FFFF00″> Sulfur</span> containing antioxidants.

<span class=”s2″>Phenols</span> scavenge free-radicals by neutralizing them and forming in the process, intermediates known as <span class=”s2″> Semiquinones</span>, which are themselves free-radicals, but which are relatively stable and generally not reactive enough to react further with DNA and Proteins. The best known phenolic antioxidant is Vitamin E. The Polyphenols are plant pigments of which perhaps the best known is <span class=”s2″> Quercetin</span>.

The best known Carotenoid is <span class=”s2″> Beta Carotene</span>, responsible for the color of carrots and many similarly colored fruits and vegetables. Another known one is <span class=”s2″> Lycopene</span>, which gives the tomato its red color. Carotenoids scavenge free-radicals by forming relatively stable conjugated allylic free-radicals, again, not reactive enough to form harmful products.

<span style=”background: #FFFF00″> Sulfur</span> antioxidents are substances such as <span class=”s2″> N-acetylcysteine</span>, a derivative of a non-essential amino acid. Also, <span class=”s2″> Lipoic Acid</span>, a non-essential biochemical used in bioreactions involving <span class=”s2″> Thiamin</span>, in larger quantities can function as an antioxident.

</div>
<div class=”page2″>
<div id=’canvas’></div>
<table>
<tr>
<td style=”height: 200pt; width: 50%”><svg xmlns=”http://www.w3.org/2000/svg&#8221; version=”1.1″ >
<ellipse cx=”50%” cy=”50% ” rx=”25%” ry=”25%” style=”fill: #FFFF66; stroke-width: 3pt; stroke: yellow” >
</svg>
</td><td>
This cell will have some multiline text
This will be the second line
and a third line
and a fourth line
and a fifth line
and a sixth line
and a seventh line
</td>
</tr>
<tr>
<td>
This cell will also have multiline text
This will be the second line
and a third line
and a fourth line
and a fifth line
and a sixth line
and a seventh line
</td><td> </td>
</tr>
</table>

</div>

</body>
</html>

This file was designed to have the page appearance of a word processor.

The first page has formatted text. Included is different highlighting for different words and different fonts, colors, sizes and weights. Indeed, embedded are two fonts not normally found that can be viewed as written.

The second page has a table in which is included SVG and jsDraw2D
Graphics and multiline text.

The text formatting was done by means of the <span> tag. To cut down on repetition, the <span> for frequent formatting was made into a class and could be referred to by its ID every time:
.s2{font:italic normal 800 16px Times New Roman; color: red}
<span class=”s2″>Hemoglobin and Myoglobin</span>

The highlighting was done by setting the background color of the <span>
<span style=”background: #FFFF00″> Sulfur</span>

Using jsDraw2D has been discussed before

HTML, in my opinion has advantages over word processor formats:
This entire file is only 14kb  Of course, jsDraw2D.js must be imported
for this particular file. but that is not a large file and can be used for all documents with drawings. Additionally, the embedded fonts must be imported, but that is an option not even available with word processors.

Not everyone has the ability to read word processor formats without downloading software. HTML can be read with any device having a browser, inclucing mobile devices.

HTML is able to embed exotic fonts so they can be viewed as written, without substitution of a generic font

Essentially anything done with a word processor can be duplicated with HTML, inclucing formatting, graphics, images, hyperlinks, tables, spreadsheets (see the previous post), extruded text (see the previous post), and with PHP, files can be manipulated. In addition to tables, divsions can be created to separate various parts of a page as different frames.

In other words, everything that is necessary for home publishing

Optical Illusion – Yellow Dots

This illusion has a series of horizontal and vertical blue lines with small gaps between them, set on a yellow background. The illusion is the perception of yellow dots at the intesections.

Here is how it looks:

Click image for larger view

YellowDots

Here is the code:

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’&gt;
<html xmlns=’http://www.w3.org/1999/xhtml’&gt;
<head profile=’http://gmpg.org/xfn/11′&gt;
<title>Yellow Circles</title>
<style type=’text/css’>
body {margin-left:0;margin-right:0;font:normal normal normal 12px Arial; white-space: pre-wrap}
a{ text-decoration: }
:link { color: rgb(0, 0, 255) }
:visited {color :rgb(100, 0,100) }
:hover { }
:active { }
#bk{position: absolute; left:50% ; top:100px ; width:700px ; height:500px ;background: yellow; margin-left: -350px  }
#ln00,#ln01,#ln02,#ln03,#ln04,#ln10,#ln11,#ln12,#ln13,#ln14,#ln20,#ln21,#ln22,#ln23,#ln24,#ln30,#ln31,#ln32,#ln33,#ln34,#ln40,#ln41,#ln42,#ln43,#ln44,#ln50,#ln51,#ln52,#ln53,#ln54,#ln60,#ln61,#ln62,#ln63,#ln64{position: absolute; width:2px ; height:80px ;background: blue  }#h00,#h01,#h02,#h03,#h04,#h10,#h11,#h12,#h13,#h14,#h20,#h21,#h22,#h23,#h24,#h30,#h31,#h32,#h33,#h34,#h40,#h41,#h42,#h43,#h44,#h50,#h51,#h52,#h53,#h54,#h60,#h61,#h62,#h63,#h64{position: absolute; width:80px ; height:2px ;background: blue  }

</style>
</head>
<body onload=”makeLines();”>

<div id=”bk”></div>
<script type=”text/javascript”>

function makeLines() {
for (var j = 0;j <= 6; j++) {
for (var i = 0;i <=4; i++) {
var tp = (100*i).toString()+ “px”;
var rt = (100*j).toString()+ “px”;
var tp2 = (100*i – 10).toString()+ “px”;
var rt2 = (100*j + 11).toString()+ “px”;
var el =’ln’ + j.toString() + i.toString();
var el2 =’h’ + j.toString() + i.toString();
var prel = ‘<div id=’ + el + ‘></div>’ + ‘<div id=’ + el2 + ‘></div>’;
document.getElementById(“bk”).innerHTML = document.getElementById(“bk”).innerHTML + prel;
document.getElementById(el).style.top=tp;
document.getElementById(el).style.left=rt;
document.getElementById(el2).style.top=tp2;
document.getElementById(el2).style.left=rt2;
if (i == 0) document.getElementById(el2).style.backgroundColor=”white”;
if (j == 0) document.getElementById(el).style.backgroundColor=”white”;
}
}
}

</script>
</body>
</html>

All the lines are css divisions.

The layer “bk” creates the yellow background.

The common properties of the blue lines, the width, height and background are combined into a common series of layers.

The variable properties are created with the javascript function makeLines().

In that the left and top position of each line is set up by loops incrementing the values.
for (var j = 0;j <= 6; j++) {
for (var i = 0;i <=4; i++) {
var tp = (100*i).toString()+ “px”;
var rt = (100*j).toString()+ “px”;
var tp2 = (100*i – 10).toString()+ “px”;
var rt2 = (100*j + 11).toString()+ “px”;

The layer names are obtained from the same loops, converted to strings and used to create the divisions dynamically

var prel = ‘<div id=’ + el + ‘></div>’ + ‘<div id=’ + el2 + ‘></div>’;

document.getElementById(“bk”).innerHTML = document.getElementById(“bk”).innerHTML + prel;

The variables are then used to set the left and top positions of each layerdocument.getElementById(el).style.top=tp;
document.getElementById(el).style.left=rt;.