document.writeln('<script language="javascript">')
document.writeln('function calctotal()')
document.writeln('{')
document.writeln('var total = 100 - (parseFloat(document.split.v_OtherTP.value) + parseFloat(document.split.v_LabTP.value) + parseFloat(document.split.v_ConTP.value) + parseFloat(document.split.v_LibTP.value) + parseFloat(document.split.v_SNPTP.value) + parseFloat(document.split.v_PCTP.value));')
document.writeln('document.split.v_Total.value = Math.round(total*Math.pow(10,1))/Math.pow(10,1);')
document.writeln('}')
document.writeln('function checktotal()')
document.writeln('{')
document.writeln('if (document.split.v_Total.value > 0) {')
document.writeln('alert("You need to allocate a further " + document.split.v_Total.value + "% before proceeding.")')
document.writeln('return false;')
document.writeln('}')
document.writeln('if (document.split.v_Total.value < 0) {')
document.writeln('diff = parseFloat(document.split.v_Total.value) + parseFloat(document.split.v_Total.value)')
document.writeln('alert("You need to reduce your allocations before proceeding.")')
document.writeln('return false;')
document.writeln('}')
document.writeln('if (document.split.v_Total.value == 0) {')
document.writeln('if (document.all)')
document.writeln('var xMax = screen.width, yMax = screen.height;')
document.writeln('else')
document.writeln('if (document.layers)')
document.writeln('var xMax = window.outerWidth, yMax = window.outerHeight;')
document.writeln('else')
document.writeln('var xMax = 640, yMax = 480;')
document.writeln('var xOffset = (xMax - 800)/2, yOffset = (yMax - 600)/2;')
document.writeln("window.open('swinger_affiliate.asp?v_LabTP='+document.split.v_LabTP.value+'&v_ConTP='+document.split.v_ConTP.value+'&v_LibTP='+document.split.v_LibTP.value+'&v_SNPTP='+document.split.v_SNPTP.value+'&v_PCTP='+document.split.v_PCTP.value+'&v_OtherTP='+document.split.v_OtherTP.value+'','swing','height=600,width=800,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');")
document.writeln('}')
document.writeln('}')
document.writeln('</script>')
document.writeln('<table border="0" cellpadding="3" cellspacing="0" width="150" style="border-style: groove; border-width: 2" bgcolor="#CEC89E">')
document.writeln('<tr><td width="100%" align="center"><img border="0" src="http://www.netcoms.com/election/logos/hklogosmall.gif"></td></tr>')
document.writeln('<tr><td width="100%" align="center">&nbsp;&nbsp;<img border="0" src="http://www.netcoms.com/election/newlogo.gif">&nbsp;</td></tr><td>')
document.writeln('<form name="split" onsubmit="return checktotal()">')
document.writeln('<tr><td width="100%" align="right"><div align="right"><table border="0" cellpadding="0" cellspacing="0" width="100%">')
document.writeln('<tr><td><font face="Trebuchet MS" size="2">Labour (%):</font></td>')
document.writeln('<td align="right"><input type="text" name="v_LabTP" size="3" onblur="calctotal()" tabindex="1" value="43.4"></td></tr>')
document.writeln('<tr><td><font face="Trebuchet MS" size="2">Conservative (%):&nbsp;</font></td>')
document.writeln('<td align="right"><input type="text" onblur="calctotal()" name="v_ConTP" size="3" tabindex="2" value="30.8"></td></tr>')
document.writeln('<tr><td><font face="Trebuchet MS" size="2">Lib Dem (%):</font></td>')
document.writeln('<td align="right"><input type="text" onblur="calctotal()" name="v_LibTP" size="3" tabindex="3" value="16.8"></td></tr>')
document.writeln('<tr><td><font face="Trebuchet MS" size="2">SNP (%):</font></td>')
document.writeln('<td align="right"><input type="text" onblur="calctotal()" name="v_SNPTP" size="3" tabindex="4" value="2.0"></td></tr>')
document.writeln('<tr><td><font face="Trebuchet MS" size="2">Plaid Cymru (%):</font></td>')
document.writeln('<td align="right"><input type="text" onblur="calctotal()" name="v_PCTP" size="3" tabindex="5" value="0.2"></td></tr>')
document.writeln('<tr><td><font face="Trebuchet MS" size="2">Others (%):</font></td>')
document.writeln('<td align="right"><input type="text" onblur="calctotal()" name="v_OtherTP" size="3" tabindex="6" value="6.8"></td></tr>')
document.writeln('<tr><td><font face="Trebuchet MS" size="2">Unallocated (%):</font></td>')
document.writeln('<td align="right"><input type="text" onblur="calctotal()" name="v_Total" size="3" style="background-color: #CEC89E; border: 1 solid #CEC89E"></td></tr>')
document.writeln('<tr><td colspan="2" align="center">')
document.writeln('<p align="center"><image src="http://www.netcoms.com/election/vote.gif" onClick="return checktotal()" vspace="3" tabindex="7" alt="Vote" border="0"></p>')
document.writeln('</td></tr></table></div></td></tr></form></table>')
document.writeln('<script language="javascript">')
document.writeln('document.split.v_Total.value=0')
document.writeln('document.split.v_LabTP.focus()')
document.writeln('</script>')
