﻿var UnicodeString = ' !"#$٪،گ)(٭+و-./۰۱۲۳۴۵۶۷۸۹:ك,=.؟@ِذ}ىُىلآ÷ـ،/’د×؛َءٍف‘{ًْإ~جژچ^_پشذزيثبلاهتنمئدخحضقسفعرصطغظ<|>ّ';
var farsiKey = [
0x0020, 0x0021, 0x061B, 0x066B, 0x00A4, 0x066A, 0x060C, 0x06AF,
0x0029, 0x0028, 0x002A, 0x002B, 0x0648, 0x002D, 0x002E, 0x002F,
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
0x0038, 0x0039, 0x003A, 0x0643, 0x003E, 0x003D, 0x003C, 0x061F,
0x066C, 0x0624, 0x200C, 0x0698, 0x0649, 0x064D, 0x0625, 0x0623,
0x0622, 0x0651, 0x0629, 0x00BB, 0x00AB, 0x0621, 0x004E, 0x005D,
0x005B, 0x0652, 0x064B, 0x0626, 0x064F, 0x064E, 0x0056, 0x064C,
0x0058, 0x0650, 0x0643, 0x062C, 0x067E, 0x0686, 0x00D7, 0x0640,
0x200D, 0x0634, 0x0630, 0x0632, 0x064A, 0x062B, 0x0628, 0x0644,
0x0627, 0x0647, 0x062A, 0x0646, 0x0645, 0x067E, 0x062F, 0x062E,
0x062D, 0x0636, 0x0642, 0x0633, 0x0641, 0x0639, 0x0631, 0x0635,
0x0637, 0x063A, 0x0638, 0x007D, 0x007C, 0x007B, 0x007E ];
   
