function openpopup(val)
	{
		window.open("change_image.php?id="+val,'','top=0,left=0,status=no,toolbars=no,scrollbars=no,width=500,height=130,maximize=no,resizable=no');
	}
function show_menu() {
		
}


	$().ready( function() {
						
						
						
	var api = new jGCharts.Api();
	$goal_value	= parseFloat($("#goal_value").val());
	$goal_amt 	= parseFloat($("#goal_amt").val());
    jQuery('<img>')
    .attr('src', api.make({
			  size:'406x128', 
			  data : [[$goal_amt,0,0], [0,$goal_value,0]],//mandatory  
			  axis_labels : [$goal_value],
			  type : 'bhg',
			  bar_width:35,
			  bar_spacing:2,
			  bg:'000000',
			  colors:['06C003','06C003','06C003'],
			  grid_x:12.5, 
			  grid_y:50,
			  grid: true
		  }))
    .appendTo("#stacked1");
	



						
		$("#frmFileUpload").validate({
	
				rules: {
					fileToUpload: "required"
				},
				
				messages: {	
					fileToUpload: "Select a file to upload"
				}
		 });
						
						
						
		$("#pledge4").validate({

				rules: {
					first_name_selected: "required",
					last_name_selected:"required",
					email_selected:{
						required:true,
						email:true
					},
					street_address1_selected:"required",
					city_selected:"required",
					cons_state:"required",
					zip_selected:"required",
					tender_instance_list_ctrl:"required",
					cc_num_selected:"required",
					cvv_num_selected:"required",
					ccexp_month:"required",
					ccexp_year:"required"
				},
				
				messages: {
    				first_name_selected: "Enter the first name",
					last_name_selected: "Enter the last name",
					email_selected:{
						required: "Enter the email id",
						email: "Provide the valid email id"
					},
					street_address1_selected:"Fill the Billing Address 1",
					city_selected:"Enter the city",
					cons_state:"Select the state",
					zip_selected:"Enter the ZIP code",
					tender_instance_list_ctrl:"Select a credit card",
					cc_num_selected:"Fill the Card Number",
					cvv_num_selected:"Fill the Varification Code",
					ccexp_month:"Select the expiry month",
					ccexp_year:"Select the expiry year"
				}
				
			});
			
		$("#pledge3").validate({
			rules: {
				cons_title:"required",
				cons_first_name:"required",
				cons_last_name:"required",
				cons_email:{
					required:true,
					email:true
			       },
				cons_street1:"required",
				cons_state:"required",
				cons_zip_code:"required",
				country_selected:"required",
				cons_phone:{
					required:true,
					digits:true
					},
				cons_user_name:{
					required:true,
					minLength:"5",
					maxLength:"50"
				},
				cons_password:{
						required:true,
						minLength:"5",
						maxLength:"50"
						},
				cons_rep_password:{
					required:true,
					equalTo:"#cons_password"
				}
					   	
			},
			
			messages: {
				cons_title:"Select the Title",	
				cons_first_name:"Enter the first name",
				cons_last_name:"Enter the last name",
				cons_email:{
					required:"Enter the Email Id",
					email:"Enter the valid email"
				},
				cons_street1:"Enter the Street1",
				cons_state:"Select the state",
				cons_zip_code:"Enter ZIP code",
				country_selected:"Select a county",
				cons_phone:{
					required:"Fill the Phone number",
					digits:"Phone number must be in digits"
				},
				cons_user_name:{
					required:"Enter the username",
					minLength: jQuery.format("Enter at least {5} characters."),
					maxLength: jQuery.format("Enter no more than {50} characters.")
					
				},
				cons_password:{
						required:"Enter the password",
						minLength: jQuery.format("Enter at least {5} characters."),
						maxLength: jQuery.format("Enter no more than {50} characters.")
						},
				cons_rep_password:{
					required:"Enter the confirm Password",
					equalTo:"Must match with New Password"
				}
              }
			  
			});
	
	
	
	
	
	

		$.validator.addMethod("wishcheck", function(value) {
			$w_val = $("#wish_other").val();
			if( $("#wish_other_div").css("display") == "block" ) {
				if(jQuery.trim($w_val) == "")	
					return false;
				else
					return true;
			} else {
				return true;	
			}
		
		}, 'Enter your Pledge');
		
		$.validator.addMethod("causecheck", function(value) {
			$w_val = $("#cause_other").val();
			if( $("#cause_other_div").css("display") == "block" ) {
				if(jQuery.trim($w_val) == "")	
					return false;
				else
					return true;
			} else {
				return true;	
			}
		
		}, 'Enter your Cause');
		
		$.validator.addMethod("charitycheck", function(value) {
			$w_val = $("#charity_other").val();
			if( $("#charity_other_div").css("display") == "block" ) {
				if(jQuery.trim($w_val) == "")	
					return false;
				else
					return true;
			} else {
				return true;	
			}
		
		}, 'Enter your Charity');		
				
		$("#pledge2").validate({
							   


				rules:{
					wish:"required",
					cause:"required",
					charity:"required",
					goalamount:"required",
					personalstatement:"required",
					mindonation:"required",
					maxdonation:"required",
					wish_other:"wishcheck",
					cause_other:"causecheck",
					charity_other:"charitycheck"					
					},
				messages:{
					wish:"Select a Pledge",	
					cause:"Select a cause",
					charity:"Select the Charity",
					goalamount:"Select the goal amount",
					personalstatement:"Enter the personal statement",
					mindonation:"Select the minimum donation",
					maxdonation:"Select the maximum donation",
					wish_other:"Enter your Pledge",
					cause_other:"Enter your cause",
					charity_other:"Enter your charity"					
					}	
							   	
		   });
		
		
		$("#edit_billing").validate({

				rules: {
					first_name_selected: "required",
					last_name_selected:"required",
					email_selected:{
						required:true,
						email:true
					},
					street_address1_selected:"required",
					//street_address2_selected:"required",
					city_selected:"required",
					cons_state:"required",
					zip_selected:"required",
					tender_instance_list_ctrl:"required",
					cc_num_selected:"required",
					cvv_num_selected:"required",
					ccexp_month:"required",
					ccexp_year:"required"
				},
				
				messages: {
    				first_name_selected: "Enter the first name",
					last_name_selected: "Enter the last name",
					email_selected:{
						required: "Enter the email id",
						email: "Provide the valid email id"
					},
					street_address1_selected:"Fill the Billing Address 1",
					//street_address2_selected:"Fill the Billing Address 1",
					city_selected:"Enter the city",
					cons_state:"Select the state",
					zip_selected:"Enter the ZIP code",
					tender_instance_list_ctrl:"Select a credit card",
					cc_num_selected:"Fill the Card Number",
					cvv_num_selected:"Fill the Varification Code",
					ccexp_month:"Select the expiry month",
					ccexp_year:"Select the expiry year"
				}
				
			});
		
		
		
		$("#edit_account").validate({
			rules: {
				cons_title:"required",
				cons_first_name:"required",
				cons_last_name:"required",
				//cons_suffix:"required",
				cons_email:{
					required:true,
					email:true
			       },
				cons_street1:"required",
				//cons_street2:"required",
				cons_city:"required",
				cons_state:"required",
				cons_zip_code:"required",
				country_selected:"required",
				cons_phone:{
					required:true,
					digits:true
					},
				cons_user_name:{
					required:true,
					minLength:"5",
					maxLength:"50"
				},
				cons_password:{
						required:true,
						minLength:"5",
						maxLength:"50"
						},
				cons_rep_password:{
					required:true,
					equalTo:"#cons_password"
				}
					   	
			},
			
			messages: {
				cons_title:"Select the Title",	
				cons_first_name:"Enter the first name",
				cons_last_name:"Enter the last name",
				//cons_suffix:"Select",
				cons_email:{
					required:"Enter the Email Id",
					email:"Enter the valid email"
				},
				cons_street1:"Enter the Street1",
				//cons_street2:"Enter the Street2",
				cons_city:"Enter the City",
				cons_state:"Select the state",
				cons_zip_code:"Enter ZIP code",
				country_selected:"Select a county",
				cons_phone:{
					required:"Fill the Phone number",
					digits:"Phone number must be in digits"
				},
				cons_user_name:{
					required:"Enter the username",
					minLength: jQuery.format("Enter at leasr {5} characters."),
					maxLength: jQuery.format("Enter no more than {50} characters.")
					
				},
				cons_password:{
						required:"Enter the password",
						minLength: jQuery.format("Enter at leasr {5} characters."),
						maxLength: jQuery.format("Enter no more than {50} characters.")
						},
				cons_rep_password:{
					required:"Enter the confirm Password",
					equalTo:"Must match with New Password"
				}
              }
			  
			});
		
		
		
		$("#edit_pledge").validate({
							   


				rules:{
					wish:"required",
					cause:"required",
					charity:"required",
					goalamount:"required",
					mindonation:"required"
					
					},
				messages:{
					wish:"Select a Pledge",	
					cause:"Select a cause",
					charity:"Select the Charity",
					goalamount:"Select the goal amount",
					mindonation:"Select the minimum donation"
									
					}	
							   	
		   });
		
		
		
		
		$("#donation").validate({
			
				rules: {
					name:"required",
					//business_name:"required",
					email_selected:{
						required:true,
						email:true
					},
					cons_title:"required",
					donate:"required",
					//charity:"optional",
					//c_event:"optional",
					//package:"optional",
					mindonation:"required",
					address:"required",
					city:"required",
					cons_state:"required",
					country_selected:"required",
					zip:"required",
					sponsor:"required",
					phone:{
					required:true,
					digits:true
					},
					phone1:{
					//required:true,
					digits:true
					},
					fax:{
					//required:true,
					digits:true
					},
					card_name:"required",
					card_no:"required",
					card_code:"required",
					ccExp_MONTH:"required",
					ccExp_YEAR:"required"
				},
				
				messages: {
					cons_title:"Select the Title",	
    				name: "Enter the first name",
					//business_name: "Enter the business name",
					email_selected:{
						required: "Enter the email id",
						email: "Provide the valid email id"
					},
					mindonation : "Select a donation",
					donate:"Select a donation",	
    				address:"Fill the Address",
					city:"Enter the city",
					cons_state:"Select the state",
					country_selected:"Select the country",
					zip:"Enter the ZIP code",
					sponsor:"Enter the sponsar name",
					phone:{
					     required:"Fill the Phone number",
					     digits:"Phone number must be in digits"
				    },
					phone1:{
							//required:"Fill the Phone number",
							digits:"Phone number must be in digits"
				   },
				    fax:{
					    // required:"Fill the fax number",
					     digits:"Fax number must be in digits"
				    },
					card_name:"Enter the card name",
					card_no:"Enter the card no",
					card_code:"Enter the card code",
					ccExp_MONTH:"Select the expiry month",
					ccExp_YEAR:"Select the expiry year"
				}
				
			});
		
		
		
		
		
		$("#makepledge").validate({
				rules:{
					iama:"required"
					},
				messages:{
					iama:"Make a Selection"
					}	
								
				});
		
		$("#testimonial").validate({
				rules:{
					t_contributor:"required",
					t_message:"required"
					},
				messages:{
					t_contributor:"Enter your name",
					t_message:"Enter your comment/message"
					}	
								
				});
		
		
				
		$("#frmPromote").validate({
				rules:{
					r_name:"required",
					r_email:"required"
					},
				messages:{
					r_name:"Please enter receipient name",
					r_email:"Enter the Email Id"
				}
								
				});
			
		});
		

