﻿var xPos;
var yPos;

function showToolTip(title,msg,evt,color){
    
    var url;
    if (evt) {
        url = evt.target;
    }
    else {
        evt = window.event;
         url = evt.srcElement;
    }
    xPos = evt.clientX;
    yPos = evt.clientY;
//alert(id);
   var toolTip = document.getElementById("toolTip");
   toolTip.innerHTML = "<h1>"+title+"</h1><p>"+msg+"</p>";
   toolTip.style.top = parseInt(yPos)+2 + "px";
   toolTip.style.left = parseInt(xPos)+2 + "px";
   toolTip.style.visibility = "visible";
   document.getElementById("toolTip").style.color=color;
  //check if element exixts??
  if(document.getElementById(title)){
  document.getElementById(title).style.cursor='help';
  document.getElementById("toolTip").style.background="#F9F9F9";
    document.getElementById("toolTip").style.position="relative";
   // document.getElementById('id').onmouseout=hideToolTip;
 document.getElementById("toolTip").style.zIndex="2";
  }
  else{
  ///document.getElementById("toolTip").style.background = "#2B547E";
  document.getElementById("toolTip").style.position="absolute";
  document.getElementById("toolTip").style.zIndex="1000000";
  //document.getElementById(id).onmouseover=hideToolTip;
  //document.getElementById("toolTip").("h1").style.color="white";
 // document.getElementById("toolTip").style.color="#FFFFFF";
  }
  
}
//function(color){ document.getElementById("toolTip").style.color=color;}
function hideToolTip(){
   var toolTip = document.getElementById("toolTip");
   toolTip.style.visibility = "hidden";
}
//Remove spaces at star and end in string
String.prototype.trim = function() {
    var s = this.toString();
    s = s.replace(/^[\s]*/g, "");
    s = s.replace(/[\s]*$/g, "");
    return s;
}
    function fnMdnCheck(source,arguments)
    {
    var mdn=document.getElementById('txtMdn').value;
    if(isNaN(mdn)==false && mdn.trim().length >0)
      {
        if(mdn.trim().length<10)
        {
        arguments.IsValid=false;
        }
      }
    
    }
     function fnMobCheck(source,arguments)
    {
    var mdn=document.getElementById('txtMob').value;
    if(isNaN(mdn)==false && mdn.trim().length >0){
    if(mdn.trim().length<10)
    {
    arguments.IsValid=false;
    
    }
    }
    
    }