addEvent( document, "keydown", CheckKeyDown);
addEvent( document, "mouseover", CheckHrefStatus);
//---------- Adding an Event to an object: ----------------------------------
function addEvent(elm, evType, fn, useCapture)
{
    var ret = 0;

    if (elm.addEventListener) //IE
        ret = elm.addEventListener(evType, fn, useCapture);
    else if (elm.attachEvent) //Ns
        ret = elm.attachEvent('on'+evType , fn);
    else
        elm['on'+evType] = fn;
    return ret;
}
//---------- Removing an Event from an object: ----------------------------------
function removeEvent(target,type,func,bubbles) 
{
 if (document.removeEventListener) {     target.removeEventListener(type,func,bubbles);    } 
 else if (document.detachEvent) {     target.detachEvent("on"+type,func,bubbles);    } 
 else {     target["on"+type] = null;    }
}
//---------- change window status when mouse is over 'a' TAG: ----------------------------------
var asd;
function CheckHrefStatus(evt)
{
    var e = evt || event;
    var obj = (window.event)? event.srcElement : e.target;
    if(obj==null || obj.tagName==null)
    {
        window.status='';
        return;
    }
    if(obj.tagName=='A')
    {
	    window.status='javascript: void(0)';
	    //asd = setTimeout("window.status='java-script: void(0)';",1);
	}
    else
    {
        clearTimeout(asd);
        ClearStatus();
        return;
    }
}
//---------- if ENTER pressed, change to TAB event: ----------------------------------
function CheckKeyDown(evt)
{   
    var e = evt || event;
    var key = (window.event)? event.keyCode : e.which;
    var obj = (window.event)? event.srcElement : e.target;
    
    if(key==13)
        if (!(obj.type == 'image' || obj.type == 'button' || obj.type == 'submit' || obj.type == 'textarea' || document.activeElement.nodeName == 'A'))
        {
            if(window.ActiveXObject)  // IE
                window.event.keyCode = 9;
            else
            {
                var elmArr = document.forms[0].elements;
                for(var i=0;i<elmArr.length;i++)
                {
                    var nextEl = (i==elmArr.length-1) ? 0 : i+1; // if last element : if any other
                    if(obj==elmArr[i])
                    {
                        elmArr[nextEl].focus();
                        break;
                    }
                }
                
                if (e.cancelable) // Chr
		            e.preventDefault();
		        else if (e.stopPropagation) // FF
		        {
		            e.preventDefault();
                    e.stopPropagation();
                }
                else if (e.cancelBubble) // Op
                {
                    e.cancelBubble = true;
                    e.returnValue  = false;
                }
            }
            
            /*
            try 
            { 
                window.event.keyCode = 9; // IE
                if (e.cancelable) // Chr
		        {
		            e.preventDefault();
		            switchAmongElements(obj)
		            var elmArr = document.forms[0].elements;
                    for(var i=0;i<elmArr.length;i++)
                    {
                        var nextEl = (i==elmArr.length-1) ? 0 : i+1; // if last element : if any other
                        if(obj==elmArr[i])
                        {
                            elmArr[nextEl].focus();
                            break;
                        }
                    }
		        }
            }
            catch(er)
            {
                try // FF
                {
                    e.preventDefault();
                    e.stopPropagation();
                }
                catch(err) // Op
                {
                    e.cancelBubble = true;
                    e.returnValue  = false;
                }
                //switchAmongElements(obj);
                var elmArr = document.forms[0].elements;
                for(var i=0;i<elmArr.length;i++)
                {
                    var nextEl = (i==elmArr.length-1) ? 0 : i+1; // if last element : if any other
                    if(obj==elmArr[i])
                    {
                        elmArr[nextEl].focus();
                        break;
                    }
                }
            } // End Catch(er)
            */
        }
}
function switchAmongElements(obj)
{
    //---
}
//---------- Make [or Abort] an Ajax object: ----------------------------------
var HttpRequest=null;
function GetXmlHttpObject()
{
    if (HttpRequest==null)
    {
        if(window.ActiveXObject)
        {
            HttpRequest=new ActiveXObject("Msxml2.XMLHTTP");
            HttpRequest||(HttpRequest=new ActiveXObject("Microsoft.XMLHTTP"))
        }
        else if(window.XMLHttpRequest)
            HttpRequest=new XMLHttpRequest;
    }
    
    else if(HttpRequest.readyState!= 0) {
        HttpRequest.abort();
    }
    return HttpRequest;
    
}
//------------------------------------------------------------------------------------------------------
function ajaxCheckForDuplicateValue(TableName, FieldName, FieldValue, CurrentRecordID)
{  
	var xmlHttp = GetXmlHttpObject();
	var url = "../AjaxModules/ControlFieldValue.aspx?TableName="+TableName+"&FieldName="+FieldName+"&FieldValue="+escape(FieldValue)+"&CurrentRecordID="+CurrentRecordID;
	xmlHttp.open("GET", url, true);
    xmlHttp.onreadystatechange = function() 
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200) 
		{
			if(xmlHttp.responseText=="Y")
			    alert('داده وارد شده تکراری است');
		}
	}
	xmlHttp.send(null);
}
//------------------------------------------------------------------------------------------------------
function ajaxUpdateModuleHeight(ModuleID, NewHeight)
{  
	var xmlHttp = GetXmlHttpObject();
	
	var url = "../AjaxModules/UpdateModuleHeight.aspx?ModuleID="+ModuleID+"&NewHeight="+NewHeight;
	xmlHttp.open("GET", url, true);
    xmlHttp.onreadystatechange = function() 
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200) 
		{
			//if(ModuleID==17)
				//alert(url);
		}
	}
	xmlHttp.send(null);
}
//------------------------------------------------------------------------------------------------------
function ajaxUpdateTableHeight(TableID)
{  
	NewHeight = document.body.scrollHeight;
	var xmlHttp = GetXmlHttpObject();
	var url = "../Modules/UpdateModuleHeight.aspx?ModuleID="+TableID+"&NewHeight="+NewHeight+"&TableName=1";
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function() 
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200) 
		{
			//if(ModuleID==17)
			//	alert(NewHeight);
		}
	}
	xmlHttp.send(null);
}
//------------------------------------------------------------------------------------------------------
function ResizeIFrame()
{
    if (!window.parent
        || window.parent.location.toString().toLowerCase().indexOf('adminpanel.aspx') != -1
        || window.parent.location.toString().toLowerCase().indexOf('adminpanel_new.aspx') != -1)
	    return;
	try
	{
        ifobj = window.frameElement;
	    if (ifobj) // iframe object exists
	    {
		    if (document.body.scrollHeight <= 5)
		    {
			    ifobj.style.height="10px";
			    //ifobj.height="10px";
			}
		    else
		    {
		        ifobj.style.height = document.body.scrollHeight+"px";
			    ifobj.height = document.body.scrollHeight;
			}
		    if (document.body.scrollWidth > 5)
		    {
		    	//alert(document.body.scrollWidth);
			    ifobj.style.width = document.body.scrollWidth+"px";
			    ifobj.width = document.body.scrollWidth;
			}
		    else	
		    { //ifobj.width=200;
		    }
	    }
	}
	catch(ex)
	{  }
	setTimeout("ResizeIFrame()", 2500);
}

