﻿// JScript File

function open_istartedafiretab()
{
    window.open("i_started_a_fire_ashtab.html","my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=760, height=600")
}

function insertIM(id){
var obj = document.getElementById('myTextArea');if(typeof(document.selection)!='undefined') 

{

obj.focus();
var range = document.selection.createRange();

if(range.parentElement() != obj) {
return false;

}
var orig = obj.value.replace(/rn/g, "n");

range.text = id;
var actual = tmp = obj.value.replace(/rn/g, "n");

for(var diff = 0; diff < orig.length; diff++) {
if(orig.charAt(diff) != actual.charAt(diff)) break;

}
for(var index = 0, start = 0; (tmp = tmp.replace(id, "")) && (index <= diff); index = start + id.length) {

start = actual.indexOf(id, index);

}
} else {

var startPos = obj.selectionStart;
var endPos = obj.selectionEnd;

obj.value = obj.value.substr(0, startPos) + id + obj.value.substr(endPos, obj.value.length);

}

}

function test() {
   var iframeElem = document.getElementById('FCKeditor1___Frame');
   var txtObj = iframeElem.contentWindow.document.getElementById('xEditingArea');
   var test = (txtObj.childNodes[0].contentWindow.document.body.innerHTML)
   //alert(txtObj.childNodes[0].contentWindow.document.body.innerHTML);
   txtObj.childNodes[0].contentWindow.document.body.innerHTML = test +':)';
}

function insert_smiley2(id) 
{
    var iframeElem = document.getElementById('ctl00_mainPlaceHolder_postFCK___Frame');
    var txtObj = iframeElem.contentWindow.document.getElementById('xEditingArea');
    var text = (txtObj.childNodes[0].contentWindow.document.body.innerHTML);
   
    //set so inserted value will come after paragraph end tag
    var exp = /\<\/p\>$/;
    if (exp.test(text))
    { 
       text = text.replace(exp,'');
    }
    
    //string ends in <br> for some reason (line breaks put in by fckeditor are <br />)
    text = (text.replace("<br>", " "));
    
    txtObj.childNodes[0].contentWindow.document.body.innerHTML = text +id;
 
}

function insert_smiley(id) 
{
    var oEditor = FCKeditorAPI.GetInstance('ctl00_mainPlaceHolder_postFCK') ;
    oEditor.InsertHtml(id);
 
}

function insert_letter(id) 
{
    var oEditor = FCKeditorAPI.GetInstance('ctl00_mainPlaceHolder_postFCK') ;
    oEditor.InsertHtml('<img src=\"http://www.ash-official.com/images/artwork/az100/'+ id +'.gif\" width=\"30px\" />');
 
}

//design

function design_color(bgcolor, color) 
{
    document.getElementById('designdiv').style.background = bgcolor;
    document.getElementById('topdiv').style.color = color;
    document.getElementById('bottomdiv').style.color = color;
    document.getElementById('textdiv').style.color = color;
    document.getElementById('footerdiv').style.color = color;
    document.getElementById('ctl00_mainPlaceHolder_colorHF').value = bgcolor;
}

function design_letter(letter) 
{
    document.getElementById('ctl00_mainPlaceHolder_letterLB').innerHTML = letter;
    document.getElementById('ctl00_mainPlaceHolder_letterHF').value = letter;
}

function design_text() 
{
    var text = document.getElementById('ctl00_mainPlaceHolder_textTB').value;
    document.getElementById('textdiv').innerHTML = text;
    document.getElementById('ctl00_mainPlaceHolder_textHF').value = text;
}

function design_fontsize(size) 
{
    var fontsize = size + 'pt';
    document.getElementById('textdiv').style.fontSize = fontsize;
    document.getElementById('ctl00_mainPlaceHolder_fontsizeHF').value = size;
}



//design