﻿

document.write('<script type="text/javascript" src="/jscripts/tiny_mce/tiny_mce.js"></script>');

function SimpleMCE(ElementID){
    tinyMCE.init({	
	
	mode : "exact",
	elements : ElementID,
	directionality : "rtl",
	language : "en",
	theme : "advanced",
	auto_reset_designmode : true,
	theme_advanced_buttons1 : "unlink,link,|,justifyleft,justifycenter,justifyright,|,underline,italic,bold",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "right",
	extended_valid_elements : "a[name|href|title|target],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
    });
}

function MiddleMCE(ElementID){
    tinyMCE.init({	
	mode : "exact",
	elements : ElementID,
	directionality : "rtl",
	language : "en",
	theme : "advanced",
	plugins : "paste",
	paste_auto_cleanup_on_paste : true,
	paste_create_paragraphs : false,
	theme_advanced_buttons1 : "code,|,unlink,link,|,underline,italic,bold,forecolor,|,justifyleft,justifycenter,justifyright,|,pasteword",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "right",
	extended_valid_elements : "a[name|href|title|target],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
    });
}

function SimpleInit() {
    tinyMCE.init({	
	
	mode : "exact",
	directionality : "rtl",
	language : "en",
	setupcontent_callback : "myCustomSetupContent",
	theme : "advanced",
	auto_reset_designmode : true,
	theme_advanced_buttons1 : "unlink,link,|,justifyleft,justifycenter,justifyright,|,underline,italic,bold",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "right",
	extended_valid_elements : "a[name|href|title|target],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
    });
}
function myCustomSetupContent(editor_id, body, doc) 
{
    body.innerHTML = "";
}


function AddToElement(ElementID, Counter) {
    tinyMCE.idCounter = Counter; 
    tinyMCE.execCommand('mceAddControl', false, ElementID);
    tinyMCE.switchClassCache = [];
    
}

function RemoveFromElement(ElementID) {
    tinyMCE.execCommand('mceRemoveControl', false, ElementID);
}