function button_over(eButton) 
	{ 
	eButton.style.backgroundColor = "#B5BDD6"; 
	eButton.style.borderColor = "darkblue darkblue darkblue darkblue"; 
	} 
function button_out(eButton) 
	{ 
	eButton.style.backgroundColor = "threedface"; 
	eButton.style.borderColor = "threedface"; 
	} 
function button_down(eButton) 
	{ 
	eButton.style.backgroundColor = "#8494B5"; 
	eButton.style.borderColor = "darkblue darkblue darkblue darkblue"; 
	} 
function button_up(eButton) 
	{ 
	eButton.style.backgroundColor = "#B5BDD6"; 
	eButton.style.borderColor = "darkblue darkblue darkblue darkblue"; 
	eButton = null;  
	} 
var isHTMLMode=false 
function onreadystatechangeIframe(target) 
	{ 
   parent.frames[target].document.designMode="On" 
	} 
function cmdExec(target,cmd,opt)  
	{ 
  	if (isHTMLMode) {alert("Please uncheck 'Edit HTML'");return;} 
  	parent.frames[target].document.execCommand(cmd,"",opt); parent.frames[target].focus(); 
	}
function setMode(bMode, target)
	{
	var sTmp;
  	isHTMLMode = bMode;
  	if (isHTMLMode){sTmp=parent.frames[target].document.body.innerHTML;parent.frames[target].document.body.innerText=sTmp;} 
	else {sTmp=parent.frames[target].document.body.innerText;parent.frames[target].document.body.innerHTML=sTmp;}
  	parent.frames[target].focus();
	}
function createLink(target) 
	{ 
	if (isHTMLMode) {alert("Please uncheck 'Edit HTML'");return;} 
	cmdExec(target,"CreateLink"); 
	} 
function insertImage() 
	{ 
	if (isHTMLMode) {alert("Please uncheck 'Edit HTML'");return;} 
	var sImgSrc=prompt("Insert Image File (You can use your local image file) : ", "http://www.aspalliance.com/Yusuf/Article10/sample.jpg"); 
	if(sImgSrc!=null) cmdExec(target,"InsertImage",sImgSrc); 
	} 
function Save(textarea, target)  
	{ 
	if (isHTMLMode) {alert("Please uncheck 'Edit HTML'");return;} 
  	var sImgTag = parent.frames[target].document.body.all.tags("IMG"); 
  	var oImg; 
  	for (var i = sImgTag.length - 1; i >= 0; i--)  
		{ 
    	oImg = sImgTag[i]; 
    	//alert("Add your code to Upload local image file here. Image Inserted : " + oImg.src ); 
 		}
 	if (document.forms[0][textarea].value.length >1000000) {
 			alert('Uw document is te groot. Het document mag niet meer dan 1.000.000 karakters bevatten.');
 		}
 		else
 		{
	 		if(tplpage_submit()){DivideLargeText(textarea);document.getElementById('btnSaveDetails').click();}else{alert('Wijzigingen moeten nog worden opgeslagen.')}; 		
 		}
	}
	
function DivideLargeText(TextArea) {

  //Set the limit for field size.
  var FormLimit = 30000
  var d = document.forms[0];
  //Get the value of the large input object.
  var TempVar = new String;
  TempVar = d[TextArea].value;
   
    	
  //If the length of the object is greater than the limit, break it
  //into multiple objects.
  if (TempVar.length > FormLimit)
  {
    d[TextArea].value = TempVar.substr(0, FormLimit)
    TempVar = TempVar.substr(FormLimit)

    while (TempVar.length > 0)
    {
      var objTEXTAREA = document.createElement("TEXTAREA")
      objTEXTAREA.name = TextArea
      objTEXTAREA.value = TempVar.substr(0, FormLimit)
      d.appendChild(objTEXTAREA)
      
      TempVar = TempVar.substr(FormLimit)
    }
  } 
}


 
function foreColor(target) 
	{ 
	var arr = showModalDialog("../std/htmledit_selcolor.htm","","font-family:Verdana; font-size:12; dialogWidth:30em; dialogHeight:34em" ); 
	if (arr != null) cmdExec(target,"ForeColor",arr); 
	} 

