var editorvinduerArr = new Array();

function checkAll(checkname, exby) {
	var check = exby.checked;
	if (checkname) {
		if (checkname.length) {
			for (i = 0; i < checkname.length; i++)
			checkname[i].checked = check;
		} else {
			checkname.checked = check;
		}
	}
}

function turnEditorOn(id, contextPath, direction) {
	editorvinduerArr[id] = id;
	var element = document.getElementById(id);
	if (element!=null) {
		var oFCKeditor = new FCKeditor(id);
		setEditorProperties(oFCKeditor, contextPath, direction);
		oFCKeditor.ReplaceTextarea();
	}
}

function setEditorProperties(editor, contextPath, direction) {
	editor.ToolbarSet = "Basic" ;
	editor.Width = "300" ;
	editor.Height = "100" ;
	editor.BasePath = contextPath + "/fckeditor/";
	editor.Config[ "ToolbarStartExpanded" ] = false ;
	if (direction) editor.Config.ContentLangDirection = direction;
}

function infored_Tip(head) {
	var tipProxy = {};
	tipProxy.head = head;
	tipProxy.tip = function(body) {
		Tip(body,TITLE,this.head,OFFSETX,25,TITLEBGCOLOR,'#C0C0C0',BORDERCOLOR,'#C0C0C0',BGCOLOR,'#FFFFFF',WIDTH,300,TITLEFONTCOLOR,'#000000');
	};
	return tipProxy;
}

function windowClientSize() {
	  var 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;
	  }
	  return {width: myWidth, height: myHeight};
}

