var mce = false;
var aTimer = null;
var blend = false;
var site = "";
var alTimer = false;
var status = false;
var ssObject = "";
var ssName = "";
var ssHeaders = "";
var order = "Date";
var by = "Desc";
var target = false;
var alpha = false;
var alerted = false;
httpObject = null;

var isCtrl = false; 
var isShift = false;
document.onkeyup=function(e){ 
  if (window.event) {
    num = window.event.keyCode;
  } else if (e.which) {
    num = e.which;
  }
  if(num == 17) isCtrl = false;
  if(num == 16) isShift = false;   
} 

document.onkeydown=function(e){
  if (window.event) {
    num = window.event.keyCode;
  } else if (e.which) {
    num = e.which;
  }
  if(num == 16) isShift = true;
  if(num == 17) isCtrl = true; 
  if(num == 65 && isCtrl == true && isShift == true) { 
    location.href = '/admin';
    return false; 
  } 
} 


function showContact() {
  document.getElementById('ftAuthor').style.display = 'none';
  document.getElementById('ftAuthorMail').style.display = 'block';
}

function hideContact() {
  document.getElementById('ftAuthor').style.display = 'block';
  document.getElementById('ftAuthorMail').style.display = 'none';
}

function getHTTPObject() {
	var xmlHttp=null;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		//Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	xmlHttp.ContentType = "text/xml; encoding='utf-8'";
	return xmlHttp;
}

function setCookie(name, value, expDays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expDays);
	document.cookie=name+ "=" +escape(value)+
	((expDays==null) ? "" : ";expires="+exdate.toGMTString());
}

function switchSection(object,name) {
  ssObject = object;
  ssName = name;
  if (arguments[2]) {
    ssHeaders = arguments[2];
    headers = arguments[2];
    if (arguments[3]) fixHeaders = true;
  } 
  if (!status) {
    order = "Date";
    by = "desc"
    exclusion = new Array('admin', 'news');
    found = false;
    for(i=0;i<exclusion.length;i++) {
      if (name == exclusion[i]) found = true;
    }
    if (ssObject && !found) {
      var sectDiv = document.getElementById('sections');
      nav = sectDiv.getElementsByTagName('a'); 
      for (e=0;e<nav.length;e++) { 
        nav[e].className = ''; 
      }     
      object.blur();
      object.className = 'selected';    
    }
    sectionBlend('hide');
    return false;
  }
  setCookie('lastVisited',name,'1');
	httpObject = getHTTPObject();
	var random = Math.floor(Math.random()*10000000);
	if (httpObject != null) {
	  if (ssHeaders) random += ssHeaders;
		httpObject.onreadystatechange=switchSectionResult;
	  httpObject.open("GET", "data/parts/"+ssName+".php?rand="+random, true);
	  httpObject.send(null);
	}  
}

function sectionBlend(mode) {
  var sBlocker = document.getElementById('siteBlocker');
  var dBlend = document.getElementById('deckBlend');
  var deck = document.getElementById('deck');  
  if (!status) {
    status = mode;
    dims = getXY().split(",");
    x = dims[0];
    y = dims[1];
    sBlocker.style.width = (x-20)+"px";
    sBlocker.style.height = (y-20)+"px";
    if (deck.offsetHeight>400) {
      dBlend.style.height = (deck.offsetHeight-200)+"px";
      dBlend.style.paddingTop = "200px";
    } else {
      dBlend.style.height = (deck.offsetHeight/2+20)+"px";
      dBlend.style.paddingTop = (deck.offsetHeight/2-20)+"px";    
    }
    sBlocker.style.display = "block";    
    vis = 0;
  }
  if (status == 'hide') {
    if (vis<=100) {
      dBlend.style.opacity = (vis / 100);
      dBlend.style.MozOpacity = (vis / 100);
      dBlend.style.KhtmlOpacity = (vis / 100);
      //deck.style.filters.alpha.opacity = vis;
      dBlend.style.filter = "alpha(opacity=" + vis + ")";            
      vis += 20;
      timer = window.setTimeout('sectionBlend(\'hide\')',30);
      if (dBlend.style.display == "none") {
        dBlend.style.display = "block";      
      }    
    } else {
      vis = 100;
      switchSection(ssObject,ssName);
    }
  }
  if (mode == 'show') {
    if (status == 'hide') {
      status = mode;
      if (deck.offsetHeight>400) {
        dBlend.style.height = (deck.offsetHeight-200)+"px";
        dBlend.style.paddingTop = "200px";
      } else {
        dBlend.style.height = (deck.offsetHeight/2+20)+"px";
        dBlend.style.paddingTop = (deck.offsetHeight/2-20)+"px";    
      }
    }  
    if (vis>=0) {
      dBlend.style.opacity = (vis / 100);
      dBlend.style.MozOpacity = (vis / 100);
      dBlend.style.KhtmlOpacity = (vis / 100);
      //deck.style.filters.alpha.opacity = vis;
      dBlend.style.filter = "alpha(opacity=" + vis + ")";
      vis -= 20;
      timer = window.setTimeout('sectionBlend(\'show\')',30);
    } else {
      sBlocker.style.display = "none";
      dBlend.style.display = "none";          
      if (timer) window.clearTimeout(timer);
      deck.style.filter = "";
      status = false;
      ssObject = "";
      ssName = "";
      ssHeaders = "";
    }
  }  
}

