/*    function link_to_post(pid,tid)
    {
    	temp = prompt( "Copiez manuellement le lien direct vers ce message ci-dessous pour stocker le lien dans le presse-papier", "http://www.gamuz.com/communaute/index.php?showtopic="+tid+"&view=findpost&p=" + pid );
    	return false;
    }*/
    
function delete_post(theURL) {
       if (confirm('Etes-vous certain de vouloir effacer ce message ?')) {
          window.location.href=theURL;
       }
       else {
          alert ('Ok, aucune action exécutée');
       } 
    }
    
function delete_post_impertinence(theURL) {
       if (confirm('Supprimer le message et le marquer en NON-PERTINENT ?')) {
          window.location.href=theURL;
       }
       else {
          alert ('Ok, aucune action exécutée');
       } 
    }
function submitAjaxForm(f){
var params = Form.serialize(f);

var pid=Form.Element.getValue(f['p']);
$('post_'+pid).innerHTML="loading";
new Ajax.Request('index.php', {method: 'post',parameters:params+'&CODE=900', onLoading:function(){$('post_'+pid).innerHTML="<img src='/ajaxtabs/loading.gif'/> Chargement...";}, onComplete: function(transport){$('post_'+pid).innerHTML =transport.responseText;}});
return false;
}
function quick_edit(fid,tid,pid,st){
loadobjs("html/ibfcode.js");
loadobjs("jscripts/ipb_post.js");
new Ajax.Request('index.php?act=Post&CODE=800&f='+fid+'&t='+tid+'&p='+pid+'&st='+st, {method: 'post', onLoading:function(){$('post_'+pid).innerHTML="<img src='/ajaxtabs/loading.gif'/>";},onComplete: function(transport){$('post_'+pid).innerHTML =transport.responseText; }});
}

function do_edit(){
var params = Form.serialize($('REPLIER'));
new Ajax.Updater('contentWrapper', 'ajax/inscription.php', {onComplete:function(){ new Effect.Highlight('contentWrapper');},asynchronous:true,parameters:params});

}
   
    function PopUp(url, name, width,height,center,resize,scroll,posleft,postop) {
    if (posleft != 0) { x = posleft }
    if (postop  != 0) { y = postop  }
    if (!scroll) { scroll = 1 }
    if (!resize) { resize = 1 }
    if ((parseInt (navigator.appVersion) >= 4 ) && (center)) {
      X = (screen.width  - width ) / 2;
      Y = (screen.height - height) / 2;
    }
    if (scroll != 0) { scroll = 1 }
    var Win = window.open( url, name, 'width='+width+',height='+height+',top='+Y+',left='+X+',resizable='+resize+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no');
	}
	
	function ShowHide(id1, id2) {
	  if (id1 != '') expMenu(id1);
	  if (id2 != '') expMenu(id2);
	}
	
	function expMenu(id) {
	  var itm = null;
	  if (document.getElementById) {
		itm = document.getElementById(id);
	  } else if (document.all){
		itm = document.all[id];
	  } else if (document.layers){
		itm = document.layers[id];
	  }
	
	  if (!itm) {
	   // do nothing
	  }
	  else if (itm.style) {
		if (itm.style.display == "none") { itm.style.display = ""; }
		else { itm.style.display = "none"; }
	  }
	  else { itm.visibility = "show"; }
	}
	
function build_deleteButton(fid,tid,pid,st,key,img_item){
build_atmenu( "delete-but-"+pid+"",
"<a href=\"javascript:delete_post('index.php?act=Mod&CODE=04&f="+fid+"&t="+tid+"&p="+pid+"&st="+st+"&auth_key="+key+"');\" title='Supprimer sans baisser la pertinence';>"+img_item+"Suppression Simple</a><hr style='background-color: #C2CFDF;border:0;height:1px;'><a  href=\"javascript:delete_post_impertinence('index.php?act=Mod&CODE=04&f="+fid+"&t="+tid+"&p="+pid+"&st="+st+"&auth_key="+key+"&imp=y');\" title='Supprimer ET marquer comme non-pertinent'>"+img_item+"Supression & non-pertinence</a>");
}

function build_editButton(fid,tid,pid,st,img_item){
build_atmenu( "edit-but-"+pid+"",
"<a href=\"index.php?act=Post&CODE=08&f="+fid+"&t="+tid+"&p="+pid+"&st="+st+"\" title='Edition dans nouvelle page';>"+img_item+"Edition complète</a><hr style='background-color: #C2CFDF;border:0;height:1px;'><a  href=\"javascript:quick_edit("+fid+","+tid+","+pid+",'"+st+"');\" title='Edition Rapide'>"+img_item+"Edition Rapide</a>");
}
