
// NEBULA.JS
// version 2008-05-31
// © Jérémie "Sky" Fontana
// www.skynebula.com





// Pop-up site

function popsite(url) {
	l=screen.availWidth;
	h=screen.availHeight;
	largeur=Math.round((screen.availWidth-l)/2);
	hauteur=Math.round((screen.availHeight-h)/2);
	window.open(""+url+"","","toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,menubar=0,top="+hauteur+",left="+largeur+",width="+l+",height="+h);
}




// Flash

function flash(nom, width, height, flashvar) {
	var NomF= nom;
	var WidthF = width;
	var HeightF = height;
	var FlashVarF = flashvar;
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ WidthF +'" height="'+ HeightF +'" id="'+ NomF +'">\n');
	document.write('<param name=movie value="'+ NomF +'" />\n');
	document.write('<param name=quality value=high />\n');
	document.write('<param name="width" value="'+ WidthF +'" />\n');
	document.write('<param name="height" value="'+ HeightF +'" />\n');
	document.write('<param name="FlashVars" value="'+ FlashVarF +'" />\n');
	document.write('<embed src="'+ NomF +'?'+ FlashVarF +'" FlashVars="'+ FlashVarF +'" quality="high" width="'+ WidthF +'" height="'+ HeightF +'" name="'+ NomF +'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" ></embed>\n');
	document.write('</object>\n');
	}

function flash2(nom, width, height, flashvar) {
	var NomF= nom;
	var WidthF = width;
	var HeightF = height;
	var FlashVarF = flashvar;
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ WidthF +'" height="'+ HeightF +'" id="'+ NomF +'">\n');
	document.write('<param name="movie" value="'+ NomF +'" />\n');
	document.write('<param name="quality" value=high />\n');
	document.write('<param name="width" value="'+ WidthF +'" />\n');
	document.write('<param name="height" value="'+ HeightF +'" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<param name="FlashVars" value="'+ FlashVarF +'" />\n');
	document.write('<embed src="'+ NomF +'?'+ FlashVarF +'" FlashVars="'+ FlashVarF +'" quality="high" width="'+ WidthF +'" height="'+ HeightF +'" name="'+ NomF +'" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" ></embed>\n');
	document.write('</object>\n');
	}




// Validation du formulaire

function MM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() {
	var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
	for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	if (val) { nm=val.name; if ((val=val.value)!="") {
	if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
	if (p<1 || p==(val.length-1)) errors+='- le champ E-mail doit contenir une adresse e-mail valide.\n\n';
	} else if (test!='R') { num = parseFloat(val);
	if (isNaN(val)) errors+='- le champ '+nm+' doit être un numéro.\n\n';
	if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
	min=test.substring(8,p); max=test.substring(p+1);
	if (num<min || max<num) errors+='- le champ '+nm+' doit contenir un numéro entre '+min+' et '+max+'.\n\n';
	} } } else if (test.charAt(0) == 'R') errors += '- le champ '+nm+' doit être rempli.\n\n'; }
	} if (errors) alert('Erreur :\n\n'+errors);
	document.MM_returnValue = (errors == '');
}




// Validation de l'antispam

var CTK_ANTISPAM_CONF = {urlPCheckName:'ctkas', urlPCheckdefaultValue:'oki', ctrlErrorMessage:"Attention!\nLe code de sécurité que vous avez entré dans la zone anti-spam n'est pas correcte...\nMerci de rectifier votre formulaire."};
	if( (location.search).indexOf('?') != -1 ) {
		var query = location.search.substring(1,location.search.length) + "&check=1";
		var params=[];
		params = query.split('&');
		for(p=0;p<params.length;p++) {
			pName = params[p].substring(0, params[p].indexOf("="));
			pValue = params[p].substring(params[p].indexOf("=")+1, params[p].length);
			if ( pName == CTK_ANTISPAM_CONF.urlPCheckName ) { 
				if (pValue!=CTK_ANTISPAM_CONF.urlPCheckdefaultValue) {
					alert(CTK_ANTISPAM_CONF.ctrlErrorMessage);
				}
			}
		}
	}




// Protection

function anticlic() {
	alert('(C) RAPHAELSUSITNA.COM');
	return(false);
}
document.oncontextmenu = anticlic;

function anticapture() {
	var content=window.clipboardData.getData("Text");
	if (content==null) {
		window.clipboardData.clearData();
	}
	setTimeout("anticapture();",1000);
}
