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] = "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."; sP[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."; sP[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."; sP[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 ( 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 should go 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 and the government can do more to support them within the laws."; sS[2] = "The government needs to back up strong laws with a proper enforcement system and not leave this responsibility to industry."; sS[3] = "The government should be taking a leadership role in moving towards sustainable timber by adopting and implementing procurement policies that go beyond one requiring legal verification. Such procurement policies should be built on criteria that are consistent with and supportive of forest management and chain-of-custody certification and social justice."; sS[4] = "The laws should include a provision allowing any interested party to take action against a breach under the Act so that any citizen can make a complaint and take action against traders who deal in illegal timber. "; 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; } /*
*/