function GetXmlHttpObject()
{   
	 if(window.ActiveXObject)
		return new ActiveXObject("Microsoft.XMLHTTP");	
	else if(window.XMLHttpRequest)
		{
			d=document;
			return new XMLHttpRequest();
		}	 
	else
		return null;
}

function GetXmlHttp()
	{
		var oXmlHttp=false;
		/*@cc_on @*/
		/*@if (@_jscript_version >= 5)
		// JScript gives us Conditional compilation, we can cope with old IE versions.
		// and security blocked creation of the objects.*/
		try {
			oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		try {
			oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			oXmlHttp = false;
		}
		}
		/*@end @*/
	
		if (!oXmlHttp && typeof XMLHttpRequest!='undefined') 
		{
			oXmlHttp = new XMLHttpRequest();
		}
		
		return oXmlHttp;
	}	
function GetXMLTagValue(xmlobj,tagname)
{  
    if(tagname=='') return '';
    if(xmlobj.getElementsByTagName(tagname).length>0)
    {
        if(xmlobj.getElementsByTagName(tagname)[0].firstChild)
            return xmlobj.getElementsByTagName(tagname)[0].firstChild.nodeValue;
    }
    return '';
}
function getKeyCode(evt)
{
	if (evt) 
		return evt.keyCode ;
	else  
		return event.keyCode;		
}
function getDate(DateId,txtId)
{
	var date=document.getElementById(DateId).innerHTML;
	date=date.replace('[',"");
	date=date.replace(']',"");
	document.getElementById(txtId).value=date;
	return false;
}
function launchCenter(url, name, width, height, scrollbar) {
	if (width==0){width=screen.width-10};
	if (height==0){height=screen.height-30};
	
	var str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width;
	
	if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		var xc = (aw - width);
		var yc = (ah - height);
		var xc = (aw - width)/2;
		var yc = (ah - height)/2;
		
		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
		str += ",hotkeys=0,menubar=0,resizable=1,scrollbars=" + scrollbar + ",status=0";
	}
	return window.open(url, name, str);
}

/*************************************************************************************************
Usuage:
var fadewinobj= new FadeWin();
fadewinobj.fadeobj=document.getElementById('Div tag name');

fadewinobj.fadepoint  : this is optional value with in the range of (0 - 100)
fadewinobj.fadespeed  : this is optional value with in the range of (1 - 100) Note : do not give 0, object wont be visible at all

Recommeded:
	please specify the width and height of the div
-------------------
**************************************************************************************************/
function FadeWin()
{
	this.fadeobj=null;
	this.fadepoint=0;
	this.fadespeed=10;
	this.fadeopen=function()
	{	
	
	   
		if(this.fadeobj!=null)
		{
			if(this.fadeobj.style.height=='')
				this.fadeobj.style.height='100%'
			if(this.fadeobj.style.width=='')
				this.fadeobj.style.width='100%'
			this.fadepoint+=this.fadespeed;
			try
			{
			    this.fadeobj.style.MozOpacity=this.fadepoint/100;
			}
			catch(e){}
			try
			{
			    this.fadeobj.style.filter = "alpha(opacity=" +this.fadepoint+ ")";
			}
			catch(e){}
			if(this.fadeobj.style.display=='none')
				this.fadeobj.style.display='block'				
			if(this.fadeobj.style.visibility=='hidden')
				this.fadeobj.style.visibility='visible'	
				 //alert(this.fadeobj.style.visibility)			
			if(this.fadepoint>=100) return false;
			
			var pThis = this;
			
			var f = function(){pThis.fadeopen();}
			this.timerID = window.setTimeout(f,100);
		}
	}
	
}			

/*************************************************************************************************
Usuage:
var CrossOpenobj= new CrossOpen();
CrossOpenobj.fadeobj=document.getElementById('Div tag name');

fadewinobj.startpoint  : this is optional value with in the range of (0 - 100)
fadewinobj.speed  : this is optional value with in the range of (1 - 100) Note : do not give 0, object wont be visible at all

-------------------
**************************************************************************************************/
function CrossOpen()
			{
				this.Object=null;
				this.startpoint=0;
				this.fadespeed=8;
				this.ObjectMaxHeight=96;
				this.ObjectMaxWidth=96;
				
				this.crossOpen=function()
				{	
					if(this.Object!=null)
					{					
						this.startpoint+=this.fadespeed;
						try
						{
							this.Object.style.width=this.startpoint+'%';
							this.Object.style.height=this.startpoint+'%';
						}
						catch(e){}
						
						if(this.Object.style.display=='none')
							this.Object.style.display='block'				
						if(this.Object.style.visibility=='hidden')
							this.Object.style.visibility='visible'				
						if(this.startpoint>=this.ObjectMaxHeight) return false;
						
						var pThis = this;
						var f = function(){pThis.crossOpen();}
						this.timerID = window.setTimeout(f,1);
					}
				}
				
			}
		
		
 /*******************************************Context Menu ************************************************/
 
 	function showLoading(bool,refobject)
	{ 
	    if(bool)
	    { 
	        
	        if(refobject)
	        {
	            if(refobject.style.position=='absolute')
	            {
	                document.getElementById('_Loadingdiv').style.left=refobject.style.left;
	                document.getElementById('_Loadingdiv').style.top=refobject.style.top;
	            }
	            else
	            {
	                document.getElementById('_Loadingdiv').style.left=findPosX(refobject);
	                document.getElementById('_Loadingdiv').style.top=findPosY(refobject);
	            }
	        }
	        document.getElementById('_Loadingdiv').style.display='inline';	        
	    }
	    else
	        document.getElementById('_Loadingdiv').style.display='none';
	    
	}
	
	
	
	
	
	
