MY ANNUAL INCOME £ POUND $ US ¥ YEN $ CAN € EURO
-
-
-
-
-
-
-
-
- var ourpoor;
- var ourrich;
- var strInput;
- var strIncome;
- var strPlace2;
- var redman_startpos=21;
- var redman_lastpos=714;
- var redman_stepsize=7;
- var minDollarToCalc=100;
- var maxDollarToCalc=200000;
-
-
-
- ns4=(document.layers)? true : false
- ns6=(document.getElementById)? true : false
- ie4=(document.all)? true : false
-
-
-
- var agt=navigator.userAgent.toLowerCase();
- var iswin=(agt.indexOf( "win" )!=-1);
- var ismac=(agt.indexOf( "mac" )!=-1);
- var isopera=(agt.indexOf( "opera" )!=-1);
-
-
- totalPopulation=6000000000;
- avarageYearlyIncome=5000;
- totalWorldwideYearlyIncome=totalPopulation*avarageYearlyIncome;
-
-
- peopleBlock= new Array(0,600000,1200000,3000000,4500000,5100000,5395000,5700000,5940000,5999990);
- moneyBlock= new Array(50,400,500,850,1486.67,2182.35,25000,33700,47500,202000);
-
-
-
-
-
-
-
- function calcTrendRSquare(arrX,arrY){
-
- var n=arrX.length;
- var sumX=0;
- var sumY=0;
- var sumXY=0;
- var sumX2=0;
- var sumY2=0;
-
- for ( var i=0;i<arrX.length;i++){
- sumX+=arrX[i];
- sumY+=arrY[i];
- sumXY+=arrX[i]*arrY[i];
- sumX2+=Math.pow(arrX[i],2);
- sumY2+=Math.pow(arrY[i],2);
- }
-
- var sumX2_2=Math.pow(sumX,2);
- var sumY2_2=Math.pow(sumY,2);
-
- var slope_m=(n*sumXY-sumX*sumY)/(n*sumX2-sumX2_2);
- var yInt_b=(sumY-slope_m*sumX)/n;
- var r=(n*sumXY-sumX*sumY)/Math.sqrt((n*sumX2-sumX2_2)*(n*sumY2-sumY2_2));
-
- var returnArray= new Array(slope_m,yInt_b,r);
- return returnArray;
- }
-
-
- function getPeoplePoorer(bIndex,income){
-
-
- var people= new Array(peopleBlock[bIndex],peopleBlock[bIndex+1]);
- var money= new Array(moneyBlock[bIndex],moneyBlock[bIndex+1]);
-
- var rSquare=calcTrendRSquare(people,money);
-
-
- var peoplePoorer=((income+(rSquare[1]*-1))/rSquare[0])*1000;
- return peoplePoorer;
-
- }
-
-
- arrDidYouKnow= new Array();
- arrDidYouKnow[0]= "Theworld's225richestpeoplenowhaveacombinedwealthof$1trillion."
- "That'sequaltothecombinedannualincomeoftheworld's2.5billionpoorestpeople" ;
- arrDidYouKnow[1]= "Threebillionpeopleliveonlessthan$2perdaywhile1.3billiongetbyonlessthan"
- "$1perday.Seventypercentofthoselivingonlessthan$1perdayarewomen." ;
- arrDidYouKnow[2]= "Threedecadesago,thepeopleinwell-to-docountrieswere30timesbetteroffthan"
- "thoseincountrieswherethepoorest20percentoftheworld'speoplelive.By1998,thisgaphad"
- "widenedto82times." ;
- arrDidYouKnow[3]= "MicrosoftCEOBillGateshasmorewealththanthebottom45percentofAmerican"
- "householdscombined." ;
-
-
-
- function open_window(qs){
-
-
- width=400;
- height=300;
-
-
- sx=screen.width/2-width/2;
- sy=screen.height/2-height/2;
-
-
- window.open( 'download.php?' +escape(qs), '' , 'width=' +width+ ',height=' +height+',resizable=no,toolbar=0,
- location=0,directories=0,status=0,menubar=0,scrollbars=auto,screenX= '+sx+' ,screenY= '+sy+' ,top= '+sy+' ,left='+sx);
- }
-
-
-
- function fnSubmit(){
-
-
- if (document.priceForm.strIn.value== "" ){
- new Effect.Shake( 'infield' );
- layerWrite( 'error' , null , 'Pleasetypeinyourincome.' );
- return false ;
- } else {
- layerWrite( 'error' , null , '' );
- }
-
- ourpoor= false ;
- ourrich= false ;
-
-
- arrPlace= new Array();
- strPlace2= "" ;
-
- arrPlaceRicher= new Array();
- strPlaceRicher2= "" ;
-
-
- strInput=document.priceForm.strIn.value;
- currency=document.priceForm.currency.value;
-
-
- strInput=strInput.replace( "." , "" );
- strInput=strInput.replace( "," , "" );
- strInput=strInput.replace( "" , "" );
- strIncome=strInput.toString();
-
- strHourly=(Math.floor((strInput/1440)*100)/100);
-
-
-
- if (currency== "uk" ){
- strInput=strInput*1.8412;
- strCurrency= "┬г" ;
- } else if (currency== "can" ){
- strInput=strInput*0.8961;
- strCurrency= "$" ;
- } else if (currency== "euro" ){
- strInput=strInput*1.257;
- strCurrency= "€" ;
- } else if (currency== "jpn" ){
- strInput=strInput*0.008698;
- strCurrency= "¥" ;
- } else if (currency== "us" ){
- strCurrency= "$" ;
- }
-
-
- if (isNaN(strInput)){
-
-
- new Effect.Shake( 'infield' );
- layerWrite( 'error' , null , 'Pleasetypeinyourincome.' );
-
-
- } else {
-
- layerWrite( 'error' , null , '' );
-
-
-
-
-
-
-
-
-
-
-
- var blockIndex=0;
- for ( var i=0;i<moneyBlock.length;i++){
- if (strInput<moneyBlock[i]){
- blockIndex=i-1;
- break ;
- }
- }
-
-
-
- strPlace=getPeoplePoorer(blockIndex,(strInput*1));
-
-
- strPlace=strPlace.toString();
-
-
- strPlace=strPlace.substring(0,10);
-
-
- strPlace=(strPlace*1);
-
- strPlace_1=strPlace;
- strPlace=6000000000-strPlace;
-
-
- strPercentagePoorer=(strPlace/6000000000)*100;
- strPercentagePoorer=Math.floor(strPercentagePoorer*100)/100;
-
-
- strPlaceRicher=strPlace;
-
-
- strPlace=strPlace_1;
-
-
- strPlace=strPlace.toString();
- strPlaceRicher=strPlaceRicher.toString();
- strIncome=strIncome.toString();
-
-
- tempPlace=strPlaceRicher;
-
- strPlace2=addSpaces(strPlace);
- strPlaceRicher2=addSpaces(strPlaceRicher);
-
-
- if (strInput<=minDollarToCalc){
- ourpoor= true ;
- strPercentagePoorer=1;
- } else if (strInput>maxDollarToCalc){
- ourrich= true ;
- strPercentagePoorer=99;
- }
-
-
- var hourSalary=strInput/1872;
-
-
-
- var copybox= "<spanclass='blackheader'>RICHERTHANYOUTHINK?</span><br/><br/>" ;
-
- copybox+= "Howdoyoufeelaboutthat?Abitricherwehope.Richerandreadytogivesomeof"
- "yournewlyfoundwealthtothosewhoneeditmost.Itnothard-justslipyourhandinyourpocketand"
- "pulloutsomethingspecial.Somethingthatcanhelpredressthebalance-andalsomakeyoufeel"
- "uncommonlygood.Manypeopleslivescouldbehappierifyoudonatedjust" ;
- copybox+= "<strong>onehour'ssalary</strong>(approx<strong><spanclass='red'>$" +
- addDecimals(hourSalary,2)+ "</span></strong>-UKestimate).<br/><br/>" ;
-
- copybox+= "Allyouhavetodoismakeachoice.<br/><br/>" ;
-
- copybox+= "<strong><spanclass='red'>$8</span></strong>couldbuyyou15organicapples"
- "OR25fruittreesforfarmersinHondurastogrowandsellfruitattheirlocalmarket.<br/><br/>" ;
-
- copybox+= "<strong><spanclass='red'>$30</span></strong>couldbuyyouanERDVDBoxset"
- "ORaFirstAidkitforavillageinHaiti.<br/><br/>" ;
-
- copybox+= "<strong><spanclass='red'>$73</span></strong>couldbuyyouanewmobile"
- "phoneORanewmobilehealthclinictocareforAIDSorphansinUganda.<br/><br/>" ;
-
- copybox+= "<strong><spanclass='red'>$2400</span></strong>couldbuyyouasecond"
- "generationHighDefinitionTVORschoolingforanentiregenerationofschoolchildreninanAngolan"
- "village.<br/><br/>" ;
-
-
-
-
-
-
- if (ourpoor== true ){
-
-
-
- var copybox= "<br><br>" ;
- copybox+= "" ;
- copybox+= "<strong>Poorcountrieslosearound£1.3billioneverydayasadirect"
- "resultoftradepoliciesthatputprofitsbeforepeople.</strong><br><br>" ;
-
- copybox+= "Peoplewhoselivescouldbedramaticallyimprovedorevensavedifglobal"
- "traderulesweremadefairer.<br><br>" ;
- copybox+= "<strong>Byworkingtogether-throughMakePovertyHistorywecanhelp"
- "makethedifferencebetweenpovertyandprosperityformillionsofpeople.</strong><br><br>" ;
- copybox+= "Thisisacrucialtimetocampaignfortradejustice.TheWorldTrade"
- "Organisation-oneofthemainorganisationsgoverninginternationaltrade-holdsitsbiennial"
- "summiton13-18December2005,inHongKong.<br><br>" ;
-
- strPlaceRicher2= "5,780,722,892" ;
- strPercentagePoorer= "99.9" ;
-
- tempPlace= "5780722892" ;
- strPlace2= "5,780,722,892" ;
- currpos=redman_startpos;
-
- } else if (ourrich== true ){
-
-
-
- strPlaceRicher2= "107,565" ;
- strPercentagePoorer= "0.001" ;
- tempPlace= "107565" ;
- strPlace2= "107,565" ;
- currpos=redman_lastpos;
-
-
-
- } else if (ourpoor== false &&ourrich== false ){
-
-
-
-
- var stepNbr=Math.round(((100-strPercentagePoorer)*0.01)*100);
-
-
- currpos=Math.round(stepNbr*redman_stepsize)+redman_startpos;
-
- }
-
-
-
- var didyou=arrDidYouKnow[Math.round(Math.random()*3)];
-
- var downloadlink= "<ahref='download.php?" +tempPlace+ "'onFocus='blur();'>Clickhere"
- "</a>todownloadthecodeyou'llneed" ;
-
- var tmpIncome=addSpaces(strIncome);
-
-
- if (strIncome<=999){
- tmpIncome=tmpIncome.replace( "," , "" );
- }
-
-
- var nbrRichest1= "=" +strPlaceRicher2;
- var nbrRichest2=strPlaceRicher2;
- var nbrPercent= "TOP" +strPercentagePoorer+ "%" ;
-
-
-
- if (!ourpoor){
- layerWrite( 'nbrRichest1' , null ,nbrRichest1);
- layerWrite( 'nbrRichest2' , null ,nbrRichest2);
- layerWrite( 'nbrPercent' , null ,nbrPercent);
- }
-
-
-
- layerWrite( 'copybox' , null ,copybox);
-
-
- layerWrite( 'didyou' , null ,didyou);
-
-
- layerWrite( 'downloadlink' , null ,downloadlink);
-
-
-
- layerWrite( 'helpboxrichest' , null ,strPlaceRicher2);
-
-
-
-
- fn_move_pos(currpos);
-
-
- }
-
- }
-
-
-
-
- function reverse(value){
-
- for ( var text= '' ,i=value.length-1;i>-1;i=i-1){
- text+=value.charAt(i);
- }
-
- return text;
- }
-
- function addDecimals(value,nbrOfDecimals){
- value=value.toString();
- var dotIndex=value.lastIndexOf( '.' );
- if (dotIndex<0){
- var decimal= "" ;
- for (i=0;i<nbrOfDecimals;i++)
- decimal+= "0" ;
- } else {
- return value.substring(0,dotIndex+nbrOfDecimals+1);
- }
- }
-
-
-
- function layerWrite(id,nestref,text){
-
- if (ns4){
- var lyr=(nestref)?
- eval( 'document.' +nestref+ '.document.' +id+ '.document' ):document.layers[id].document
- lyr.open()
- lyr.write(text)
- lyr.close()
- }
-
- if (ie4){
- document.all[id].innerHTML=text;
- }
-
-
- if (ns6){
- document.getElementById(id).innerHTML=text;
- }
- }
-
-
- function addSpaces(str){
-
-
- str=reverse(str);
-
-
- for (i=0;i<str.length;i++){
- arrPlace[i]=str.charAt(i);
- }
-
- var str2= "" ;
-
- for (i=0;i<str.length;i++){
- if ((i==2)||(i==5&&(str.length!=6))||(i==8&&(str.length!=9))){
- str2=str2+arrPlace[i]+ ","
- } else {
- str2=str2+arrPlace[i];
- }
- }
-
-
-
- str=reverse(str2);
-
- return str;
- }
-
-
- function fnInclude(){
-
- if (ie4){
- document.all.news.style.visibility= 'visible' ;
- if (iswin){
- document.all.news.style.top=795;
- } else {
- document.all.news.style.top=775;
- }
- } else if (ns4){
- document.news.visibility= 'show' ;
- document.news.top=795;
- } else if (ns6){
- document.getElementById( 'news' ).style.visibility= 'visible' ;
- document.getElementById( 'news' ).style.top=795;
- }
- }
-
-
- function fnIncludeHide(){
-
- if (ie4){
- document.all.news.style.visibility= 'hidden' ;
- if (iswin){
- document.all.news.style.top=795;
- } else {
- document.all.news.style.top=775;
- }
- } else if (ns4){
- document.news.visibility= 'hide' ;
- document.news.top=795;
- } else if (ns6){
- document.getElementById( 'news' ).style.visibility= 'hidden' ;
- document.getElementById( 'news' ).style.top=795;
- }
-
- }
-
-
- function fn_move_pos(topos){
-
- var nowpos=0;
-
- if (ie4){
- nowpos=document.all.redman.style.left;
- document.all.resultblock.style.display= 'block' ;
- document.all.resultblock.style.visibility= 'visible' ;
- } else if (ns4){
- nowpos=document.redman.left;
- document.resultblock.visibility= 'show' ;
- document.resultblock.display= 'block' ;
- } else if (ns6){
- nowpos=document.getElementById( 'redman' ).style.left;
- document.getElementById( 'resultblock' ).style.display= 'block' ;
- document.getElementById( 'resultblock' ).style.visibility= 'visible' ;
- }
-
- if (!nowpos){
- nowpos=redman_startpos;
- } else {
- nowpos=nowpos.substring(0,nowpos.indexOf( 'p' ));
- }
-
- if (ie4&&ismac&&!isopera){
- document.all.redman.style.left=topos;
- } else {
- endpos=topos-nowpos;
- new Effect.ScrollTo( 'resultblock' ,{duration:1.0});
- new Effect.MoveBy( 'redman' ,0,endpos,{duration:1.3,queue: 'end' });
- }
-
- return false ;
-
- }
-
- function hide_pos(){
- if (ie4){
- document.all.arr.style.visibility= 'hidden' ;
- document.all.line.style.visibility= 'hidden' ;
- } else if (ns4){
- document.arr.visibility= 'hide' ;
- document.line.visibility= 'hide' ;
- } else if (ns6){
- document.getElementById( 'arr' ).style.visibility= 'hidden' ;
- document.getElementById( 'line' ).style.visibility= 'hidden' ;
- }
- }
-
- function whatkey(){
- if (ie4||ns6){
- thekey=window.event.keyCode;
-
- if (thekey==13&&iswin){
- fnSubmit();
- }
- }
- }
-
|