/*----------------------------------------------------------------------- 
This files contains commun javascript function that are used in all pages
-------------------------------------------------------------------------*/

/*----------------------------------------------------------------------- 
This function go to previous page
	* products page if we are inside main page
	* tutorial page if we are in tutorial
-------------------------------------------------------------------------*/
function back_tut(p_lang)
{
	location.href="p_tutorial.aspx?lang=" + p_lang;
}

function back_to(p_lang)
{
		document.location.href="corporate2.aspx?lang=" + p_lang;
}

/*----------------------------------------------------------------------- 
This function crypt mailto for User side 
-------------------------------------------------------------------------*/
function cryptMailto(p_user,p_domaine){
	var a, s, n;
	a ="pdlowr=";
	m='&#64;';
	d=unescape(m);
	var aro = p_user + d + p_domaine;
	document.write('<a href='+ Crypt(a) + aro + ' style=COLOR:black>');
	document.write('<u>' + aro + '</u></a>');
}

function Crypt(s) {
	r='';
	for(i=0;i<s.length;i++){
		n=s.charCodeAt(i); 
		if (n>=8364) {
			n = 128;
		} 
		r += String.fromCharCode( n - 3 );
	}
	return r;
}

//--Link from picture to product download page
function pub(p_lang)
{
	var dest;
	dest = "page_download.aspx?lang="+ p_lang;
	//--Promotion uniquement pour la france
	if (p_lang=="fr"){
		dest = dest + "&wIPpromocode=NETFR";
	}	
	parent.document.frames["ifrmain"].location.href=dest;
}

function  getSubmitForm(doc,theaction)
{
  doc.open();
  doc.write("<html>");
  doc.write("<head>");
  doc.write("<meta http-equiv='Content-Type' content='text/html; charset=windows-1255'>");
  doc.write("</head>");
  doc.write("<body>");
  doc.write("<FORM method='post' ACTION=" + theaction + ">");
  doc.write("<input type='text' name='txtType' style='display:none'>");
  doc.write("<input type='text'  name='txtName' style='display:none'>");    
  doc.write("<input type='text'  name='txtResult' style='display:none'>"); 
  doc.write("</form>");
  doc.write("</body>");
  doc.write("</html>");
  doc.close();

}
//----------------------------------------------------------------------------------
//Disable right mouse click Script
//----------------------------------------------------------------------------------
function clickIE4(){

	if (event.button==2){
	return false;
	}

}
function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			return false;
		}
	}
}
 
if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}
 
document.oncontextmenu=new Function("return false")
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
//--Call on mouseover, this function hide all menu on default.aspx page
//----------------------------------------------------------------------------------