function ResizeHeightIFrame()
{
		try
		{
		    if (window.parent) // has parent
		    {
			    ifobj = window.frameElement;
			    if (ifobj) // iframe object exists
			    {
				    if (document.body.scrollHeight <= 5)
				    {
					    ifobj.style.height="10px";
					    //ifobj.height="10px";
					}
				    else if(document.body.scrollHeight<400)
				    {
				        ifobj.style.height = document.body.scrollHeight+"px";
					    ifobj.height = document.body.scrollHeight;
					}
					else
					{
					    ifobj.style.height=400;
					}
			    }
		    }
		}
		catch(ex)
		{  }
		setTimeout("ResizeHeightIFrame()", 1000);
}

//------------------------------------------------------------------------------------------------------
function CheckParentIframe()
{
	try
	{
		var path1 = parent.location.href;
		var path2 = location.href;
		if(path1.substring(0, path1.indexOf('/Modules/',0)+9)!=path2.substring(0, path2.indexOf('/Modules/',0)+9))
		{
			alert('اين ماژول از روی سایت دیگری استفاده شده است');
		}
	}
	catch(err)
	{ 
		alert('اين ماژول از روی سایت دیگری استفاده شده است');
	}
}
//------------------------------------------------------------------------------------------------------
function CheckUnicode(e) {
return true;
    var key = window.event ? event.keyCode : e.which ;
	if (e.ctrlKey || e.altKey || e.metaKey || key < 32) return true;
	if(key > 47 && key < 58) return true; // [47~58]
	
	if(key >= 128)
	{
		alert("تغيير دهيد EN لطفا زبان صفحه کليد را به");
		return false;
	}
	// Shift-space -> ZWNJ
	if (key == 32 && e.shiftKey)
		newValue = 8204;
	else
	    newValue = UnicodeString.charCodeAt(key-32);
	
	if(editor.lang.toLowerCase()=="fa")
	{
	    if(window.ActiveXObject)	
		    window.event.keyCode = UnicodeString.charCodeAt(key-32); // IE
		else
		{
		    var selectionStart = editor.selectionStart;
		    var selectionEnd = editor.selectionEnd;
		    
		    editor.value = editor.value.substring(0, selectionStart) + String.fromCharCode(newValue) + editor.value.substring(selectionEnd);
		    
		    editor.focus();
		    //editor.setSelectionRange(selectionStart, selectionStart);
		    
			if (e.cancelable) // Chr
		    {
		        e.preventDefault();
		    }
		    else
		    {
		        try // FF
                {
                    e.preventDefault();
                    e.stopPropagation();
		        }
		        catch(err) // Op
                {
                    e.cancelBubble = true;
                    e.returnValue  = false;
		        }
		    }
		}
	}
	return true;
}
/*
		try 
		{
		    window.event.keyCode = UnicodeString.charCodeAt(key-32); // IE
		    if (e.cancelable) // Chr
		    {
		        e.preventDefault();
		        t=UnicodeString.charCodeAt(key-32)
		        editor.value+=String.fromCharCode(t);
		    }
		}
        catch(er)
        {
            try // FF
            {
                e.preventDefault();
                e.stopPropagation();
                t=UnicodeString.charCodeAt(key-32)
		        editor.value+=String.fromCharCode(t);
            }
            catch(err) // Op
            {
                e.cancelBubble = true;
                e.returnValue  = false;
                t=UnicodeString.charCodeAt(key-32)
		        editor.value+=String.fromCharCode(t);
            }
        }
	}
	return true;
}
*/
//-----------------------------------------------------------------------
function KeyDown(evt)
{
	var e = evt || event;
	
	if(e.shiftKey && e.ctrlKey)
	{
		editor = e.srcElement ? e.srcElement : e.target;
		if(editor.lang.toLowerCase() == "fa")
			editor.lang = "En";
		else
			editor.lang = "Fa";
		return false;
	}
}
//------------------------------------------------------------------------
function KeyUp(e)
{ 
	var key = window.event ? event.keyCode : e.which;
	if(key == 13)
		return;
	editor = window.event ? event.srcElement : e.target;
    str = editor.value;
    
    if(str.charAt(str.length-1)=="\n")
		if(editor.lang.toLowerCase()=="fa") editor.dir = "rtl";
		else editor.dir = "ltr";
	else if(str == "")
		if(editor.lang.toLowerCase()=="fa") editor.dir = "rtl";
		else editor.dir = "ltr";
}
//------------------------------------------------------------------------
function ShowLangStatus(e)
{
	editor = window.event ? event.srcElement : e.target;
	str = "زبان جاري : "
	if(editor.lang.toLowerCase()=="fa")
		str += "فارسي";
	else
		str += "انگليسي";
	window.status = str;
}
//------------------------------------------------------------------------
function ClearStatus()
{
	window.status='';
}

