// JavaScript Document
// http://malsup.com/jquery/block/#demos

$(document).ready(function(){
		
		//$('#pane').jScrollPane({showArrows:true, scrollbarWidth: 17});

		
		// initialize scrollable  images
		
		/*
		$("div.scrollable").scrollable(
			{ 
 
				// one configuration property 
				size: 1
			 
			}					   
		); 
		*/
		
		
		
		
		
		
		//-------------------------------------------------------------
		/*
		$("#newlink").click( function() {					 
			$.blockUI({
				message: $('#saveform'),
				css: { border: '1px solid #cccccc',background: '#000000', padding: '10px', top: '10%' } 
			}); 
			
			return false;
		});
		*/
		
		//-------------------------------------------------------------
		
		$("#unsublink").click( function() {				
			
			
			//thankyou_registration.jpg
			
			if( $("#unsub").valid() ){					
				
			$.blockUI({
				message: $('<img src="enews_img/unsubscribe_msg.jpg" />')
				,css: {top: '10%', textAlign:'center', border: '0px',width:'305px', background: '#000000' }
				//,css: { border: '1px solid #cccccc', background: '#000000', padding: '10px', top: '10%',height:'500px'  }
			}); 
			
			//$("#centerButtons").css({'z-index' : '0'});
	

				$('#unsub').ajaxSubmit(
					  { 
						//relative to the php path, not the js path!
						url: "php_email/unreg.php",
						type: "post",
						resetForm: true,
						beforeSubmit: function(){
							//alert('before');
						},
						success: function(statusText, responseText, responseXML){
														
							setTimeout($.unblockUI, 2000); 
							 
								//var catid = $("#catid").val();
								//var varUrl = "catid="+catid;
							
							//window.location.replace("pro_links.php?"+varUrl);

							//alert("hej");
						}			   
										   
										   
					}			   
				 ); //ajax end
				
				
			
			
			} //If end
			
			
			
			
			
			
			
			return false;
		});
		
		//SAVING END	
		//--------------------------------------------------------------
		
		$("#telllink").click( function() {				
			
			alert("tell");
			
			if( $("#tellafriend").valid() ){					
				
				$.blockUI({
					message: $('#tellafriendmsg'),
					css: { border: '1px solid #cccccc',background: '#000000', padding: '10px', top: '10%',height:'500px'  }
				}); 
				
		
		
				$('#tellafriend').ajaxSubmit(
					 { 
							//relative to the php path, not the js path!
							url: "php_email/tipsamail.php",
							type: "post",
							resetForm: true,
							beforeSubmit: function(){
								//alert('before');
							},
							success: function(statusText, responseText, responseXML){
															
								 $.unblockUI();
								 
									//var catid = $("#catid").val();
									//var varUrl = "catid="+catid;
								
								//window.location.replace("pro_links.php?"+varUrl);
		
								//alert("hej");
							}			   
											   
											   
						}			   
					 ); //ajax end
			
			
		
		
		} //If end
			
			
			
			return false;
		});
		//_-------------------------------------------------------------
		
		
		
		
			
				
			
	
	
		$("#save").validate({	
				rules: {
				  signup_name: "required",
				  signup_email: "required email"
				 
			   },	   
			   messages: {
					signup_name: "*Name is required",
					signup_email: "*E-mail is required"
					
				},
		
			errorLabelContainer: "#fel",
  		 	wrapper: "span"
		 
		});	
	
	
		$("#tellafriend").validate({	
				rules: {
				  tell_name: "required",
				  tell_friend: "required ",
				  tell_email: "required email"
				 
			   },	   
			   messages: {
					tell_name: "*Name is required",
				  	tell_friend: "*Friends name is required",
				  	tell_email: "*Friends e-mail is required"
					
				},
		
			errorLabelContainer: "#tellafrienderror",
  		 	wrapper: "span"
		 
		});	
	
// END TAG
});




