	function voucher_r() {
		var theform = document.getElementById('paypalform');
		var newos1 = '';
		var m = 0;
		var checked_o = 0;
		for(i=0; i<theform.elements.length; i++) {
			if(theform.elements[i].type == 'checkbox' && theform.elements[i].checked == true) {
				checked_o++;
				newos1 += (m != 0 ? ', ' : '') + (theform.elements[i].name.substring(0,7) == 'product' ? theform.elements[i].name.match(/\d+/) : theform.elements[i].name);
				m++;
			}
		}
		location.href = 'http://www.seocompany.ca/directory/web-directory-submission-service-poole.html?h=1&fullname='+theform.fullname.value+'&email='+theform.email.value+'&url='+theform.url.value+'&phone='+theform.phone.value+'&vr='+theform.voucher.value+'&prods='+newos1;
	}
	
	function isInteger(s)
	{  
	    var i;
	    for (i = 0; i < s.length; i++)
	    {   
	        // Check that current character is number.
	        var c = s.charAt(i);
	        if (((c < "0") || (c > "9")) && (c != '-')) return false;
	    }
	    // All characters are numbers.
	   return true;
	}
	
	function paypalsub1(iTotal) {
		var theform = document.getElementById('paypalform');
		var newos1 = '';
		var newos1Temp = '';
		var m = 0;
		var checked_o = 0;
		
		
		for(k=1;k<=iTotal;k++)
		{
			id= 'sPackageNo' + k;
		    iCurPackageVal = eval(document.getElementById(id)).value;
			var oChk = eval('document.getElementById(\'paypalform\').product'+iCurPackageVal);
			if(oChk.checked)
			{
				checked_o++;
				newos1 += (m != 0 ? ',' : '') + iCurPackageVal;
				newos1Temp += (m != 0 ? ',#' : '#') + iCurPackageVal;
				m++;
		    }
	    }
		// Calculating maximum NUM LINKS
	    var iNumMax = theform.num_links_list.value;
	    theform.num_links.value = iNumMax;
		var error_c = 0;
		var sEmail     = theform.email.value;
  		var iMailLenth = sEmail.length;
		var bMail      = false;
	    for(i = 0; i <= iMailLenth; i++)
	    {
		    if(sEmail.charAt(i)=='@')
		    {
	  	    	bMail = true;
	     	}
	    }
		var error_c = 0;
		if (checked_o == 0 && iTotal != 0) 
		{
			alert('You currently have not selected any product');
			error_c = 1;
		} 
		else if (theform.fullname.value == '') 
		{
			alert('Please enter your full name');
			theform.fullname.focus();
			error_c = 1;
		} 
		else if (theform.phone.value == '') 
		{
			alert('Please enter your phone number');
			theform.phone.focus();
			error_c = 1;			
		}
		else if (!(isInteger(theform.phone.value))) 
		{
			alert('The field phone number can contain only numbers.');
			theform.phone.focus();
			error_c = 1;			
		} 
		else if (theform.url.value == '') 
		{
			alert('Please enter your URL');
			theform.url.focus();
			error_c = 1;
		} 
		else if ( (theform.url.value != '') && theform['url'].value.substring(0,7) != 'http://') 
		{
			alert('URL requires the http:// prefix e.g. http://www.domain.com or http://subdomain.domain.com');
			theform.url.focus();
	        error_c = 1;
	    }
		
		else if (theform.email.value == '') 
		{
			alert('Please enter your email address.');
			theform.email.focus();
			error_c = 1;
		} 
		else if(!bMail)
	    {	   
	   		alert("The email address field value is not in proper format.");
	   		theform.email.focus();
	   		error_c = 1;
	    }
	    else if(theform.txtSecurityCode.value == '')
	    {
		    alert('Please enter security code.');
			theform.txtSecurityCode.focus();
			error_c = 1;
	    }
	    else 
	    {
			error_c = 0;
		}
		
		if (document.getElementById('discount')) {
			var optional_var = theform.voucher.value + "|" + document.getElementById('discount').innerHTML;		
		} else {
			var optional_var = 0;
		}
		theform.os0.value = theform.fullname.value + "\n Email: " + theform.email.value + "\n URL: " + theform.url.value + "\n Phone: " + theform.phone.value;
		theform.custom.value = theform.fullname.value + "|" + theform.email.value + "|" + theform.url.value + "|" + theform.phone.value + "qq" + optional_var;
		theform.directories.value = newos1Temp;
		theform.os1.value = newos1;
		//theform.item_name.value = "ILQ Directories -- " + newos1Temp;
		theform.item_name.value = "ILQ Directories";
		if (document.getElementById('total3') && document.getElementById('total3').innerHTML != 0) {
			theform.amount.value = document.getElementById('total3').innerHTML;
		} else {
			theform.amount.value = document.getElementById('total').innerHTML;
		}
		//theform.action = 'https://www.paypal.com/cgi-bin/webscr';
	
		if (error_c == 0) {
			theform.submit();
		}
		
	}