function switchSectionResult() {
	if (httpObject.readyState == 4 || httpObject.readyState == "complete") {
		document.getElementById("panelSite").innerHTML = httpObject.responseText;
		httpObject = null;
		if (document.getElementById('alert')) {
		  if (alTimer) window.clearTimeout(alTimer);
      step = 0;
      alerted = false;
      height = 28;
      hideAlert();
    } 
		sectionBlend('show');
		if (typeof(fixHeaders) != "undefined") {
  		if (!fixHeaders) {
        headers = false;
      } else {
        fixHeaders = false
      }    
    } else {
      headers = false;
    }

    
	}  
}

function hideAlert() {
  if (alerted) {
    if (height > 1) {
      if (height>4)
        height -= 4;
      else
        height--;
      alertBox.style.height = height+"px";
      alertBox.style.leftPadding = "3px";
      alTimer = window.setTimeout("hideAlert()",40);
      step++;    
    } else {
      if (alertBox.parentNode) old = (alertBox.parentNode).removeChild(alertBox);
      alerted = false;
    }

  } else {
    step = 0;
    alerted = true;
    height = 28;
    alertBox = document.getElementById('alert');
    alTimer = window.setTimeout("hideAlert()",2000);
  }
}

function getXY() {
  myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
    }
  }
  if (document.body.clientHeight > myHeight) {
  	myHeight = document.body.clientHeight;
  }
  dimensions = myWidth+","+myHeight;
  return dimensions;
}

function adminSwitchSection(object,name) {
  if (mce) {
    tinyMCE.execCommand('mceRemoveControl', false, 'Content');
    mce = false;
  }
  var adminDiv = document.getElementById('adminContent');
  var blend = document.getElementById('adminBlend');
  if (object) object.blur();
  hgt = adminDiv.offsetHeight;
  if (hgt>80) hgt -= 80;
  blend.style.height = hgt+15+"px";
  blend.style.display = "block";
	httpObject = getHTTPObject();
	var random = Math.floor(Math.random()*10000000);
	if (httpObject != null) {
		httpObject.onreadystatechange=adminSwitchSectionResult;
		if (arguments[2]) 
      output = "&"+arguments[2];
    else 
      output = '';
    if (arguments[3] == "post") {
      args = "rand="+random+output;
      httpObject.open("POST", "data/admin/"+name+".php", true);
      
      httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      httpObject.setRequestHeader("Content-length", args.length);
      httpObject.setRequestHeader("Connection", "close");
      
      httpObject.send(args);
    } else {
      httpObject.open("GET", "data/admin/"+name+".php?rand="+random+output, true);
  	  httpObject.send(null);    
    }
	  
	  site = name;
	}   
}

