xcpweb

changeset 4:1c27514d61a1

The submenus are ready
author Nikola Nikov <nikolanikov@webconnect.bg>
date Wed May 26 23:14:44 2010 +0300 (2010-05-26)
parents fdb07e066bc0
children 3029bf4a2887
files interface/img/ico-arrow-right.png interface/menu.html interface/rightmenu.css interface/rightmenu.js
line diff
     1.1 Binary file interface/img/ico-arrow-right.png has changed
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/interface/menu.html	Wed May 26 23:14:44 2010 +0300
     2.3 @@ -0,0 +1,35 @@
     2.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     2.6 +<head>
     2.7 +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     2.8 +<title>XCP web interface submenu test</title>
     2.9 +<link href="rightmenu.css" rel="stylesheet" type="text/css" />
    2.10 +<script type="Text/JavaScript" Language="JavaScript" src="rightmenu.js"></script>
    2.11 +<style media="all" type="text/css">
    2.12 +.more-info {display:none}
    2.13 +</style>
    2.14 +<script type="text/javascript" language="javascript">
    2.15 +var param;
    2.16 +function createMenu(param,e) {
    2.17 +	if (inboxmenu.getMenu(param)) { inboxmenu.dropMenu(param); }
    2.18 +	var currentMenu = inboxmenu.createMenu(param);
    2.19 +	if (typeof(currentMenu) == 'object') {
    2.20 +		inboxmenu.appendInMenu(currentMenu,'item1','Item 1',"alert('Item 1')",'/interface/img/ico-arrow-right.png');
    2.21 +		inboxmenu.appendInMenu(currentMenu,'item2','Item 2',"alert('Item 2');",'/interface/img/ico-arrow-right.png');
    2.22 +		var subcurrent = inboxmenu.appendSubInMenu(currentMenu,'sub1','Sub1','/interface/img/ico-arrow-right.png');
    2.23 +		if (typeof(subcurrent) == 'object') {
    2.24 +			inboxmenu.appendInMenu(subcurrent,'submenu1','Sub Menu 1',"alert('Sub Menu 1')",'/interface/img/ico-arrow-right.png');
    2.25 +		}
    2.26 +		inboxmenu.appendInMenu(currentMenu,'item3','Item 3',"alert('item3');",'/interface/img/ico-arrow-right.png');
    2.27 +		inboxmenu.appendInMenu(currentMenu,'item4','Item 4',"alert('item4')",'/interface/img/ico-arrow-right.png');
    2.28 +		inboxmenu.openRightMenu('menu_'+param,e);
    2.29 +	}
    2.30 +}
    2.31 +</script>
    2.32 +</head>
    2.33 +<body>
    2.34 +<a href="#" onclick="createMenu('current_prv',event);">teeeest menu</a>
    2.35 +<div id="otherPages"></div>
    2.36 +<div id="submenus"></div>
    2.37 +</body>
    2.38 +</html>
    2.39 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/interface/rightmenu.css	Wed May 26 23:14:44 2010 +0300
     3.3 @@ -0,0 +1,117 @@
     3.4 +.rightmenu {
     3.5 +	margin: 0px;
     3.6 +	padding: 0px;
     3.7 +	background-color: #f2f2f2;
     3.8 +	font-size: 11px;
     3.9 +	width: 160px;
    3.10 +	font-family: Arial, Helvetica, sans-serif;
    3.11 +	border-top-width: 1px;
    3.12 +	border-right-width: 2px;
    3.13 +	border-bottom-width: 2px;
    3.14 +	border-left-width: 1px;
    3.15 +	border-top-style: solid;
    3.16 +	border-right-style: solid;
    3.17 +	border-bottom-style: solid;
    3.18 +	border-left-style: solid;
    3.19 +	border-top-color: #CCCCCC;
    3.20 +	border-right-color: #666666;
    3.21 +	border-bottom-color: #666666;
    3.22 +	border-left-color: #CCCCCC;
    3.23 +	position: fixed;
    3.24 +	_position:absolute;
    3.25 +	z-index: 30!important;
    3.26 +	z-index:30;
    3.27 +	left: 0px;
    3.28 +	top: 0px;
    3.29 +	display: none;
    3.30 +}
    3.31 +.rightmenu li.sub {
    3.32 +	background-color: #f2f2f2;
    3.33 +	background-image: url(ico-arrow-right.png);
    3.34 +	background-repeat: no-repeat;
    3.35 +	background-position: 145px center;
    3.36 +} 
    3.37 +
    3.38 +.rightmenu ul {
    3.39 +	width:160px;
    3.40 +	height:auto;
    3.41 +	overflow:visible;
    3.42 +	padding:0;
    3.43 +	margin:0;
    3.44 +}
    3.45 +.rightmenu ul li {
    3.46 +	list-style-image:none;
    3.47 +	list-style:none;
    3.48 +	list-style-type:none;
    3.49 +	width:160px;
    3.50 +	height:21px;
    3.51 +	text-align:left;
    3.52 +	margin:0;
    3.53 +	padding:0;
    3.54 +	margin-top:-1px;
    3.55 +	clear:both;
    3.56 +	overflow:visible;
    3.57 +	position:relative;
    3.58 +	padding-top:5px;
    3.59 +	border-top-width: 1px;
    3.60 +	border-top-style: solid;
    3.61 +	border-top-color: #CCCCCC;
    3.62 +	cursor:pointer;
    3.63 +}
    3.64 +.rightmenu ul li a {
    3.65 +	text-decoration:none;
    3.66 +	color:#000000;
    3.67 +}
    3.68 +.rightmenu ul li:hover {
    3.69 +	color:#000000;
    3.70 +	background-color: #9dd4fc;
    3.71 +}
    3.72 +.rightmenu ul li ul {
    3.73 +	position:absolute;
    3.74 +	top:-30px;
    3.75 +	left:145px;
    3.76 +	padding:30px 50px 40px 0px;
    3.77 +	display:none;
    3.78 +	z-index:30;
    3.79 +}
    3.80 +.rightmenu ul li ul li {
    3.81 +	border-top-width: 1px;
    3.82 +	border-right-width: 2px;
    3.83 +	border-bottom-width: 2px;
    3.84 +	border-left-width: 1px;
    3.85 +	border-top-style: solid;
    3.86 +	border-right-style: solid;
    3.87 +	border-bottom-style: solid;
    3.88 +	border-left-style: solid;
    3.89 +	border-top-color: #CCCCCC;
    3.90 +	border-right-color: #666666;
    3.91 +	border-bottom-color: #666666;
    3.92 +	border-left-color: #CCCCCC;
    3.93 +	background-color: #f2f2f2;
    3.94 +	margin-top:-2px;
    3.95 +}
    3.96 +.rightmenu ul li:hover > ul {
    3.97 +	display:block;
    3.98 +}
    3.99 +.menu-ico {
   3.100 +	padding:0;
   3.101 +	float: left;
   3.102 +	width: 16px;
   3.103 +	margin-right: 6px;
   3.104 +	padding-right:0;
   3.105 +	padding-left:6px;
   3.106 +	margin-top:-2px;
   3.107 +}
   3.108 +.menu-ico input {
   3.109 +	float:left;
   3.110 +	margin:0;
   3.111 +	margin-top:2px;
   3.112 +}
   3.113 +.menu-ico-sub {
   3.114 +	padding:0;
   3.115 +	float: left;
   3.116 +	width: 16px;
   3.117 +	margin-right: 3px;
   3.118 +	padding-right:3px;
   3.119 +	padding-left:6px;
   3.120 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/interface/rightmenu.js	Wed May 26 23:14:44 2010 +0300
     4.3 @@ -0,0 +1,458 @@
     4.4 +function xcp_Menu() {
     4.5 +	var bw=document.getElementById&&!document.all;
     4.6 +	var winm;
     4.7 +	var prgm;
     4.8 +	var param;
     4.9 +	var attr;
    4.10 +	var oname;
    4.11 +	var fobj;
    4.12 +	var self = this;
    4.13 +	this.openedForFiles = new Array();
    4.14 +	this.openedForObjects = false;
    4.15 +	this.menuopen = new Array();
    4.16 +	this.menubeforeopen = new Array();
    4.17 +	this.winm = false;
    4.18 +	this.mousedown = function(e) {
    4.19 +		fobj = bw ? e.target : event.srcElement;
    4.20 +		self.checkforopenmenu(e,fobj);
    4.21 +	}
    4.22 +	this.checkforopenmenu = function(e,fobj) {
    4.23 +		if (self.winm && typeof(self.winm) == 'object') {
    4.24 +			if (!fobj.getAttribute('submenu')) {
    4.25 +				var menuid;
    4.26 +				if (menuid = self.getMainMenuId(fobj)) {
    4.27 +					self.dropMenu(menuid.substr(5));
    4.28 +				}
    4.29 +				else if (menuid = self.getMainMenuId(self.winm)) {
    4.30 +					self.dropMenu(menuid.substr(5));
    4.31 +				}
    4.32 +
    4.33 +			}
    4.34 +			else {
    4.35 +				var menuid = self.getMainMenuId(fobj);
    4.36 +				if (document.getElementById(menuid)) {
    4.37 +					var menuObj = document.getElementById(menuid);
    4.38 +					var menuObjLeft = tplf.findPosX(menuObj);
    4.39 +					if (menuObjLeft > menuObj.offsetWidth) {
    4.40 +						var mx = bw ? e.clientX : event.clientX;
    4.41 +						menuObj.style.left = (menuObjLeft-(menuObj.offsetWidth - 15))+'px';
    4.42 +					}
    4.43 +				}
    4.44 +			}
    4.45 +		}
    4.46 +		if (fobj.getAttribute('menuclick') && self.isEnabled(fobj)) {
    4.47 +			if (fobj.tagName == 'INPUT' && fobj.type == 'checkbox') {
    4.48 +				fobj.checked = !fobj.checked;
    4.49 +			}
    4.50 +			else {
    4.51 +				var obj = self.getMenuId(fobj);
    4.52 +				if (typeof(obj) == 'string' && document.getElementById(obj)) {
    4.53 +					self.changeCheckBox(obj);
    4.54 +				}
    4.55 +			}
    4.56 +			eval(fobj.getAttribute('menuclick'));
    4.57 +		}
    4.58 +	}
    4.59 +	this.openRightMenu = function(winm,e,param) {
    4.60 +		if (!document.getElementById(winm)) { return false; }
    4.61 +		var mx = bw ? e.clientX : event.clientX;
    4.62 +		var my = bw ? e.clientY : event.clientY;
    4.63 +		self.winm = document.getElementById(winm);
    4.64 +		if (!param) {
    4.65 +			self.winm.style.left=mx+"px";
    4.66 +			self.winm.style.top=my+"px";
    4.67 +		}
    4.68 +		self.winm.style.display="block";
    4.69 +		if (!param) {
    4.70 +			if (parseInt(navigator.appVersion)>3) {
    4.71 +				if (navigator.appName=="Netscape") {
    4.72 +					var winW = window.innerWidth;
    4.73 +					var winH = window.innerHeight;
    4.74 +				}
    4.75 +				if (navigator.appName.indexOf("Microsoft")!=-1) {
    4.76 +					var winW = document.body.scrollWidth;
    4.77 +					var winH = document.body.scrollHeight;
    4.78 +				}
    4.79 +			}
    4.80 +			if ((Number(self.winm.offsetLeft) + Number(self.winm.offsetWidth)) >= winW) {
    4.81 +				self.winm.style.left = Number(self.winm.offsetLeft) - Number(self.winm.offsetWidth)+'px';
    4.82 +			}
    4.83 +			if ((Number(self.winm.offsetTop) + Number(self.winm.offsetHeight)) >= winH) {
    4.84 +				self.winm.style.top = Number(winH) - Number(self.winm.offsetHeight)+'px';
    4.85 +			}
    4.86 +		}
    4.87 +	}
    4.88 +
    4.89 +	
    4.90 +	var menuobj;
    4.91 +	var menupos;
    4.92 +	var menuname;
    4.93 +	var menuclick;
    4.94 +	var menuicon;
    4.95 +	this.isMenu = function(param) {
    4.96 +		if (document.getElementById('menu_'+param)) { return true; }
    4.97 +		else { return false; }
    4.98 +	}
    4.99 +	this.getMenu = function(param) {
   4.100 +		if (self.isMenu(param)) { return document.getElementById('menu_'+param); }
   4.101 +		else { return false; }
   4.102 +	}
   4.103 +	this.isInMenu = function(menuobj,param) {
   4.104 +		if (!menuobj) { return false; }
   4.105 +		if (typeof(menuobj) == 'object') {
   4.106 +			var mname = self.getMainMenuId(menuobj);
   4.107 +			if (!mname) { return false; }
   4.108 +			if (document.getElementById(mname+'_'+param)) { return true; }
   4.109 +			else { return false; }
   4.110 +		}
   4.111 +		return false;
   4.112 +	}
   4.113 +	this.getInMenu = function(menuobj,param) {
   4.114 +		if (!menuobj) { return false; }
   4.115 +		if (typeof(menuobj) == 'object') {
   4.116 +			var mname = self.getMainMenuId(menuobj);
   4.117 +			if (!mname) { return false; }
   4.118 +			if ((menuobj.className && menuobj.className == 'sub') || menuobj.tagName == 'DIV') {
   4.119 +				menuobj = menuobj.getElementsByTagName('UL');
   4.120 +				if (menuobj.length) { menuobj = menuobj[0]; }
   4.121 +				else { return false; }
   4.122 +			}
   4.123 +			for (i=0;i<menuobj.childNodes.length;i++) {
   4.124 +				if (menuobj.childNodes[i].id && menuobj.childNodes[i].id == mname+'_'+param) {
   4.125 +					return menuobj.childNodes[i];
   4.126 +				}
   4.127 +			}
   4.128 +			return false;
   4.129 +		}
   4.130 +		else { return false; }
   4.131 +	}
   4.132 +	this.getMainMenuId = function(menuobj) {
   4.133 +		if (!menuobj) { return false; }
   4.134 +		if (menuobj.className && menuobj.className == 'rightmenu') { return menuobj.id; }
   4.135 +		while (menuobj.tagName != undefined && menuobj.tagName != 'HTML' && menuobj.tagName != 'HEAD' && menuobj.tagName != 'BODY' && menuobj.parentNode) {
   4.136 +			menuobj = menuobj.parentNode;
   4.137 +			if (menuobj.className && menuobj.className == 'rightmenu') { return menuobj.id; break; }
   4.138 +		}
   4.139 +		return false;
   4.140 +	}
   4.141 +	this.getMenuId = function(menuobj) {
   4.142 +		if (!menuobj) { return false; }
   4.143 +		if (menuobj.tagName && menuobj.tagName == 'LI') { return menuobj.id; }
   4.144 +		while (menuobj.tagName != undefined && menuobj.tagName != 'HTML' && menuobj.tagName != 'HEAD' && menuobj.tagName != 'BODY' && menuobj.parentNode) {
   4.145 +			menuobj = menuobj.parentNode;
   4.146 +			if (menuobj.tagName && menuobj.tagName == 'LI') { return menuobj.id; break; }
   4.147 +		}
   4.148 +		return false;
   4.149 +	}
   4.150 +	this.createMenu = function(param) {
   4.151 +		if (!self.isMenu(param)) {
   4.152 +			var divmenu = document.createElement('DIV');
   4.153 +			divmenu.className = 'rightmenu';
   4.154 +			divmenu.setAttribute('id','menu_'+param);
   4.155 +			var ulmenu = document.createElement('UL');
   4.156 +			ulmenu.setAttribute('id','ul_'+param);
   4.157 +			divmenu.appendChild(ulmenu);
   4.158 +			document.getElementById('submenus').appendChild(divmenu);
   4.159 +			return ulmenu;
   4.160 +		}
   4.161 +		else { return false; }
   4.162 +	}
   4.163 +	this.dropMenu = function(param) {
   4.164 +		if (self.isMenu(param)) {
   4.165 +			var obj = self.getMenu(param);
   4.166 +			obj.parentNode.removeChild(obj);
   4.167 +			obj = undefined;
   4.168 +			return true;
   4.169 +		}
   4.170 +		else { return false; }
   4.171 +	}
   4.172 +	this.appendInMenu = function(menuobj,param,menuname,menuclick,menuicon,menupos) {
   4.173 +		if (typeof(menuobj) != 'object') { return false; }
   4.174 +		if (self.isInMenu(menuobj,param)) { return true; }
   4.175 +		if ((menuobj.className && menuobj.className == 'sub') || menuobj.tagName == 'DIV') {
   4.176 +			menuobj = menuobj.getElementsByTagName('UL');
   4.177 +			if (menuobj.length) { menuobj = menuobj[0]; }
   4.178 +			else { return false; }
   4.179 +		}
   4.180 +		var mname = self.getMainMenuId(menuobj);
   4.181 +		if (!mname) { return false; }
   4.182 +		var newmenu = document.createElement('li');
   4.183 +		newmenu.setAttribute('id',mname+'_'+param);
   4.184 +		newmenu.setAttribute('main','yes');
   4.185 +		if (menuclick) { newmenu.setAttribute('menuclick',menuclick); }
   4.186 +		var mico = document.createElement('span');
   4.187 +		mico.className = 'menu-ico';
   4.188 +		if (menuicon) {
   4.189 +			if (menuicon != 'checkbox' && menuicon != 'null') {
   4.190 +				var icoimg = document.createElement('IMG');
   4.191 +				icoimg.setAttribute('src',menuicon);
   4.192 +				icoimg.setAttribute('border','0');
   4.193 +				var ailink = document.createElement('A');
   4.194 +				ailink.style.cursor = 'pointer';
   4.195 +				ailink.setAttribute('id',mname+'_'+param);
   4.196 +				ailink.className = 'right-menu-'+param;
   4.197 +				if (menuclick) { mico.setAttribute('menuclick',menuclick); icoimg.setAttribute('menuclick',menuclick); ailink.setAttribute('menuclick',menuclick); }
   4.198 +				ailink.appendChild(icoimg);
   4.199 +				mico.appendChild(ailink);
   4.200 +			}
   4.201 +			else {
   4.202 +				if (menuicon == 'checkbox') {
   4.203 +					var icoimg = document.createElement('INPUT');
   4.204 +					icoimg.setAttribute('type',menuicon);
   4.205 +					icoimg.checked = true;
   4.206 +					icoimg.setAttribute('classname',menuicon);
   4.207 +					icoimg.setAttribute('id','checkbox_'+mname+'_'+param);
   4.208 +					if (menuclick) { mico.setAttribute('menuclick',menuclick); icoimg.setAttribute('menuclick',menuclick); }
   4.209 +					mico.appendChild(icoimg);
   4.210 +				}
   4.211 +				if (menuicon == 'null') {
   4.212 +					mico.innerHTML = '&nbsp';
   4.213 +				}
   4.214 +			}
   4.215 +		}
   4.216 +		newmenu.appendChild(mico);
   4.217 +		var alink = document.createElement('A');
   4.218 +		if (menuclick) { alink.setAttribute('menuclick',menuclick); }
   4.219 +		alink.style.cursor = 'pointer';
   4.220 +		alink.setAttribute('id',mname+'_'+param);
   4.221 +		alink.className = 'right-menu-'+param;
   4.222 +		alink.innerHTML = menuname;
   4.223 +		newmenu.appendChild(alink);
   4.224 +		if (menupos && menupos <= menuobj.childNodes.length) {
   4.225 +			menuobj.insertBefore(newmenu,menuobj.childNodes[menupos - 1]);
   4.226 +		}
   4.227 +		else { menuobj.appendChild(newmenu); }
   4.228 +		return newmenu;
   4.229 +	}
   4.230 +
   4.231 +	this.appendSubInMenu = function(menuobj,param,menuname,menuicon,menupos) {
   4.232 +		if (typeof(menuobj) != 'object') { return false; }
   4.233 +		if (self.isInMenu(menuobj,param)) { return true; }
   4.234 +		if ((menuobj.className && menuobj.className == 'sub') || menuobj.tagName == 'DIV') {
   4.235 +			menuobj = menuobj.getElementsByTagName('UL');
   4.236 +			if (menuobj.length) { menuobj = menuobj[0]; }
   4.237 +			else { return false; }
   4.238 +		}
   4.239 +		var mname = self.getMainMenuId(menuobj);
   4.240 +		if (!mname) { return false; }
   4.241 +		var newmenu = document.createElement('li');
   4.242 +		newmenu.setAttribute('id',mname+'_'+param);
   4.243 +		newmenu.setAttribute('main','yes');
   4.244 +		newmenu.className = 'sub';
   4.245 +		var mico = document.createElement('span');
   4.246 +		mico.className = 'menu-ico-sub';
   4.247 +		if (menuicon) {
   4.248 +			if (menuicon == 'null') {
   4.249 +				mico.innerHTML = '&nbsp';
   4.250 +			}
   4.251 +			else {
   4.252 +				var icoimg = document.createElement('IMG');
   4.253 +				icoimg.setAttribute('src',menuicon);
   4.254 +				icoimg.setAttribute('border','0');
   4.255 +				icoimg.setAttribute('submenu','yes');
   4.256 +				mico.appendChild(icoimg);
   4.257 +			}
   4.258 +		}
   4.259 +		mico.setAttribute('submenu','yes');
   4.260 +		newmenu.appendChild(mico);
   4.261 +
   4.262 +		var alink = document.createElement('A');
   4.263 +		alink.style.cursor = 'pointer';
   4.264 +		alink.setAttribute('submenu','yes');
   4.265 +		alink.innerHTML = menuname;
   4.266 +		newmenu.appendChild(alink);
   4.267 +		var subul = document.createElement('UL');
   4.268 +		newmenu.appendChild(subul);
   4.269 +		newmenu.setAttribute('submenu','yes');
   4.270 +		if (menupos && menupos <= menuobj.childNodes.length) {
   4.271 +			menuobj.insertBefore(newmenu,menuobj.childNodes[menupos - 1]);
   4.272 +		}
   4.273 +		else { menuobj.appendChild(newmenu); }
   4.274 +		return subul;
   4.275 +	}
   4.276 +	this.dropInMenu = function(menuobj,param) {
   4.277 +		if (typeof(menuobj) != 'object') { return false; }
   4.278 +		if (!self.isInMenu(menuobj,param)) { return true; }
   4.279 +		if ((menuobj.className && menuobj.className == 'sub') || menuobj.tagName == 'DIV') {
   4.280 +			menuobj = menuobj.getElementsByTagName('UL');
   4.281 +			if (menuobj.length) { menuobj = menuobj[0]; }
   4.282 +			else { return false; }
   4.283 +		}
   4.284 +		var mname = self.getMainMenuId(menuobj);
   4.285 +		if (!mname) { return false; }
   4.286 +		for (i = 0;i<menuobj.childNodes.length;i++) {
   4.287 +			if (menuobj.childNodes[i].tagName == 'LI' && menuobj.childNodes[i].id == mname+'_'+param) {
   4.288 +				menuobj.removeChild(menuobj.childNodes[i]);
   4.289 +				return true;
   4.290 +				break;
   4.291 +			}
   4.292 +		}
   4.293 +		return false;
   4.294 +	}
   4.295 +	this.isEnabled = function(menuobj) {
   4.296 +		if (typeof(menuobj) == 'object' && menuobj.getAttribute('menuclick')) {
   4.297 +			while(!menuobj.getAttribute('main')) {
   4.298 +				menuobj = menuobj.parentNode;
   4.299 +			}
   4.300 +			if (menuobj.getAttribute('disabled')) { return false; }
   4.301 +			return true;
   4.302 +		}
   4.303 +		return false;
   4.304 +	}
   4.305 +	this.enableMenu = function(menuobj) {
   4.306 +		if (typeof(menuobj) == 'object') {
   4.307 +			var elms = menuobj.getElementsByTagName('A');
   4.308 +			if (elms.length) {
   4.309 +				for (var i=0;i<elms.length;i++) {
   4.310 +					elms[i].style.color = "#000000";
   4.311 +				}
   4.312 +			}
   4.313 +			menuobj.style.color="#000000";
   4.314 +			if (menuobj.getAttribute('disabled')) {
   4.315 +				menuobj.removeAttribute('disabled');
   4.316 +			}
   4.317 +		}
   4.318 +	}
   4.319 +	this.changeCheckBox = function(param,attr) {
   4.320 +		if (typeof(param) != 'string' || !document.getElementById(param)) { return false; }
   4.321 +		var chb = self.getCheckBox(param);
   4.322 +		if (!chb) { return false; }
   4.323 +		if (typeof(attr) == 'undefined') {
   4.324 +			chb.checked = !chb.checked;
   4.325 +		}
   4.326 +		else { chb.checked = attr; }
   4.327 +	}
   4.328 +	this.getCheckBox = function(param) {
   4.329 +		if (typeof(param) != 'string' || !document.getElementById(param)) { return false; }
   4.330 +		if (document.getElementById('checkbox_'+param)) {
   4.331 +			return document.getElementById('checkbox_'+param);
   4.332 +		}
   4.333 +	}
   4.334 +	this.disableMenu = function(menuobj) {
   4.335 +		if (typeof(menuobj) == 'object') {
   4.336 +			var elms = menuobj.getElementsByTagName('A');
   4.337 +			if (elms.length) {
   4.338 +				for (var i=0;i<elms.length;i++) {
   4.339 +					elms[i].style.color = "#b1b1b1";
   4.340 +				}
   4.341 +			}
   4.342 +			menuobj.style.color="#b1b1b1";
   4.343 +			menuobj.setAttribute('disabled','yes');
   4.344 +		}
   4.345 +	}
   4.346 +	this.uploadMenu = false;
   4.347 +	this.openUploadMenu = function() {
   4.348 +		if (self.uploadMenu) { document.getElementById('uploadmenu').style.display = 'none'; }
   4.349 +		else { document.getElementById('uploadmenu').style.display = 'block'; }
   4.350 +		self.uploadMenu = !self.uploadMenu;
   4.351 +	}
   4.352 +}
   4.353 +var xcp_menu = new xcp_Menu();
   4.354 +function xcp_Functions() {
   4.355 +	var self = this;
   4.356 +	var param;
   4.357 +	var attr;
   4.358 +
   4.359 +	var objElement;
   4.360 +	var strClass;
   4.361 +	var binMayAlredyExists;
   4.362 +	this.HasClassName = function(objElement, strClass) {
   4.363 +		if ( objElement.className ) {
   4.364 +			var arrList = objElement.className.split(' ');
   4.365 +			var strClassUpper = strClass.toUpperCase();
   4.366 +			for ( var i = 0; i < arrList.length; i++ ) {
   4.367 +				if ( arrList[i].toUpperCase() == strClassUpper ) {
   4.368 +					return true;
   4.369 +				}
   4.370 +			}
   4.371 +		}
   4.372 +		return false;
   4.373 +	}
   4.374 +	this.addClassName = function(objElement, strClass, blnMayAlreadyExist) {
   4.375 +		if ( objElement.className ) {
   4.376 +			var arrList = objElement.className.split(' ');
   4.377 +			if ( blnMayAlreadyExist ) {
   4.378 +				var strClassUpper = strClass.toUpperCase();
   4.379 +				for ( var i = 0; i < arrList.length; i++ ) {
   4.380 +					if ( arrList[i].toUpperCase() == strClassUpper ) {
   4.381 +						arrList.splice(i, 1);
   4.382 +						i--;
   4.383 +					}
   4.384 +				}
   4.385 +			}
   4.386 +			arrList[arrList.length] = strClass;
   4.387 +			objElement.className = arrList.join(' ');
   4.388 +		}
   4.389 +		else {
   4.390 +			objElement.className = strClass;
   4.391 +		}
   4.392 +	}
   4.393 +	this.removeClassName = function(objElement, strClass) {
   4.394 +		if ( objElement.className ) {
   4.395 +			var arrList = objElement.className.split(' ');
   4.396 +			var strClassUpper = strClass.toUpperCase();
   4.397 +			for ( var i = 0; i < arrList.length; i++ ) {
   4.398 +				if ( arrList[i].toUpperCase() == strClassUpper ) {
   4.399 +					arrList.splice(i, 1);
   4.400 +					i--;
   4.401 +				}
   4.402 +			}
   4.403 +			objElement.className = arrList.join(' ');
   4.404 +		}
   4.405 +	}
   4.406 +	this.findPos = function(fobj) {
   4.407 +		if (typeof(fobj) != 'object') { return [0,0]; }
   4.408 +		var curleft = curtop = 0;
   4.409 +		if (fobj.offsetParent) {
   4.410 +			curleft = fobj.offsetLeft
   4.411 +			curtop = fobj.offsetTop
   4.412 +			while (fobj = fobj.offsetParent) {
   4.413 +				curleft += fobj.offsetLeft
   4.414 +				curtop += fobj.offsetTop
   4.415 +			}
   4.416 +		}
   4.417 +		return [curleft,curtop];
   4.418 +	}
   4.419 +	this.findPosX = function(fobj) {
   4.420 +		if (typeof(fobj) != 'object') { return 0; }
   4.421 +		if (navigator.appName == 'Microsoft Internet Explorer' || navigator.appName == 'Opera' || navigator.appName == 'Netscape') {
   4.422 +			return fobj.offsetLeft;
   4.423 +		}
   4.424 +		if (navigator.userAgent.indexOf('Chrome') > -1) {
   4.425 +			return fobj.offsetLeft;
   4.426 +		}
   4.427 +		var curleft = 0;
   4.428 +		if(fobj.offsetParent)
   4.429 +		while(1) {
   4.430 +			curleft += fobj.offsetLeft;
   4.431 +			if(!fobj.offsetParent)
   4.432 +			break;
   4.433 +			fobj = fobj.offsetParent;
   4.434 +		}
   4.435 +		else if(fobj.x)
   4.436 +		curleft += fobj.x;
   4.437 +		return curleft;
   4.438 +	}
   4.439 +	this.findPosY = function(fobj) {
   4.440 +		if (typeof(fobj) != 'object') { return 0; }
   4.441 +		if (navigator.appName == 'Microsoft Internet Explorer' || navigator.appName == 'Opera' || navigator.appName == 'Netscape') {
   4.442 +			return fobj.offsetTop;
   4.443 +		}
   4.444 +		if (navigator.userAgent.indexOf('Chrome') > -1) {
   4.445 +			return fobj.offsetTop;
   4.446 +		}
   4.447 +		var curtop = 0;
   4.448 +		if(fobj.offsetParent)
   4.449 +		while(1) {
   4.450 +			  curtop += fobj.offsetTop;
   4.451 +			  if(!fobj.offsetParent)
   4.452 +			  break;
   4.453 +			  fobj = fobj.offsetParent;
   4.454 +		}
   4.455 +		else if(fobj.y)
   4.456 +		curtop += fobj.y;
   4.457 +		return curtop;
   4.458 +	}
   4.459 +}
   4.460 +var tplf = new xcp_Functions();
   4.461 +document.onmousedown = xcp_menu.mousedown;
   4.462 \ No newline at end of file