function checkAll(checked)
{
	  for(var i=0;i<document.removeForm.elements.length;i++)
	  {  
		 	var e = document.removeForm.elements[i];
			if(e.type == "checkbox") e.checked = checked;
	  }
}
function deleteAlert(theForm)
{
	 var records = theForm.records.value;
     var total = 0;
     var msg = "";
     if(records>0)
     {
          for(i=0; i<theForm.length; i++)
          {
               e=theForm.elements[i];
               name = e.name;
               name = name.substr(0,4);
               if (e.type=='checkbox' && name == "item")
                    if(eval('e.checked') == true)
                         total= total+1;
          }
          if(total >0)
               msg = msg + 'Do You Like to remove ' + total +' records ?';
          else
          {
               alert("Please check the items to remove !");
               return false;
          }
          if(msg.length >0)
          {
               var flag;
               flag = confirm(msg + " If Yes Press \"OK\" else Press \"Cancel\".");
               if(flag == true)
               return true;
          }
     }
	 //alert("You can not delete items");
     return false;
	 
}
/* Email validation function*/
function isValidEmail(emailid){		
		var l=emailid.length;
		if(l==0)
		{
				return false;	
		}
		if(l!=0)
		{
				var a=emailid.indexOf('@');
				var d=emailid.lastIndexOf('.');
				var str1=emailid.substr(0,a);
				var str2=emailid.substr(a+1,d-a-1);
				var str3=emailid.substr(d+1,l);
				var len1=str1.length;
				var len2=str2.length;
				var len3=str3.length;
				if(a<0 || d<2)
				{
						//alert ("Check for missing '@' or '.' ");
						return false;
				}
				else if (a>d)
				{
						//alert ("Invalid email. Please enter correct email address");
						return false;
				}				
				if (len1<=1 || len2<=1 || len3 <=1)
				{
						//alert ("Invalid email. Please enter correct email address");
						return false;
				}				
		}
		return true;
}
//popup window
var pop='';
function openwin(nm,width,height) {
	var name=nm;
	if (pop && !pop.closed) {
		pop.close();
	}
	day = new Date();
	id = day.getTime();
	pop=eval("window.open('"+name+"','NewWIN','toolbar=no,left=5,top=5,width="+width+",height="+height+",location=0,directories=no,menubar=no,SCROLLBARS=yes,left=2,right=2')");
	if (!pop.opener) popUpWin.opener = self;
}
/*function for open the popup in naother window*/

function popUp(URL,width,height) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+width+",height="+height+"');");
}


/// blink function for blink the text
function blinkIt() {
 if (!document.all) return;
 else {
   	  for(i=0;i<document.all.tags('blink').length;i++)
	  {
     	 s=document.all.tags('blink')[i];
      	if(s.style.visibility=='visible')
		 {
		 	s.style.visibility='hidden';
			
		}	
		else
		{
		   s.style.visibility='visible';	
			
		}
   }
 }
}
// for check the check boxes 
function validate(objForm)
     {
          var i;
		  var item2=objForm['item[]'];
		 
		  var valid=false;
		  for ( i=0; i<item2.length; i++ )
          {
		  	
		  	  if (item2[i].checked )
               {
                    valid = true;
                    break;
               }
          }
		  if(item2.checked)
		  	 valid = true;
          if (valid)
		          	return true;    
           else
          { 
               alert("There are no property selected please select the property first");
               return false;
          }
     }
// this 
window.onerror = null
var browserOK = (((navigator.appName == 'Netscape') &&
                  (parseInt(navigator.appVersion) >= 3)) ||
		 ((navigator.appName == 'Microsoft Internet Explorer') &&
		  (parseInt(navigator.appVersion) >= 4)));


if (browserOK)
{
    Message = "Welcome To Real Estate";
    Length = 30;
    Base = 0;
    Spaces = "                    "; // 20 spaces
}
    
function marquee()
{
  if (browserOK)
  {
    TempString = "";
    if (Base)
    {
      TempString += Message.substring(0, Base);
    }
    if (Base <= Message.length)
    {
      TempString += Spaces.substring(0, Length);
      TempString += Spaces.substring(0, Length);
      TempString += Spaces.substring(0, Length);
      TempString += Spaces.substring(0, Length);
      TempString += Message.charAt(Base);
    }
    window.status = TempString;
    
    if (Length > 0)
    {
      Length --;
      setTimeout('marquee()', 50);
    }
    else if (Base <= Message.length)
    {
      Length = 20;
      Base ++;
      while (Message.charAt(Base) == " " && Base <= Message.length)
        Base ++;
      setTimeout('marquee()', 100);
    }
    else
    {
      Length = 20;
      Base = 0;
      setTimeout('marquee()', 8000);
    }
  }
}
//marquee()
// End hide -->