function adminReadMessage(object,msg_id) {
  object.className = 'hand';
  var adminDiv = document.getElementById('msgContent');
  var msgBlend = document.getElementById('msgBlend');
  hgt = adminDiv.offsetHeight;
  if (hgt>60) hgt -= 60;
  msgBlend.style.height = hgt+"px";
  msgBlend.style.display = 'block';
	httpObject = getHTTPObject();
	var random = Math.floor(Math.random()*10000000);
  if (httpObject != null) {
    httpObject.onreadystatechange=adminReadMessagePush;
    httpObject.open("GET", "data/admin/msg_display.php?rand="+random+"&msg_id="+msg_id, true);
	  httpObject.send(null);      
  }  
}

function adminReadMessagePush() {
	if (httpObject.readyState == 4 || httpObject.readyState == "complete") {
	  document.getElementById('msgContent').innerHTML = httpObject.responseText;
	  document.getElementById('msgBlend').style.display = "none";
	}
}

function adminReadChat(object,msg_id) {
  object.className = 'hand';
  var adminDiv = document.getElementById('msgContent');
  var msgBlend = document.getElementById('msgBlend');
  hgt = adminDiv.offsetHeight;
  if (hgt>60) hgt -= 60;
  msgBlend.style.height = hgt+"px";
  msgBlend.style.display = 'block';
	httpObject = getHTTPObject();
	var random = Math.floor(Math.random()*10000000);
  if (httpObject != null) {
    httpObject.onreadystatechange=adminReadMessagePush;
    httpObject.open("GET", "data/admin/chat_display.php?rand="+random+"&msg_id="+msg_id, true);
	  httpObject.send(null);      
  }  
}

function adminReadChatPush() {
	if (httpObject.readyState == 4 || httpObject.readyState == "complete") {
	  document.getElementById('msgContent').innerHTML = httpObject.responseText;
	  document.getElementById('msgBlend').style.display = "none";
	}
}

function adminSwitchSectionResult() {
	if (httpObject.readyState == 4 || httpObject.readyState == "complete") {	
		document.getElementById("adminContent").innerHTML = httpObject.responseText;
		httpObject = null;
		document.getElementById('adminBlend').style.display = "none";
		withMce = new Array();
		if (document.getElementById('alert')) {
		  if (alTimer) window.clearTimeout(alTimer);
      step = 0;
      alerted = false;
      height = 28;
      hideAlert();
    } 
		withMce.push('news_set','gallery_set','content','scrapbooks_set');
		for (i=0;i<withMce.length;i++) {
      if (withMce[i] == site) {
        mceInit();
        mce = true;
      }
    }
	}  
}

function selectAll(item,id) {
  var parent = document.getElementById(id);
  if (item.checked) 
    value = "checked";
  else
    value = false;
  
  boxes = parent.getElementsByTagName('input');
  for (i=0;i<boxes.length;i++) {
    boxes[i].checked = value;
  }
}

function adminNewsDelete() {
  var newsPane = document.getElementById('newsPane');
  var ids = new Array();
  nav = newsPane.getElementsByTagName('input');
  for(e=0;e<nav.length;e++) {
    if (nav[e].checked) {
      id = nav[e].id.split('_')[1];
      ids.push(id);
    }
  }
  if (ids.length) {
    adminSwitchSection(null,'news','action=del&ids='+ids.join(','));
  } else {
    alert('Nebyly zvoleny žádné novinky.');
  }
}

function adminDivisionsDelete() {
  var newsPane = document.getElementById('divsPane');
  var ids = new Array();
  nav = newsPane.getElementsByTagName('input');
  for(e=0;e<nav.length;e++) {
    if (nav[e].checked) {
      id = nav[e].id.split('_')[1];
      ids.push(id);
    }
  }
  if (ids.length) {
    adminSwitchSection(null,'divisions','action=del&ids='+ids.join(','));
  } else {
    alert('Nebyly zvoleny žádné sekce.');
  }
}

function adminMsgsDelete() {
  var msgsPane = document.getElementById('msgsPane');
  var ids = new Array();
  nav = msgsPane.getElementsByTagName('input');
  for(e=0;e<nav.length;e++) {
    if (nav[e].checked) {
      id = nav[e].id.split('_')[1];
      ids.push(id);
    }
  }
  if (ids.length) {
    adminSwitchSection(null,'messages','action=del&ids='+ids.join(','));
  } else {
    alert('Nebyly zvoleny žádné vzkazy.');
  }
}

