
function rusure() { 

 if (confirm("Are you sure You want to Delete?")) { 
return true; 
 } else { 

return false; 
 } 
} 
function Save() 

	{
  	Form1.infoDetail1.value = idContent.document.body.innerHTML;
  	Form1.submit();
	}

var displayMode = "RICH"
function setDisplayMode() 
	{
	if(displayMode=='RICH')
		{
		idContent.document.body.clearAttributes;
		idContent.document.body.style.fontFamily = 'MS Sans Serif';
		idContent.document.body.style.fontSize = '14px';
		idContent.document.body.innerText = idContent.document.body.innerHTML;
		idContent.document.body.innerHTML = "" + idContent.document.body.innerHTML + ""
		displayMode = 'HTML';
		idToolbar.style.display = "none"
		} 
	else 
		{
		idContent.document.body.clearAttributes;
		idContent.document.body.style.fontFamily = '';
		idContent.document.body.style.fontSize = '';
		idContent.document.body.innerHTML = idContent.document.body.innerText;
		displayMode = 'RICH';
		idToolbar.style.display = "block"
		}
	}
function GetElement(oElement,sMatchTag) 
	{
	while (oElement!=null && oElement.tagName!=sMatchTag) 
		{
		if(oElement.id=="idContent") return null;
		oElement = oElement.parentElement
		}
	return oElement
	}


function FormatText(command, option){
	
  	frames.idContent.document.execCommand(command, true, option);
  	frames.idContent.focus();
}

function AddImage(){	
	imagePath = prompt('Enter the web address of the image', 'http://');				
	
	if ((imagePath != null) && (imagePath != "")){					
		frames.idContent.document.execCommand('InsertImage', false, imagePath);
  		frames.idContent.focus();
	}
	frames.idContent.focus();			
}

function AddSmileyIcon(imagePath){	
									
	frames.idContent.document.execCommand('InsertImage', false, imagePath);
  	frames.idContent.focus();			
}

function showNewColor(idChang) {

		var newColor = idChang;

		if((document.getElementById)&& (document.getElementById('tagID')!=null)) {

			var myElement = document.getElementById('tagID');

		 	if ((myElement.style)&& (myElement.style.backgroundColor!=null)) {

			    if(myElement.style.backgroundColor == 'white'){

					document.getElementById('tagID').style.backgroundColor = newColor;

				}else {

					document.getElementById('tagID').style.backgroundColor = newColor;      
    			}

  			}else {	

				return;

  			}

		}else {

		  return;

		}

	}
	
	
function showColorBox(idChang) {

		var newColor = idChang;

		if((document.getElementById)&& (document.getElementById('tagID2')!=null)) {

			var myElement = document.getElementById('tagID2');

		 	if ((myElement.style)&& (myElement.style.backgroundColor!=null)) {

			    if(myElement.style.backgroundColor == 'white'){

					document.getElementById('tagID2').style.backgroundColor = newColor;

				}else {

					document.getElementById('tagID2').style.backgroundColor = newColor;      
    			}

  			}else {	

				return;

  			}

		}else {

		  return;

		}

	}


function CheckForm() {
	
var email=document.SaveForm.YourMail.value;
if (email==""){
alert("Please type your Email")
document.SaveForm.YourMail.focus()
return false
	}
	
	if (document.SaveForm.textName.value == ""){
		alert("Please type your Name");
		document.SaveForm.textName.focus();
		return false;
	}

	
	
	return true
}

function addicon(what)
{
	frames.idContent.focus();
	frames.idContent.document.execCommand('InsertImage', false, what);
}



function _icon() {
window.open('./_infoboard4/icon.php', '', "scrollbars=no,width=500,height=400");
}

function _reg() {
window.open('./_infoboard4/_reg.php', '', "scrollbars=no,width=500,height=400");
}

function _gen() {
window.open('./_infoboard4/_gen.php', '', "scrollbars=no,width=500,height=400");
}

function _forget() {
window.open('./_infoboard4/_forget.php', '', "scrollbars=no,width=500,height=400");
}

function _admin() {
window.open('./_infoboard4/_admin.php', '', "scrollbars=yes,width=500,height=400");
}

function _user() {
window.open('./_infoboard4/_user.php', '', "scrollbars=yes,width=500,height=400");
}

function _member() {
window.open('./_infoboard4/_mem.php', '', "scrollbars=no,width=500,height=400");
}

//var mikExp = /[\/\'\"\:\;\,\\.?\|\<\>$\\@\\\#%\^\&\*\(\)\[\]\+\{\}\`\~\=\|]/;
var mikExp = /[\/\'\"\:\;\,\?\|\<\>$\\@\\\#%\^\&\*\(\)\[\]\+\{\}\`\~\=\|]/;
function dodacheck(val) {
var strPass = val.value;
var strLength = strPass.length;
var lchar = val.value.charAt((strLength) - 1);
if(lchar.search(mikExp) != -1) {
var tst = val.value.substring(0, (strLength) - 1);
val.value = tst;
   }
}
function doanothercheck(form) {
if(form.value.length < 1) {
alert('Please enter something.');
return false;
}
if(form.value.search(mikExp) == -1) {
alert('Correct Input');
return false;
}
else {
alert('Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ =  | \n\r\n\rare not allowed!\n');
form.select();
form.focus();
return false;
}
alert('Correct Input');
return false;
}


function openDir( form ) { 

	var newIndex = form.catid.selectedIndex; 
		cururl = form.catid.options[ newIndex ].value; 

		window.location.assign( cururl ); 
} 
