var sLB = "\n\n"; var iS1 = 0; var iS2 = 0; var iS3 = 0; var iS4 = 0; var iS5 = 0; var aSelectedProblems = new Array(); var aSelectedSolutions = new Array(); var iSelectedLimit = 2; function updateFrom() { document.getElementById('sFirstName').value; document.getElementById('sFrom').innerHTML = document.getElementById('sFirstName').value + ' ' + document.getElementById('sLastName').value } function hideSteps() { /* document.getElementById('Step1').style.display = 'none'; document.getElementById('Step2').style.display = 'none'; document.getElementById('Step3').style.display = 'none'; document.getElementById('Step4').style.display = 'none';*/ } function checkSupporterInput() { if (document.getElementById('sFirstName').value && document.getElementById('sLastName').value && checkEmail(document.getElementById('sEmail').value) && document.getElementById('sPostCode').value ) { if (iS1 == 0) { hideSteps(); //document.getElementById('Step2').style.display = 'block'; iS1 = 1; } } } function checkSubject() { if (document.getElementById('sSubject').value ) { if (iS2 == 0) { hideSteps(); //document.getElementById('Step3').style.display = 'block'; iS2 = 1; } } } function insertProblem( iP ) { var sP = new Array(); sP[1] = "What particularly concerns me is the impact of illegal logging on climate change given global deforestation is responsible for approximately 20% of global greenhouse gas emissions. "; sP[2] = "The Asia-Pacific region is said to have the highest annual deforestation rate in the world, with two of our closest neighbours, Indonesia and Papua New Guinea, suffering rampant and illegal logging."; sP[3] = "I am also very concerned for indigenous forest communities who are suffering loss of livelihood, as well as increased poverty and disease, at the hands of illegal logging companies."; sP[4] = "Worryingly, there are also documented cases of human rights abuses against the landowners, poor working conditions and no benefits returning to the local communities."; sP[5] = "As you know, illegal logging also threatens many species of plants and animals, and is a major cause of biodiversity loss."; sP[6] = "I am frustrated that I cannot buy imported furniture and be confident that it is made of 'Good Wood'. Since the Government has imposed no restrictions on importation of these sorts of products and nearly a quarter of all imported timber furniture is made from illegally logged forests, this means I have a one in four chance of supporting illegal logging."; sP[7] = "As you are no doubt aware, about $400 million worth of illegal timber imports are sold in Australia every year. This means that I would have a one in ten chance of inadvertently supporting illegal logging by buying timber products."; if ( aSelectedProblems.length < iSelectedLimit) { document.getElementById('sLetter').value = document.getElementById('sLetter').value + sLB + sP[iP]; if (iS3 == 0) { hideSteps(); //document.getElementById('Step4').style.display = 'block'; iS3 = 1; } aSelectedProblems.push( iP ); scrollTextArea(); }else{ alert("You already chosen two problems"); } } function insertSolution( iS ) { var sS = new Array(); sS[1] = "It goes without saying that illegal timber imports be banned. But, along with this, producer countries should practice ecologically sustainable and socially just forestry. Verification systems such as the FSC allow for this."; sS[2] = "In addition to strong, new legislation, our Pacific and south-east Asian neighbours will need to stamp out illegal logging in their own countries. Strong legislation will encourage neighbouring governments to take action"; sS[3] = "The only way I can rest assured that my new furniture didn't destroy someone else's home is by knowing that illegal timber imports have been banned."; sS[4] = "Banning of illegal timber imports will also prevent cheap timber entering the Australian market and undercutting local Australian producers who are doing the right thing."; if ( aSelectedSolutions.length < iSelectedLimit) { document.getElementById('sLetter').value = document.getElementById('sLetter').value + sLB + sS[iS]; if (iS4 == 0) { hideSteps(); iS4 = 1; } aSelectedSolutions.push( iS ); scrollTextArea(); }else{ alert("You already chosen two solutions"); } } function scrollTextArea() { document.getElementById('sLetter').scrollTop = document.getElementById('sLetter').scrollHeight - document.getElementById('sLetter').clientHeight; var d=document, ta, rng; var ta_id = 'sLetter'; if(d.all){ ta=d.all[ta_id]; if(ta && ta.createTextRange){ rng=ta.createTextRange(); rng.collapse(false); rng.select(); } } } function checkEmail(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ //alert("Invalid E-mail ID") return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ //alert("Invalid E-mail ID") return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ //alert("Invalid E-mail ID") return false } if (str.indexOf(at,(lat+1))!=-1){ //alert("Invalid E-mail ID") return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ //alert("Invalid E-mail ID") return false } if (str.indexOf(dot,(lat+2))==-1){ //alert("Invalid E-mail ID") return false } if (str.indexOf(" ")!=-1){ //alert("Invalid E-mail ID") return false } return true } function checkValue(sID) { var iOK = 1; if (sID == 'sFirstName') { if (!document.getElementById(sID).value) { iOK = 0; } } if (sID == 'sLastName') { if (!document.getElementById(sID).value) { iOK = 0; } } if (sID == 'sEmail') { if (!checkEmail(document.getElementById(sID).value)) { iOK = 0; } } if (sID == 'sPostCode') { if (!document.getElementById(sID).value) { iOK = 0; } } if (sID == 'sSubject') { if (!document.getElementById(sID).value) { iOK = 0; } } if (iOK == 1) { document.getElementById(sID).className = ""; }else{ document.getElementById(sID).className = "border_red"; } } function ResetLetter() { aSelectedProblems = new Array(); aSelectedSolutions = new Array(); iSelectedLimit = 2; } /* */