// JavaScript Document

function ad001wscreen(idName){
var obj=document.getElementById(idName);

if(obj)
{
	
			var x=document.body.clientWidth-parseInt(obj.style.width.replace("px",""));
    	
			var y=document.body.clientWidth-parseInt(obj.style.height.replace("px",""));
      
		        obj.style.left=x/2+"px";
				obj.style.top=(y/2)+"px";
	     		obj.style.display="block";
			//setTimeout("closediv('"+idName+"')",15000);
		return false;
	}
	}
	
function myfunction() {
     var obj=document.getElementById('ad001');
	obj.style.display="none";
	setTimeout("ad001wscreen('ad001')",5000);
}
/*function closediv(idName){
	var obj=document.getElementById(idName);
	obj.style.display="none";
	return false;
}*/

function CheckBlank(sid)
{
    var str="";
    str = document.getElementById(sid).value;
   var count = str.length;
     str = trim(str);
    if(str.length==0)
    {
        alert("Invalid search item");
        return false;
    }
     else if (count > 145 && str.charAt(0)!='"' && str.charAt(str.length-1)!='"' )
            {
             alert('Searched Text exceeds the limit.');
          return false;
            }
    else
    {
        return true;
    }
}
function CheckLimitsecondtext(sid)
{
    var str="";
    str = document.getElementById(sid).value;
   var count = str.length;
     str = trim(str);
       if(str.length==0)
    {
        alert("Invalid search item");
        return false;
    }
 else if (count > 145 && str.charAt(0)!='"' && str.charAt(str.length-1)!='"' )
            {
             alert('Searched Text exceeds the limit.');
          return false;
            }
    else
    {
        return true;
    }
}