<!--Insert Flash Function-->
function insert_flash(file,div,width,height,transparent)
{
	var flashvars = {};
	if(transparent==1)
	{
		var params = {
		  wmode: "transparent",quality: "high"
		};
	}
	else
	{
	var params = {
	  quality: "high"
	  };
	}
	var attributes = {};
 
	swfobject.embedSWF(""+file+"", ""+div+"", ""+width+"", ""+height+"", "9.0.0","flash/expressInstall.swf", flashvars, params, attributes);
}

$(document).ready(function(){



		
	/* LINKS ON THE RIGHT SIDE */
	$(".right-divison-nohover").click(function(event) {
	  event.preventDefault();
	  var str = $(this).find("a").attr("href");
	  if(str.length > 0){
	  window.location = $(this).find("a").attr("href");
	  }
	});
	
	/* LINKS ON THE TOP SIDE */
	$(".leftheaderlink").click(function(event) {
	  event.preventDefault();
	  window.location = "/"+$(this).attr("id")+"/";
	});
	
	/* LINKS ON THE TOP SIDE */
	$(".rightheaderlink2").click(function(event) {
	  event.preventDefault();
	  window.location = "/"+$(this).attr("id")+"/";
	});
	
	/* LINKS ON THE TOP SIDE */
	$(".rightheaderlink2").mouseover(function(){
	  $("#left-side2").css("background","url('/design/personal/header_middle_division.jpg')");
	});
	
	/* LINKS ON THE TOP SIDE */
	$(".rightheaderlink2").mouseout(function(){
	  $("#left-side2").css("background","url('/design/personal/header_middle_division2.jpg')");
	});
	
	$(function() {
		$("#engflag")
			.mouseout(function() { 
				
				$(this).attr("src","/images/languages/eng/bw_eng.png");
			})
			.mouseover(function() {
				
				$(this).attr("src", "/images/languages/eng/eng.png");
			});
	});
	
	
	$(function() {
		$("#ptflag")
			.mouseout(function() { 
				
				$(this).attr("src", "/images/languages/pt/bw_pt.png");
			})
			.mouseover(function() {
				
				$(this).attr("src", "/images/languages/pt/pt.png");
			});
	});
	
		
		

}); 
 
 $(document).ready(function(){
	//called when key is pressed in textbox
	$("#member2").keypress(function (e)  
	{ 
	  //if the letter is not digit then display error and don't type anything
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
	  {
		
		return false;
	  }	
	});
	//called when key is pressed in textbox
	$("#member").keypress(function (e)  
	{ 
	  //if the letter is not digit then display error and don't type anything
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
	  {
		
		return false;
	  }	
	});
	
	//called when key is pressed in textbox
	$("#nif_number").keypress(function (e)  
	{ 
	  //if the letter is not digit then display error and don't type anything
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
	  {
		
		return false;
	  }	
	});
	
	
	//called when key is pressed in textbox
	$("#telefone_res").keypress(function (e)  
	{ 
	  //if the letter is not digit then display error and don't type anything
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
	  {
		
		return false;
	  }	
	});
	
	//called when key is pressed in textbox
	$("#telemovel").keypress(function (e)  
	{ 
	  //if the letter is not digit then display error and don't type anything
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
	  {
		
		return false;
	  }	
	});
	
	//called when key is pressed in textbox
	$("#telefone_tra").keypress(function (e)  
	{ 
	  //if the letter is not digit then display error and don't type anything
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
	  {
		
		return false;
	  }	
	});
	
	//called when key is pressed in textbox
	$("#fax_tra").keypress(function (e)  
	{ 
	  //if the letter is not digit then display error and don't type anything
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
	  {
		
		return false;
	  }	
	});
	
	
	//called when key is pressed in textbox
	$("#cheque_number").keypress(function (e)  
	{ 
	  //if the letter is not digit then display error and don't type anything
	  if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))
	  {
		
		return false;
	  }	
	});
	
	
	
	
				
}); 

/*
//MENU ACCORDION LEFT
ddaccordion.init({ //top level headers initialization
	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
	contentclass: "categoryitems", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})

//END MENU ACCORDION LEFT*/