function adminChatDelete() {
  var msgsPane = document.getElementById('msgsPane');
  var ids = new Array();
  nav = msgsPane.getElementsByTagName('input');
  for(e=0;e<nav.length;e++) {
    if (nav[e].checked) {
      id = nav[e].id.split('_')[1];
      ids.push(id);
    }
  }
  if (ids.length) {
    adminSwitchSection(null,'chat','action=del&ids='+ids.join(','));
  } else {
    alert('Nebyly zvoleny žádné vzkazy.');
  }
}

function adminGalleryCatDelete() {
  var galleryPane = document.getElementById('galleryPane');
  var ids = new Array();
  nav = galleryPane.getElementsByTagName('input');
  for(e=0;e<nav.length;e++) {
    if (nav[e].checked) {
      spl = nav[e].id.split('_');
      if (spl[1] == "cat") {
        ids.push(spl[2]);
      }
    }
  }
  if (ids.length) {
    adminSwitchSection(null,'gallery','action=del&ids='+ids.join(','));
  } else {
    alert('Nebyly zvoleny žádné kategorie.');
  }
}

function adminGalleryUpload() {
  var galleryPane = document.getElementById('galleryPane');
  if (galleryPane) {
    var ids = new Array();
    nav = galleryPane.getElementsByTagName('input');
    for(e=0;e<nav.length;e++) {
      if (nav[e].checked) {
        spl = nav[e].id.split('_');
        if (spl[1] == "cat") {
          ids.push(spl[2]);
        }
      }
    }
    if (ids.length) {
      adminSwitchSection(null,'gallery','action=upload&ids='+ids.join(','));
    } else {
      alert('Nebyly zvoleny žádné kategorie.');
    }   
  } else {
    alert('V galerii nejsou žádné kategorie.');
  }
}

function adminGalleryPicsSwitch() {
  var galleryPane = document.getElementById('galleryPane');
  if (galleryPane) {
    var ids = new Array();
    nav = galleryPane.getElementsByTagName('input');
    for(e=0;e<nav.length;e++) {
      if (nav[e].checked) {
        spl = nav[e].id.split('_');
        if (spl[1] == "cat") {
          ids.push(spl[2]);
        }
      }
    }
    var ids_pics = new Array();
    for(a=0;a<ids.length;a++) {
      if (document.getElementById('picturesPane_'+ids[a])) {
        catPane = document.getElementById('picturesPane_'+ids[a]);
        nav = catPane.getElementsByTagName('input');
        for(e=0;e<nav.length;e++) {
          if (nav[e].checked) {
            spl = nav[e].id.split('_');
            if (spl[1] == "pic") {
              ids_pics.push(spl[2]);
            }
          }
        }        
      }
    }
    if (ids.length) {
      adminSwitchSection(null,'gallery','action=switch&ids='+ids.join(',')+'&ids_pics='+ids_pics.join(','));
    } else {
      alert('Nebyly zvoleny žádné kategorie.');
    }   
  } else {
    alert('V galerii nejsou žádné kategorie.');
  }  
}

function adminScrapbooksCatDelete() {
  var scrapbooksPane = document.getElementById('scrapbooksPane');
  var ids = new Array();
  nav = scrapbooksPane.getElementsByTagName('input');
  for(e=0;e<nav.length;e++) {
    if (nav[e].checked) {
      spl = nav[e].id.split('_');
      if (spl[1] == "cat") {
        ids.push(spl[2]);
      }
    }
  }
  if (ids.length) {
    adminSwitchSection(null,'scrapbooks','action=del&ids='+ids.join(','));
  } else {
    alert('Nebyla zvolena žádná alba.');
  }
}

