// JavaScript Document
	  $(function() {
		$("#opt2CO").attr("checked", true);
	  });

function validate(fromPaypal) {
	with(fromPaypal) {
		if(item_name.value == "") {
			$.prompt('<h3>Paypal!</h3><br/>Please enter your Comment.');
			item_name.focus();
			return false;
		} else if(amount.value == "") {
			$.prompt('<h3>Paypal!</h3><br/>Amount can not be blank.');
			amount.focus();
			return false;
		} else if( isNaN(amount.value) ) {
			$.prompt('<h3>Paypal!</h3><br/>Please enter Numeric value.');
			amount.value = "";
			amount.focus();
			return false;
		} else {
			var pr = document.getElementById('dvProcess');
			pr.style.display="";
			//var pi = document.getElementById('process_img');
			//pi.style.display = "";
			//document.formPaypal.submit();
		}
	}
	return true;
}

function elementPaypal() {
/*	radiobtn=document.getElementById("optpaypal");
	radiobtn.checked = true;*/
	
	var objdiv1 =document.getElementById("paypal");
	objdiv1.style.display = "";
	var objdiv2 =document.getElementById("twoco");
	objdiv2.style.display = "none";
}

function element2CO() {
/*	radiobtn=document.getElementById("opt2CO");
	radiobtn.checked = true;*/

	var objdiv1 =document.getElementById("paypal");
	objdiv1.style.display = "none";
	var objdiv2 =document.getElementById("twoco");
	objdiv2.style.display = "";
}

function validate2CO(formCO) {

	if(formCO.txtComment.value=="") {
		$.prompt('<h3>Credit Card!</h3><br/>Please enter your comment.');
		formCO.txtComment.focus();
		return false;
	} else if(formCO.txtAmount.value=="") {
		$.prompt("<h3>Credit Card!</h3><br/>Please enter amount.");
		formCO.txtAmount.focus();
		return false;
	} else if(isNaN(formCO.txtAmount.value)) {
		$.prompt("<h3>Credit Card!</h3><br/>Please enter Numeric value.");
		formCO.txtAmount.value = "";
		formCO.txtAmount.focus();
		return false;
	} else {
			var pr = document.getElementById('dvProcess');
			pr.style.display="";
			//var pi = document.getElementById('process_img');
			//pi.style.display = "";
			/*
			var currentTime = new Date()
			var d = currentTime.getDate();
			var m = currentTime.getMonth() + 1; 
			var y = currentTime.getFullYear();
			var orderId = formCO.txtComment.value + '/' + y + '/' + m + '/' + d;
			var url = 'https://www.2checkout.com/2co/buyer/purchase?sid=1205289&total=' + formCO.txtAmount.value + '&cart_order_id=' + orderId + '&c_prod=1&id_type=1';
			window.location.href = url;
			*/
			//document.formCO.submit();
	}
}