function Expand(ElementId)
{
  var elemSrc = document.getElementById(ElementId + "_i");
  var elemTR = document.getElementById(ElementId + "_tr");
  elemSrc.Expanded='false';
  elemSrc.src='../ImageGallery/SystemFiles/Images/Expand.gif';
  elemTR.style.display = 'none';
}
//------------------------------------------------------------------------
function Collaps(ElementId)
{
  var elemSrc = document.getElementById(ElementId + "_i");
  var elemTR = document.getElementById(ElementId + "_tr");
  elemSrc.Expanded='true';
  elemSrc.src='../ImageGallery/SystemFiles/Images/Collap.gif';
  elemTR.style.display = '';
}
//------------------------------------------------------------------------
function ExpandThisDiv(ElementId)
{
	var elemSrc = document.getElementById(ElementId + "_i");
	if (elemSrc == null) 
		return;
	if (elemSrc.Expanded=='true')
	{
		CookieSet(ElementId, "false");
		Expand(ElementId);
	}
	else
	{
		CookieSet(ElementId, "true");
		Collaps(ElementId);
	}
}
//------------------------------------------------------------------------
function ReadCookie(nameoftable)
{
	var expire = 8;
	if(GetCookie (nameoftable) == '')
	{
		var expDate = new Date();
		expDate.setTime( expDate.getTime() + (expire != 0 ? expire : 0 ) );
		document.cookie = nameoftable + "=" + escape( "false" ) + ( expire ? "; expires=" + expDate.toGMTString() + ";":	"") ;
	}
	if(GetCookie(nameoftable)!="true")
	{
		Expand(nameoftable);
	}
	else
	{
		Collaps(nameoftable);
	}
}
//------------------------------------------------------------------------
function getCookieVal (offset) 
{  
	var endstr = document.cookie.indexOf (";", offset);  

	if (endstr == -1)    
		endstr = document.cookie.length;  
	return unescape(document.cookie.substring(offset, endstr));
}
//------------------------------------------------------------------------
function GetCookie (name) 
{  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) 
	{    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
			return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	} 
	return '';
}
//------------------------------------------------------------------------
function CookieSet( name, value, expire)
{
      if( document.cookie.length > 4000 )
            window.alert( "Your cookie is getting close to 4k");
    var expDate = new Date();
    expDate.setTime( expDate.getTime() + (expire != 0 ? expire : 0 ) );
    document.cookie = name + "=" + escape( value ) + ( expire ? "; expires=" + expDate.toGMTString() + ";": "") ;
}
//------------------------------------------------------------------------
var popUpWin=null;
function popUpWindow(URLStr, Title, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed)
		popUpWin.close();
  }
  popUpWin = open(URLStr, Title, 'scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
//--------------------------------------------------------------------------------
function checkIt(e)
{
    var Key_A = 65;
    var Key_S = 83;
    var Key_D = 68;
    var Key_Z = 90;
    var Key_X = 88;
    var Key_C = 67;
    var Key_H = 72;
    var Key_N = 78;
    var Key_V = 86;

	var ChCode = (window.event) ? event.keyCode : e.which;
	if (editor.lang.toLowerCase()=="fa")
	{
		if (ChCode == Key_A || ChCode == Key_S || ChCode == Key_D || ChCode == Key_Z || ChCode == Key_X || ChCode == Key_C)
		{
			if(window.event)
			{
			    window.event.keyCode = Key_Nothing;
			    return true;
			}
			else
			    e.preventDefault();
		}
		if (ChCode == Key_H || ChCode == Key_N || ChCode == Key_V)
			return true;
		if (ChCode > 64 && ChCode < 91 )
		{
			if(window.event)
			{
			    window.event.keyCode = Key_Nothing;
			    alert("لطفا حروف بدون Shift و يا CapsLock وارد نمائيد");
			    return false;
			}
			else
			    e.preventDefault();
		}
		status = "";
	}
	return true;
}
//--------------------------------------------------------------------------------
function EditorCheckUnicode(e)
{
return true;
	//var key = mce_editor_0.event.keyCode;
	var key = window.event ? event.keyCode : e.which;
	if(key > 47 && key < 58) return true;
	if(key < 32)return true;
	if(key >= 128)
	{
		alert("تغيير دهيد EN لطفا زبان صفحه کليد را به");
		return false;
	}
	if(editor.lang.toLowerCase()=="fa")
	{
		if(window.event)
		    window.event.keyCode = UnicodeString.charCodeAt(key-32);
		else
		{
		    e.preventDefault();
		    t=UnicodeString.charCodeAt(key-32)
		    editor.value+=String.fromCharCode(t);
		}
		return true;
	}
	return true;
}
//-------------------------------------------------------------------------------
function EditorKeyDown(evt)
{
	var e = window.event ? window.event : evt;
	if(e.shiftKey && e.ctrlKey)
	{
		editor = (window.event) ? event.srcElement : e.target;
		if(editor.lang.toLowerCase() == "fa")
			editor.lang = "En";
		else
			editor.lang = "Fa";
		return false;
	}
}
//--------------------------------------------------------------------------------
function EditorKeyUp(e)
{ 
	var key = window.event ? event.keyCode : e.which;
	if(key == 13)
		return;
	editor = window.event ? event.srcElement : e.target;
    str = editor.value;
    if(str.charAt(str.length-1)=="\n")
		if(editor.lang.toLowerCase()=="fa") editor.dir = "rtl";
		else editor.dir = "ltr";
	else if(str == "")
		if(editor.lang.toString().toLwer()=="fa") editor.dir = "rtl";
		else editor.dir = "ltr";
}
//--------------------------------------------------------------------------------
function EditorShowLangStatus(e)
{
	editor = window.event ? event.srcElement : e.target;
	str = "زبان جاري : "
	if(editor.lang.toLowerCase()=="fa")
		str += "فارسي";
	else
		str += "انگليسي";
	window.status = str;
}
//--------------------------------------------------------------------------------
function EditorClearStatus()
{
	window.status='';
}
//--------------------------------------------------------------------------------
document.getElementsByAttributeValue = function(attrValue) 
{
	var all = document.getElementsByTagName("*");
	var elem = new Array();
	var i=0;
	while(all[i]) 
	{
		if(arguments[1]) 
		{
			attrName = arguments[1];
			if(all[i].hasAttribute) 
			{
				if(all[i].hasAttribute(attrName)) 
				    if(all[i].getAttribute(attrName) == attrValue) 
				        elem[elem.length] = all[i];
			}
			else 
			{
				if(all[i].tagName != "!") 
				    if (all[i].getAttribute(arguments[1], 0) == attrValue)
				        elem[elem.length] = all[i];
			}
		}
		else 
		{
			for(j=0;j<all[i].attributes.length;j++)
			 	if(all[i].tagName != "!") 
			 	    if(all[i].attributes[j].value == attrValue) 
			 	        elem[elem.length] = all[i];	
		}
		i++;
	} // End While
	return elem;
}
//--------------------------------------------------------------------------------
String.prototype.trim = function () {
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}
String.prototype.getText = function () {
    return this.replace(/<(?:.|\s)*?>/g, "");
};
//--------------------------------------------------------------------------------
function GetEnglishDigit(Number)
{
    Number=Number+'';
	farsiDigit = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
	englishDigit = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
	
	for(i=0; i<10; i++)
	    for(j=0; j<Number.length; j++)
	        Number=Number.replace(farsiDigit[i],englishDigit[i])
	return Number;
	//return parseInt(Number);
}
//--------------------------------------------------------------------------------
function GetFarsiDigit(Number)
{
    Number=Number+'';
	farsiDigit = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
	englishDigit = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
	for(i=0; i<10; i++)
	    for(j=0; j<Number.length; j++)
	        Number=Number.replace(englishDigit[i],farsiDigit[i])
	return Number;
	//return parseInt(Number);
}
//--------------------------------------------------------------------------------
function setStyle(obj,str) 
{
	if(document.all && !window.opera) 
	{
		obj.style.setAttribute("cssText",str);
	} 
	else 
	{
		obj.setAttribute("style",str);
	}
}
//Added By Sabeghi FCK function
//--------------------------------------------------------------------------------
function clearFCKValue(fckName)
{
    setFCKValue(fckName,'',true);
}
//---------------------------------------------------
function setFCKValue(fckName,HtmlValue,replace)
{
    try
    {
        var inst = FCKeditorAPI.GetInstance(fckName);
        if(replace)
            inst.SetData(HtmlValue);
        else
            inst.InsertHtml(HtmlValue);
    }
    catch(e)
    {
        setTimeout("setFCKValue('"+fckName+"','"+HtmlValue+"',"+replace+")",200);
    }
}
//---------------------------------------------------
function getFCKValue(fckName)
{
    var inst = FCKeditorAPI.GetInstance(fckName);
    return inst.GetHTML();
}
//---------------------------------------------------
function openWin(strURL,width,height,top,left)
{
    iwidth=200;
    iheight=150;
    
    if(width==null)
        width = parseInt(screen.availWidth)-iwidth;
    
    if(height==null)
        height = parseInt(screen.availHeight)-iheight;
    
    if(left==null)
        left = parseInt(parseInt(screen.availWidth)/2 - width/2);
        
    if(top==null)
        top = parseInt(parseInt(screen.availHeight)/2 - height/2)-10;
    
    return window.open(strURL, '', 'scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=yes,resizable=yes,copyhistory=no,width='+ width +',height='+ height +',left='+ left +', top='+ top);
}

function getScreenSize() 
{
    var myWidth = 0;
    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        myWidth = window.innerWidth;

    } else if (document.documentElement && (document.documentElement.clientWidth)) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;

    } else if (document.body && (document.body.clientWidth)) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;

    }
    return myWidth;


}


function RefreshList(TableName, FieldName, SelectedValue)
{
	var xmlHttp = GetXmlHttpObject();
	var url = "../AjaxModules/AjaxGetListItems.aspx?SelectedTableName="+TableName+"&SelectedFieldName="+FieldName+"&SelectedValue="+SelectedValue;
	xmlHttp.open("GET", url, true);
    xmlHttp.onreadystatechange = function() 
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200) 
		{
			document.getElementById("SPAN_"+TableName+"_"+FieldName).innerHTML=xmlHttp.responseText;
		}
	}
	xmlHttp.send(null);
}