function adminScrapbooksUpload() {
  var scrapbooksPane = document.getElementById('scrapbooksPane');
  if (scrapbooksPane) {
    var ids = new Array();
    nav = scrapbooksPane.getElementsByTagName('input');
    for(e=0;e<nav.length;e++) {
      if (nav[e].checked) {
        spl = nav[e].id.split('_');
        if (spl[1] == "cat") {
          ids.push(spl[2]);
        }
      }
    }
    if (ids.length) {
      adminSwitchSection(null,'scrapbooks','action=upload&ids='+ids.join(','));
    } else {
      alert('Nebyla zvolena žádná alba.');
    }   
  } else {
    alert('V galerii nejsou žádná alba.');
  }
}

function adminScrapbooksPicsSwitch() {
  var scrapbooksPane = document.getElementById('scrapbooksPane');
  if (scrapbooksPane) {
    var ids = new Array();
    nav = scrapbooksPane.getElementsByTagName('input');
    for(e=0;e<nav.length;e++) {
      if (nav[e].checked) {
        spl = nav[e].id.split('_');
        if (spl[1] == "cat") {
          ids.push(spl[2]);
        }
      }
    }
    var ids_pics = new Array();
    for(a=0;a<ids.length;a++) {
      if (document.getElementById('picturesPane_'+ids[a])) {
        catPane = document.getElementById('picturesPane_'+ids[a]);
        nav = catPane.getElementsByTagName('input');
        for(e=0;e<nav.length;e++) {
          if (nav[e].checked) {
            spl = nav[e].id.split('_');
            if (spl[1] == "pic") {
              ids_pics.push(spl[2]);
            }
          }
        }        
      }
    }
    if (ids.length) {
      adminSwitchSection(null,'scrapbooks','action=switch&ids='+ids.join(',')+'&ids_pics='+ids_pics.join(','));
    } else {
      alert('Nebyla zvolena žádná alba.');
    }   
  } else {
    alert('V galerii nejsou žádná alba.');
  }  
}

function dropDown(trigger, objectId) {
  obj = document.getElementById(objectId);
  if (trigger.src.split('_')[1] == "0.png") {
    trigger.src = 'data/gfx/drop_1.png';   
    obj.style.display = "none";
  } else {
    trigger.src = 'data/gfx/drop_0.png';
    obj.style.display = "block";
  }
}

function turnPage(page,tgt,pgname,pgType) {
  if (!httpObject && !alpha) {
    container = document.getElementById(tgt);
    blend = document.getElementById(tgt+'Blend');
    headers = headers + "&"+pgType+"="+page;
    target = tgt;
    pagename = pgname;
    changeOpacity(blend,'up','ascQuery(pagename,headers)');  
  }
}

function switchContent(tgt,pgname,add) {
  if (!httpObject && !alpha) {
    container = document.getElementById(tgt);
    blend = document.getElementById(tgt+'Blend');
    if (add) headers = add;
    target = tgt;
    pagename = pgname;
    changeOpacity(blend,'up','ascQuery(pagename,headers)');  
  }
}

function switchSort(id,tgt) {
  if (!httpObject && !alpha) {
    container = document.getElementById(tgt);
    blend = document.getElementById(tgt+'Blend');
    trigger = document.getElementById('sort'+id);
    trigger.blur();
    owner = trigger.parentNode;
    imgs = owner.getElementsByTagName('img');
    if (by == 'Desc') {
      by = 'Asc';
    } else {
      by = 'Desc';
    }
    order = id;
    for (i=0;i<imgs.length;i++) {
      if (imgs[i].id != 'sort'+id+'Pic') {
        imgs[i].style.display = "none";
      } else {
        imgs[i].src = 'data/gfx/sort'+by+'.png';
        imgs[i].style.display = "inline";
      }
    }
    headers = "&order="+order+"&by="+by;
    pagename = arguments[2];
    target = tgt;
    changeOpacity(blend,'up','ascQuery(pagename,headers)');  
  }
}

function drawChat(headers) {
	httpObject = getHTTPObject();
	var random = Math.floor(Math.random()*10000000);
	if (httpObject != null) { 
	  if (headers) random += headers;
		httpObject.onreadystatechange=drawChatResult;
	  httpObject.open("GET", "data/parts/chatDisp.php?rand="+random, true);
	  httpObject.send(null);
	}    
  chatAddTrigger();
}

