function inLineEditOn(control)
{
    control.className = "CommonInlineEditOn";
}

function inLineEditOff(control)
{
    control.className = "CommonInlineEditOff";
}

function inGroupLineEditOn(control)
{
    control.className = "GroupInlineEditOn";
}

function inGroupLineEditOff(control)
{
    control.className = "GroupInlineEditOff";
}

function inGroupNameLineEditOn(control)
{
    control.className = "GroupNameInlineEditOn";
}

function inGroupNameLineEditOff(control)
{
    control.className = "GroupNameInlineEditOff";
}

function getX(evt) {
     if (document.all) { return (evt.clientX); }
     return (evt.layerX);
}
function getY(evt) {
     if (document.all) { return (evt.clientY); }
     return (evt.layerY);
}
function getScrollX() {
     if (document.all) { return (document.body.scrollLeft); }
     return (window.pageXOffset);
}
function getScrollY() {
     if (document.all) { return (document.body.scrollTop); }
     return (window.pageYOffset);
}
function redirectto(url){ window.location= 'UserProfile.aspx?userid=' + url; }
//Ajax
function Ajax_GetXMLHttpRequest() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else {
		if (window.Ajax_XMLHttpRequestProgID) {
			return new ActiveXObject(window.Ajax_XMLHttpRequestProgID);
		} else {
			var progIDs = ["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
			for (var i = 0; i < progIDs.length; ++i) {
				var progID = progIDs[i];
				try {
					var x = new ActiveXObject(progID);
					window.Ajax_XMLHttpRequestProgID = progID;
					return x;
				} catch (e) {
				}
			}
		}
	}
	return null;
}
function Ajax_CallBack(type, id, method, args, clientCallBack, debugRequestText, debugResponseText, debugErrors, includeControlValuesWithCallBack, url) {
	var x = Ajax_GetXMLHttpRequest();
	var result = null;
	if (!x) {
		result = { "value":null, "error": "NOXMLHTTP"};
		if (debugErrors) {
			alert("error: " + result.error);
		}
		if (clientCallBack) {
			clientCallBack(result);
		}
		return result;
	}

	x.open("POST", url, clientCallBack ? true : false);
	x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
	if (clientCallBack) {
		x.onreadystatechange = function() {
			var result = null;
		
			if (x.readyState != 4) {
				return;
			}
			
			if (debugResponseText) {
				alert(x.responseText);
			}
			
			try
			{
				var result = eval("(" + x.responseText + ")");
				if (debugErrors && result.error) {
					alert("error: " + result.error);
				}
			}
			catch (err)
			{
				if (window.confirm('The following error occured while processing an AJAX request: ' + err.message + '\n\nWould you like to see the response?'))
				{
					var w = window.open();
					w.document.open('text/plain');
					w.document.write(x.responseText);
					w.document.close();
				}
				
				result = new Object();
				result.error = 'An AJAX error occured.  The response is invalid.';
			}
			
			clientCallBack(result);			
		}
	}
	var encodedData = "Ajax_CallBackType=" + type;
	if (id) {
		encodedData += "&Ajax_CallBackID=" + id.split("$").join(":");
	}
	encodedData += "&Ajax_CallBackMethod=" + method;
	if (args) {
		for (var i in args) {
			encodedData += "&Ajax_CallBackArgument" + i + "=" + encodeURIComponent(args[i]);
		}
	}
	if (includeControlValuesWithCallBack && document.forms.length > 0) {
		var form = document.forms[0];
		for (var i = 0; i < form.length; ++i) {
			var element = form.elements[i];
			if (element.name) {
				var elementValue = null;
				if (element.nodeName == "INPUT") {
					var inputType = element.getAttribute("TYPE").toUpperCase();
					if (inputType == "TEXT" || inputType == "PASSWORD" || inputType == "HIDDEN") {
						elementValue = element.value;
					} else if (inputType == "CHECKBOX" || inputType == "RADIO") {
						if (element.checked) {
							elementValue = element.value;
						}
					}
				} else if (element.nodeName == "SELECT") {
					elementValue = element.value;
				} else if (element.nodeName == "TEXTAREA") {
					elementValue = element.value;
				}
				if (elementValue) {
					encodedData += "&" + element.name + "=" + encodeURIComponent(elementValue);
				}
			}
		}
	}
	if (debugRequestText) {
		alert(encodedData);
	}
	x.send(encodedData);
	if (!clientCallBack) {
		if (debugResponseText) {
			alert(x.responseText);
		}
		result = eval("(" + x.responseText + ")");
		if (debugErrors && result.error) {
			alert("error: " + result.error);
		}
	}
	delete x;
	return result;
}
//Ajax//

