
//Global Variables--------------------------------------------------->
	var myWidth = 0;
	var myHeight = 0;
	
	var IE = document.all?true:false
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = getMouseXY;
		
	var posX = 0;
	var posY = 0;
	
	var loadState=0;
	
	var currTtp;
	var showTtp=false;
//Global Variables---------------------------------------------------|


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;
}

	

	function getMouseXY(e) 
	{
		if (IE) 
		{ 
		posX = event.clientX + document.body.scrollLeft
		posY = event.clientY + document.body.scrollTop
		} 
		else 
		{ 
		posX = e.pageX
		posY = e.pageY
		}  
		
		if (posX < 0){posX = 0}
		if (posY < 0){posY = 0} 				
		
		
		
		if(showTtp)
		{				
				currTtp.style.left=(posX)+"px";
				currTtp.style.top=(posY+22)+"px";
		}
		
		
		return true
	}










function commonFunctionsAfterLoad()
{
	currLdr.style.display="none";

}





//=================================================================For tooltip============================>

function createToolTip()
{
	currTtp=document.createElement('div');
	currTtp.id='asd';
	mttp_div=currTtp;	
		
	mttp_div.style.position='absolute';
	mttp_div.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';
	mttp_div.style.fontSize='10px';
	mttp_div.style.color='#FFFFFF';	
	mttp_div.style.zIndex='999999';
	mttp_div.style.border='1px dotted #666666';
	mttp_div.style.backgroundColor='#999999';
	mttp_div.style.padding='5px';
	document.body.appendChild(mttp_div);
	mttp_div.style.display="none";
}



function showToolTip(str)
{		
	showTtp=true;	
	str=str.replace('%nl%','<br/>');
	
	currTtp.innerHTML=str;		
	ttpfadeIn(currTtp.id,400);
}

function hideToolTip()
{
	showTtp=false;
	ttpfadeOut(currTtp.id,100);	
}



function ttpfadeOut(thisId,speed) 
{
 
	var obj = document.getElementById(thisId);
    //obj.style.zoom = 1; //needed for IE
    speed = speed/20;
    var i = 100;
    var intervalId = setInterval(function() {
		if(showTtp)	clearInterval(intervalId);										  
										  
        if(i>=0) 
		{
			obj.style.opacity = (i / 100);
			obj.style.MozOpacity = (i / 100);
			obj.styleKhtmlOpacity = (i / 100);
			obj.style.filter = "alpha(opacity=" + i + ")";			
			
			//document.getElementById('info').innerHTML=i;
            i -= 5;						
        } 
		else 
		{
            setTimeout(function() {obj.style.display = "none";}, speed);
            clearInterval(intervalId);			
            return false;
        }
    }, speed);
}

function ttpfadeIn(thisId,speed) 
{	

    var obj = document.getElementById(thisId);
    obj.style.display = "block";
    //obj.style.zoom = 1; //needed for IE
    obj.style.opacity = 0;
    obj.style.filter = "alpha(opacity = 0)";
    speed = speed/20;
    var i = 0;
    var intervalId = setInterval(function() 
	{
        if(i <= 100) 
		{
			obj.style.opacity = (i / 100);
			obj.style.MozOpacity = (i / 100);
			obj.styleKhtmlOpacity = (i / 100);
			obj.style.filter = "alpha(opacity=" + i + ")";
			//document.getElementById('info').innerHTML=i;
            i += 5;
        } 
		else {
			//setTimeout(function() {obj.style.display = "block";}, speed);
            clearInterval(intervalId);						
            return false;
        }
    }, speed);
}


//=================================================================For tooltip============================|











//======================================================Absolute Positioning of div======================>

function setDivToPosition(div_id,allign_x,allign_y,xfactor,yfactor)
{
	var mydiv=document.getElementById(div_id);
	
	mydiv.style.display='block';
	
	mydiv.style.position='absolute';
	divWidth=mydiv.offsetWidth;
	divHeight=mydiv.offsetHeight;
	
	
	
	if(allign_x=='left')mydiv.style.left=xfactor+'px';
	else if(allign_x=='right')mydiv.style.left=(myWidth-xfactor-divWidth)+'px';
	else if(allign_x=='middle')mydiv.style.left=((myWidth-divWidth)/2+xfactor)+'px';
	
	if(allign_y=='top')mydiv.style.top=yfactor+'px';
	else if(allign_y=='bottom')mydiv.style.top=(myHeight-yfactor-divHeight)+'px';
	else if(allign_y=='middle')mydiv.style.top=((myHeight-divHeight)/2-yfactor)+'px';
	
	
	
	//alert((myHeight-divHeight)/2-yfactor);
}

