function ir() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function preloadImages() {

		MM_preloadImages('i/b-home-on.jpg','i/b-about-hyd-on.jpg','i/b-about-us-on.jpg','i/b-ventures-on.jpg','i/b-presentations-on.jpg','i/b-concepts-on.jpg','i/b-upcoming-ventures-on.jpg','i/b-jobs-on.jpg','i/b-media-on.jpg','i/b-export-import-on.jpg','i/b-software-consultancy-on.jpg','i/b-contact-us-on.jpg','i/pan-online-b-on.jpg')
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function si() { //v3.0
  var i,j=0,x,a=si.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// For contact us form

function f_contact() {

 trim_it(document.forms[0].message);
 trim_it(document.forms[0].telephone_no);

       if(!validate_name(document.forms[0].visitor_name,"your name.")){ return false; }   
       else if(!validatePh(document.forms[0].telephone_no) ){return false; }
       else if (!f_checkMailid(document.forms[0].email , "your mail id." ) ){ return false;  }
       else if(document.forms[0].message.value=='' || document.forms[0].message.value==null){
                 alert("Enter your  message.");
                 document.forms[0].message.focus();
                 return false;  
       }else{
	return true;  
        }
}
	


function validatePh(field) {
var valid = "-0123456789"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid entry!  Only numbers are accepted,you can use 'Hyphen'  to seperate country and area code!");
field.focus();
field.select();
return false;
   }else
    return true; 
}


// Email Validation. Written by PerlScriptsJavaScripts.com

function f_checkMailid(mailid,message){

 trim_it(mailid);
 e=mailid.value;

     if(e=='' || e==null){
     alert("Enter " + message );
     mailid.focus();
     mailid.select();
     return false;
     }


 ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

   for(i=0; i < e.length ;i++){
	if(ok.indexOf(e.charAt(i))<0){ 
	alert("Check" + message);
                  mailid.focus();
	mailid.select();
       	return (false);                  
	}	
    } 

   if (document.images) {                 
	re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
	re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	if (!e.match(re) && e.match(re_two)) {	
	return (-1);		
	}else{
	alert("Check " + message);
                  mailid.focus();
	mailid.select();
	return false;
	}
   }
}

//For removing   leading  and trailing spaces

function trim_it(field1) {
// remove leading spaces.
while(''+field1.value.charAt(0)==' ') {
   field1.value=field1.value.substring(1,field1.value.length);
}
// remove trailing spaces.
while(''+field1.value.charAt(field1.value.length-1)==' ') {
   field1.value=field1.value.substring(0,field1.value.length-1);
}
}

// validating name

function validate_name(field,message) {
trim_it(field);
var valid = " abcdefghijklmnopqrstuvwxyz0123456789_."
var ok = "yes";
var temp;

   if(field.value=='' || field.value==null){
     alert("Enter  " + message);
     field.focus();
     return false; 
     }


  for (var i=0; i<field.value.length; i++) {
        temp = "" + field.value.substring(i, i+1);
        temp = temp.toLowerCase();
        if (valid.indexOf(temp) == "-1") {
           ok = "no";
           }
  }

  if (ok == "no") {
     alert("Invalid name!  Only alphabets, numbers, underscore and periods are accepted!");
     field.focus();
     field.select();
     return false;
  }else
     return true;  

}

function fwLoadMenus() {
  window.fw_menu_0_1 = new Menu("&raquo; Hyderabad",108,14,"Verdana, Arial, Helvetica, sans-serif",10,"#000000","#9D110A","#76DEF3","#FFFFE8");
      fw_menu_0_1.addMenuItem("&#149; Beverly Hills Resorts","location='beverly-hills-resorts.html'");
  fw_menu_0_1.addMenuItem("&#149; A-One Farms","location='a-one-farms.html'");
  fw_menu_0_1.addMenuItem("&#149; A-One Gardens","location='a-one-gardens.html'");
  fw_menu_0_1.addMenuItem("&#149; Photo Gallery","location='photo-gallery-1.html'");
     fw_menu_0_1.hideOnMouseOut=true; 
	 
	  window.fw_menu_1_1 = new Menu("&raquo; Bangalore",100,14,"Verdana, Arial, Helvetica, sans-serif",10,"#000000","#9D110A","#76DEF3","#FFFFE8");
      fw_menu_1_1.addMenuItem("&#149; Mary Hills","location='bangalore-mary-hills.html'");
  fw_menu_1_1.addMenuItem("&#149; Photo Gallery","location='bangalore-photo-gallery.html'");
     fw_menu_1_1.hideOnMouseOut=true; 
  
  window.fw_menu_0 = new Menu("root",90,16,"Verdana, Arial, Helvetica, sans-serif",10,"#086300","#000000","#EDFDFB","#D9F7FC");
      fw_menu_0.addMenuItem(fw_menu_0_1,"location='beverly-hills-resorts.html'");
  fw_menu_0.addMenuItem(fw_menu_1_1,"location='mary-hills.html'");
 fw_menu_0.fontWeight="0";
   fw_menu_0.hideOnMouseOut=true;
   
   window.fw_menu_1 = new Menu("root",120,16,"Verdana, Arial, Helvetica, sans-serif",10,"#086300","#000000","#EDFDFB","#D9F7FC");
      fw_menu_1.addMenuItem("&raquo; Spanish Tower","location='concepts-tower.html'");
  fw_menu_1.addMenuItem("&raquo; Hanging House","location='concepts-hanging-house.html'");
  fw_menu_1.addMenuItem("&raquo; Lakeside Resort","location='concepts-lakeside-resort.html'");
  fw_menu_1.addMenuItem("&raquo; Castle House","location='concepts-castle-house.html'");
 fw_menu_1.fontWeight="0";
   fw_menu_1.hideOnMouseOut=true;
    fw_menu_1.writeMenus();
}


//Copy Right
function copyRight(startYear) {
    date = new Date();
    year = date.getYear();
    if ( (year - startYear) > 0){
       document.write(startYear + " - " + year);
    }else{
     document.write(startYear);
    }
}