function drawChatResult() {
  if (httpObject.readyState == 4 || httpObject.readyState == "complete") {
    document.getElementById('chatSelf').innerHTML = httpObject.responseText;
  } 
}

function ascQuery(pagename,headers) {
	httpObject = getHTTPObject();
	var random = Math.floor(Math.random()*10000000);
	if (httpObject != null) {
	  if (headers) random += headers;
		httpObject.onreadystatechange=ascQueryResult;
	  httpObject.open("GET", "data/parts/"+pagename+".php?rand="+random, true);
	  httpObject.send(null);
	}  
}

function changeOpacity(object,direction,next) {
  if (direction == 'up') {
    if (!alpha) {
      alpha = 0;
      blend.style.width = container.offsetWidth+"px";
      blend.style.height = (container.offsetHeight+10)+"px";
      blend.style.opacity = 0;
      blend.style.MozOpacity = 0;
      blend.style.KhtmlOpacity = 0;
      blend.style.filter = "alpha(opacity=0)";         
      blend.style.display = 'block';      
    }
    if (alpha <= 100) {
      alpha += 10;
      object.style.opacity = (alpha / 100);
      object.style.MozOpacity = (alpha / 100);
      object.style.KhtmlOpacity = (alpha / 100);
      object.style.filter = "alpha(opacity=" + alpha + ")";      
      blendObject = object;
      dir = direction;
      nxt = next;
      window.setTimeout('changeOpacity(blendObject,dir,nxt)',10);
    } else {
      alpha = false;
      window.setTimeout(next,0);
    }
  }  
  if (direction == 'down') {
    if (alpha > 0) {
      alpha -= 10;
      object.style.opacity = (alpha / 100);
      object.style.MozOpacity = (alpha / 100);
      object.style.KhtmlOpacity = (alpha / 100);
      object.style.filter = "alpha(opacity=" + alpha + ")";      
      window.setTimeout('changeOpacity(blendObject,\'down\',null)',10);
    } else {
      blend.style.display = 'none';
      alpha = false;
    }
  }
}

function ascQueryResult() {
	if (httpObject.readyState == 4 || httpObject.readyState == "complete") {
		document.getElementById(target).innerHTML = httpObject.responseText;
		alpha = 100;
    blend.style.width = container.offsetWidth+"px";
    blend.style.height = (container.offsetHeight+10)+"px";		
		changeOpacity(blendObject,'down',null);
		httpObject = null;
    target = false
	}  
}

function chatAddTrigger() {
  var trigger = document.getElementById('chatAddTrigger');
  var triggerBg = document.getElementById('chatAddTriggerBg');
  var addSelf = document.getElementById('chatAddSelf');
  if (typeof(trigger.shown) == "undefined") {
    trigger.shown = false;
    addSelf.style.height = (document.getElementById('chatSelf').offsetHeight-30)+"px";
  }
  triggerBg.style.display = (trigger.shown ? "none" : "block");
  addSelf.style.display = (trigger.shown ? "none" : "block");
  trigger.shown = (trigger.shown ? false : true);
}

function mceInit() {
  tinyMCE.init({
  	mode : "exact",
  	elements : "Content",
  	theme : "advanced",

  	plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
  
  	theme_advanced_buttons1: "justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
  	theme_advanced_buttons2: "tablecontrols,|,link,unlink,|,image",
  	theme_advanced_buttons3: "cite,abbr,acronym,|,insertdate,inserttime,preview,|,forecolor,backcolor,|,search,replace,print",
  	theme_advanced_buttons4: "bold,italic,underline,strikethrough,|,sub,sup,|,hr,charmap,emotions,|,bullist,numlist,outdent,indent,|,blockquote,code",
  	theme_advanced_toolbar_location : "top",
  	theme_advanced_toolbar_align : "left",
  	theme_advanced_statusbar_location : "bottom",
  	theme_advanced_resizing : true,

  	content_css : "data/tiny_mce/mce.css",
  
  	template_replace_values : {
  		username : "",
  		staffid : "1"
  	}
  });
}
