﻿function OnNewsDeleteClick(id,url)
{
    if(confirm("Etes-vous sûr de vouloir supprimer cette news ?"))
    {
        window.location.href=(url+"?idNews="+id);
    }
}

function OnNewsEditClick(id,url)
{
    window.location.href=(url+"?idNews="+id);
}

function OnCatDeleteClick(id,url)
{
    if(confirm("Etes-vous sûr de vouloir supprimer cette catégorie ?"))
    {
        window.location.href=(url+"?idCat="+id);
    }
}

function OnArticleEditClick(id,url)
{
    window.location.href=(url+"?articleID="+id);
}

function OnArticleDeleteClick(id,url)
{
    if(confirm("Etes-vous sûr de vouloir supprimer cet article ?"))
    {
        window.location.href=(url+"?articleID="+id);
    }
}

function OnCatEditClick(id,url)
{
    window.location.href=(url+"?idCat="+id);
}

function OnSponsorDeleteClick(id,url)
{
    if(confirm("Etes-vous sûr de vouloir supprimer ce sponsor ?"))
    {
        window.location.href=(url+"?sponsorID="+id);
    }
}

function OnSponsorEditClick(id,url)
{
    window.location.href=(url+"?sponsorID="+id);
}

function OnCommentDeleteClick(id,url)
{
    if(confirm("Etes-vous sûr de vouloir supprimer ce commentaire ?"))
    {
        window.location.href=(url+"?idCom="+id);
    }
}

function OnRandomMessageDeleteClick(id,url)
{
    if(confirm("Etes-vous sûr de vouloir supprimer ce message aléatoire ?"))
    {
        window.location.href=(url+"?messageID="+id);
    }
}

function BrowseServer()
{
    CKFinder.Popup("/ckfinder/", null, null, SetFileField);
}

function SetFileField(fileUrl)
{
    document.getElementById("ctl00$content_place$tb_browse_server").value = fileUrl;
}

function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("MSLive.fr, actualités et dossiers techniques IT Pro Microsoft!","http://www.mslive.fr",""); }
else { window.external.AddFavorite("http://www.mslive.fr","MSLive.fr, actualités et dossiers techniques IT Pro Microsoft!"); } }

function OnUserEditClick(id,url)
{
    window.location.href = (url+"?userID="+id);
}

function OnUserDeleteClick(id,url)
{
    window.location.href = (url+"?userID="+id);
}

function askUrl(element)
{
    var lien = window.prompt("Merci de saisir l'url complète de votre lien :","http://");
    if(lien != "" && lien != "http://" && lien != null)
    {
        var title = window.prompt("Merci de saisir le titre de cet élément","");
        if(title != "")
        {
            document.getElementById(element).value += "[url="+lien+"]"+title+"[/url]";
            
        }
        document.getElementById(element).focus();
    }
}

function askBold(element)
{
    var text = window.prompt("Merci de saisir le texte à mettre en gras :","");
    if(text != "" && text != null)
    {
        document.getElementById(element).value += "[b]"+text+"[/b]";
        document.getElementById(element).focus();
    }
}

function askItalic(element)
{
    var text = window.prompt("Merci de saisir le texte à mettre en italique :","");
    if(text != "" && text != null)
    {
        document.getElementById(element).value += "[i]"+text+"[/i]";
        document.getElementById(element).focus();
    }
}

function askUnderline(element)
{
    var text = window.prompt("Merci de saisir le texte à souligner :","");
    if(text != "" && text != null)
    {
        document.getElementById(element).value += "[u]"+text+"[/u]";
        document.getElementById(element).focus();
    }
}

function OnQuote(user,quote,element)
{
    document.getElementById(element).value += "[quote="+user+"]"+quote+"[/quote]";
    document.getElementById(element).focus();
}

function UpdateCaptcha()
{
    document.getElementById("captcha_image").src = "";
    document.getElementById("captcha_image").src = "captcha/captcha.aspx?renew="+Math.random();
}

function AddSmiley(element,smiley)
{
    document.getElementById(element).value += smiley;
    document.getElementById(element).focus();
}