var msg_required = ' required';
var msg_isNumeric = ' must be numeric.';
var msg_isFloat = ' must be float.';
var msg_isEmail = 'Your email address is not valid!';
var msg_twoEmail = 'Your email addresses are not identical.';
var msg_isRequired = ' cannot be blank!'; 
var msg_isHTMLtags = ' Please do not use HTML tags in the field.';
var msg_error = " Please inform BAEN admin for email: info@bayequest.com of the error code, thanks.";
var msg_specialchar = ' include special char.';
var msg_adtype = 'Please select Ad Type';

///iframe, msgbox overflow deny.
var divFrm = '<iframe style="position:absolute; z-index:98;width:0;height:0;top:expression(this.nextSibling.offsetTop);left:expression(this.nextSibling.offsetLeft);" frameborder="0"></iframe>';
divFrm += '<div id="showMyMessage" style="position: absolute; width: 120; display: none; z-index: 99;font-size: 13px; background: #ffff00"></div>';
document.write(divFrm);


function divShow()
{
   //argument less than 2 will not be processed.
   if(arguments.length < 2)
     return;
    
   var msg,e,msgWidth,leftPosition,topPosition,backColor, finalmsg;
   
   
   msg = arguments[0];
   e   = arguments[1];
   
   finalmsg = "<div style='border: 1px solid #790000; color:red'>" + msg + "</div>";
  
   //msgbox width&height, default height*15px
   if(arguments.length >= 3)
     msgWidth = arguments[2];
   else
     msgWidth = finalmsg.length * 3;

   //position offerset x, default:0
   if(arguments.length >= 4)
     leftPosition = arguments[3];
   else
     leftPosition = 0;

   //position offerset y, default:20
   if(arguments.length >= 5)
     topPosition = arguments[4];
   else
     topPosition = 20;

   //text color, default: #ffff00
   if(arguments.length >= 6)
     backColor = arguments[5];
   else
     backColor = "#ffff00";

   var divObj = document.getElementById("showMyMessage");
   divObj.style.background = backColor;
   divObj.innerHTML = finalmsg;
   divObj.style.width = msgWidth;
   divObj.style.display = ""; //show layer
   divObj.style.top = e.getBoundingClientRect().top + topPosition + document.body.scrollTop;
   divObj.style.left= e.getBoundingClientRect().left + leftPosition + document.body.scrollLeft;
}

function divHidden()
{
   document.getElementById("showMyMessage").style.display = 'none';
}