//======================================================Absolute Positioning of div======================|



//======================================================Create Animated Button======================>

function createAnimButton(divId, overColor, outColor)
{
	
	btn=document.getElementById(divId);
	
	//btn.onMouseOver=
	
}

//======================================================Create Animated Button======================|



//======================================================Fadein Fadeout Div================================>
function fadeOut(thisId,speed) 
{
 
	var obj = document.getElementById(thisId);
    //obj.style.zoom = 1; //needed for IE
    speed = speed/20;
    var i = 100;
    var intervalId = setInterval(function() {												  
										  
        if(i>=0) 
		{
			obj.style.opacity = (i / 100);
			obj.style.MozOpacity = (i / 100);
			obj.styleKhtmlOpacity = (i / 100);
			obj.style.filter = "alpha(opacity=" + i + ")";			
			
			//document.getElementById('info').innerHTML=i;
            i -= 5;						
        } 
		else 
		{
            setTimeout(function() {obj.style.display = "none";}, speed);
            clearInterval(intervalId);			
            return false;
        }
    }, speed);
}

function fadeIn(thisId,speed) 
{	

    var obj = document.getElementById(thisId);
    obj.style.display = "block";
    //obj.style.zoom = 1; //needed for IE
    obj.style.opacity = 0;
    obj.style.filter = "alpha(opacity = 0)";
    speed = speed/20;
    var i = 0;
    var intervalId = setInterval(function() 
	{
        if(i <= 100) 
		{
			obj.style.opacity = (i / 100);
			obj.style.MozOpacity = (i / 100);
			obj.styleKhtmlOpacity = (i / 100);
			obj.style.filter = "alpha(opacity=" + i + ")";
			//document.getElementById('info').innerHTML=i;
            i += 5;
        } 
		else {
			//setTimeout(function() {obj.style.display = "block";}, speed);
            clearInterval(intervalId);						
            return false;
        }
    }, speed);
}

//======================================================Fadein Fadeout Div================================|



function clearBox(val,obj){if(obj.value==val){obj.select();}else chkBlank(val,obj);}
function chkBlank(val,obj){if(obj.value=='')obj.value=val;}
function mkPasswordField(val,obj){obj.type='password';}
function onstartSelect(divid){document.getElementById(divid).select();}



function createLoader(container,str)
{		
	currLdr=document.createElement('div');
	currLdr.id='pageloader';	
		
	currLdr.style.position='absolute';
	currLdr.align='center';
	currLdr.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';
	currLdr.style.fontSize='11px';
	currLdr.style.fontWeight='bold';
	currLdr.style.color='#999999';	
	currLdr.style.zIndex='999999';
	currLdr.style.border='1px solid #999999';
	currLdr.style.backgroundColor='#666666';
	currLdr.style.padding='5px';
	document.getElementById(container).appendChild(currLdr);
	
	
	currLdr.innerHTML='<strong>'+str+'</strong>';
	currLdr.style.width=currLdr.offsetWidth+'px';
	currLdr.innerHTML=str;
	/*currLdr.style.display="none";*/
	setDivToPosition('pageloader','middle','middle',0,0);
	showLoader();
}

function showLoader()
{
	str=currLdr.innerHTML;
	strlen=str.length;
	view_str='';
	curpos=0;
	var ldrintervalId = setInterval(function() 
	{
		curpos++;
		
		if(curpos>=strlen){curpos=0;view_str='';}
		pre_str=str.slice(0,curpos);
		post_str=str.slice(curpos+1,strlen);
		view_str=pre_str+'<font color="#CCCCCC">'+str.charAt(curpos)+'</font>'+post_str+'<br/><span style="font-size:8px;color:#333333;">PLEASE BE PATIENT WHILE LOADING</span>';
		
		currLdr.innerHTML=view_str;
	},100);
}





