    var mousex=0;
    var mousey=0;
    var ie;
	var shoutdivids;
	var shoutdivcount=0;


	
	
	if(window.navigator.appName!='Microsoft Internet Explorer'){
		document.captureEvents(Event.MOUSEMOVE);
		//document.onmousemove=getMousepoints;
		ie=false;
	}else{
		ie=true;
	}
	
	
	
	
    function getMousepoints(evnt)
       {
       	
		  //if(shoutdivcount>0&&evnt.target.id==shoutdivids[0]){
			//shoutvisible=true;  
		 // }
		   var i=0;
		 
		   if(ie){
			    mousex=window.event.clientX+window.document.body.scrollLeft;
                mousey=window.event.clientY+window.document.body.scrollTop;
		
		   }else if(evnt!=null){
			   
			   mousex=evnt.clientX+document.body.scrollLeft;
               mousey=evnt.clientY+document.body.scrollTop;
			 					  
		   }
		  
			//if(shoutvisible){
				
			   for(i=0;i<shoutdivcount;i++){
				   if(!ie){
					   if(evnt.target.id==shoutdivids[i]){
						   break;
					   }
				   }else{
					   if(window.event.toElement){
						   if(window.event.toElement.id==shoutdivids[i]){
							   break;
						   }
					   }
				   }
				   if(i==shoutdivcount-1){
					
					
				        gebi(shoutdivids[shoutdivcount-1]).removeChild(gebi(shoutdivids[0]));
        				shoutdivcount=0;
				 
			        }
			   }
			//}
		  
           
           return true;        
       }
	   
	 

function checkall(objForm){
    len = objForm.elements.length;
    var i=0;
    for( i=0 ; i<len ; i++) {
        if (objForm.elements[i].type=='checkbox') {
            objForm.elements[i].checked=objForm.check_all.checked;
        }
    }
}

function clearText(textfield, defText)
{
    if(textfield.value==defText){
        textfield.value = "";
    }
}

function setText(textfield, defText)
{
    if(textfield.value=="") {
        if(textfield.value=="") {
            textfield.value = defText;
        }
    }
}

function createCookie(name,value,days)
{
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    } else {
        var expires = "";
    }
    document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') {
            c = c.substring(1,c.length);
        }
        if (c.indexOf(nameEQ) == 0) {
            return c.substring(nameEQ.length,c.length);
        }
    }
    return null;
}

function eraseCookie(name)
{
    createCookie(name,"",-1);
}

function limitText(limitField, limitCount, limitNum) {
    if (limitField.value.length > limitNum) {
        limitField.value = limitField.value.substring(0, limitNum);
    } else {
        document.getElementById(limitCount).innerText = limitNum - limitField.value.length;
    }
}

function canSubmitAfterValidate(obj)
{
 var msg=getValidateMsg(obj);
 if(msg)
 {
  alert("message: "+msg);
  return false;
 }
 return true;
}

function setVisibilityObject(obj,isShow)
{
    if(isShow)
    {
     obj.style.visibility='visible';
     obj.style.position='relative';
    }
    else
    {
     obj.style.visibility='hidden';
     obj.style.position='absolute';
    }
}

function visibilityObject(obj,isShow)
{
 if(!obj) return;
// visibilityTR(obj,isShow);
// return;
 var i;
 if(obj.id!=null)
 {
  if(obj.getAttribute('showhide'))
   setVisibilityObject(obj,isShow);
 }
 if((obj.childNodes)&&(obj.childNodes.length))
  {
   for(i=0;i<obj.childNodes.length;i++)
    visibilityObject(obj.childNodes.item(i),isShow);
  }
}

function getValidateMsg(obj)
{
 var i;
 var res="";
 var value="ANYTHING";
 if(obj.id!=null)
 {
  if(obj.getAttribute('emsg'))
   {
    if(obj.tagName=='INPUT')
    {
     value=obj.value;
    }
    else
    if(obj.tagName=='TEXTAREA')
    {
     value=obj.value;
    }
    else
    if(obj.tagName=='SELECT')
    {
     if(obj.selectedIndex==-1)
     {
      value="";
     }
     else
     {
       if(!obj.options.item(obj.selectedIndex).value.length)
       {
        value="";
       } 
     } 
    }
    if(!value) return obj.getAttribute('emsg')+"\r\n";
   }
  if(obj.getAttribute('edateFrom'))
  {
   var objFrom=gebi(obj.getAttribute('edateFrom'));
   if((objFrom.value)&&(obj.value))
    if(Date.parse(obj.value)<Date.parse(objFrom.value))
     return obj.getAttribute('edateFromMsg');
  }
 }
 if((obj.childNodes)&&(obj.childNodes.length))
  {
   for(i=0;i<obj.childNodes.length;i++)
    res+=getValidateMsg(obj.childNodes.item(i));
  }
/*  else
 if((obj.all)&&(obj.all.length))
  {
   for(i=0;i<obj.all.length;i++)
    res+=getValidateMsg(obj.item(i));
  }*/
 return res;
}
function gebi(obj)
{
  return document.getElementById(obj);
}
function getXY(el)
{
	var left = 0, top = 0;
 	do 
 	{
		left += el.offsetLeft || 0;
		top += el.offsetTop || 0;
		el = el.offsetParent;
 	} 
  while (el);
	return {'x': left, 'y': top};
}