function ps_Browser()
{
	d=document;
	this.agt=navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.dom=(d.getElementById)?1:0;
	this.ns=(d.layers);
	this.ns4up=(this.ns && this.major >=4);
	this.ns6=(this.dom&&navigator.appName=="Netscape");
	this.op=(window.opera? 1:0);
	this.ie=(d.all);
	this.ie4=(d.all&&!this.dom)?1:0;
	this.ie4up=(this.ie && this.major >= 4);
	this.ie5=(d.all&&this.dom);
	this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1));
	this.mac=(this.agt.indexOf("mac")!=-1);
};

var oBw = new ps_Browser();
function displayMenu(what) 
{  
	var ele = null;
	if (document.getElementById)
	ele = document.getElementById(what);
	
	contextMenu.parent = what;
	contextMenu.style.leftPos+=10;  
	contextMenu.style.posLeft= ps_getPageX(ele);  
	contextMenu.style.posTop= ps_getPageY(ele)+6;  
	contextMenu.style.display="";  
	contextMenu.setCapture();
}
function clickMenu(what) 
{  
	contextMenu.releaseCapture();  
	contextMenu.style.display="none";  
	el=event.srcElement;
	
	if(el.id == 'a' || el.id == 'b' || el.id == 'c')
		Export(el.id+what);
}
function Export(what) 
{ 
//__doPostBack('EX',what); 
alert(what);
}

function switchMenu() 
{     
	el=event.srcElement;  
	if (el.className=="menuItem") 
	{    
		el.className="highlightItem";  
	} 
	else if (el.className=="highlightItem") 
	{    
		el.className="menuItem";  
	}
}
function ps_getPageX(o) { var x=0; if(oBw.ns) x=o.pageX; else { while(eval(o)) { x+=o.offsetLeft; o=o.offsetParent; } } return x; };
function ps_getPageY(o) { var y=0; if(oBw.ns) y=o.pageY; else { while(eval(o)) { y+=o.offsetTop; o=o.offsetParent; } } return y; };

var posx;
var posy; 

					function capmouse(e){ 
					posx = 0; posy = 0; 
					if (!e){var e = window.event;} 
					if (e.pageX || e.pageY){ 
						posx = e.pageX; 
						posy = e.pageY; 
					} 
					else {
						if (e.clientX || e.clientY){ 
						posx = e.clientX; 
						posy = e.clientY; 
						} 
					}
					}

					function showmenu(how,what)
					{
						document.getElementById(what).style.visibility = 'visible';
						if(how == 1)
						{
							document.getElementById(what).style.left = posx-3;
							document.getElementById(what).style.top = posy-3;
						}
					}
					function hidemenu(what)
					{
						document.getElementById(what).style.visibility = 'hidden';
					}
					function v(waht)
					{
						document.getElementById(waht).style.background = '#7AA2D9';
						document.getElementById(waht).style.color = '#ffffff';
					}
					function o(waht)
					{
						document.getElementById(waht).style.background = '#ffffff';
						document.getElementById(waht).style.color = '#000000';
					}
					function d(waht)
					{
						alert('click');
					}
								function GetDiv(what) 
			{
				var div = null;
				if (document.getElementById)
				div = document.getElementById(what);
				else if (document.all) 
				div = document.all[what];
				else if (document.layers)   
				div = document.layers[what];
				return div;
			}

					function showContent(what) 
			{ 
				var div = GetDiv(what);
				if(div == null) return;
				if(div.style.visibility == "hidden")
				{			
	 				div.style.visibility = "visible";
	 				div.style.position = "relative";
				}
			}
			function hideContent(what)
			{ 
				var div = GetDiv(what);
				if(div == null) return;
				if(div.style.visibility == "visible")
				{
	 				div.style.visibility = "hidden";
	 				div.style.position = "absolute";
				}
			}
