function setUnderline(elementToApplyTo){ /*for(i=1;i<6;i++){ document.getElementById('slideButton'+i).style.textDecoration='none'; document.getElementById('slideButton'+i).style.color='#A7B2AC'; } */ document.getElementById(elementToApplyTo).style.textDecoration='underline'; document.getElementById(elementToApplyTo).style.color='#FFF'; } $(document).ready(function(){ $('#pod1Link').mouseover(function() { $('#pod1').animate({ opacity: 0.80 }, 500); }); $('#pod1Link').mouseout(function() { $('#pod1').animate({ opacity: 0 }, 1000); }); $('#pod2Link').mouseover(function() { $('#pod2').animate({ opacity: 0.80 }, 500); }); $('#pod2Link').mouseout(function() { $('#pod2').animate({ opacity: 0 }, 1000); }); $('#pod3Link').mouseover(function() { $('#pod3').animate({ opacity: 0.80 }, 500); }); $('#pod3Link').mouseout(function() { $('#pod3').animate({ opacity: 0 }, 1000); }); $('#pod4Link').mouseover(function() { $('#pod4').animate({ opacity: 0.80 }, 500); }); $('#pod4Link').mouseout(function() { $('#pod4').animate({ opacity: 0 }, 1000); }); $('#slideButton1').click(function() { $('#statement').html($('#slideText1').html()); $('#slideTrack').animate({ marginLeft: "0px" }, 1500 ); }); $('#slideButton2').click(function() { $('#statement').html($('#slideText2').html()); $('#slideTrack').animate({ marginLeft: "-980px" }, 1500 ); }); $('#slideButton3').click(function() { $('#statement').html($('#slideText3').html()); $('#slideTrack').animate({ marginLeft: "-1960px" }, 1500 ); }); $('#slideButton4').click(function() { $('#statement').html($('#slideText4').html()); $('#slideTrack').animate({ marginLeft: "-2940px" }, 1500 ); }); $('#slideButton5').click(function() { $('#statement').html($('#slideText5').html()); $('#slideTrack').animate({ marginLeft: "-3920px" }, 1500 ); }); $('#slideButton6').click(function() { $('#statement').html($('#slideText6').html()); $('#slideTrack').animate({ marginLeft: "-4900px" }, 1500 ); }); $('#slideButton7').click(function() { $('#statement').html($('#slideText7').html()); $('#slideTrack').animate({ marginLeft: "-5880px" }, 1500 ); }); $('#slideButton8').click(function() { $('#statement').html($('#slideText8').html()); $('#slideTrack').animate({ marginLeft: "-6860px" }, 1500 ); }); $("#registrationForm").submit( function () { alert('ive been submitted woohoo'); }); /* AJAX homepage newsletter signup */ $('#registerFormLink').click(function(){ $.post("/js/xhr/register.php", { username: $('#email').val(), baseUrl: '/nfs/c03/h07/mnt/81244/domains/lenyestate.com/html/' }, function(response){ $('#registerComponents').fadeOut('500',function() { $('#registerComponentsThanks').html(response); $('#registerComponentsThanks').fadeIn('500'); }); }); return false; }); /* AJAX homepage newsletter signup */ $('#retry').click(function(){ $('#registerComponentsThanks').fadeOut('500',function() { $('#registerComponents').fadeIn('500'); }); return false; }); $('#yearLeft').click(function() { var curYear = parseInt($('#yearDisplay').html()); var maxYear = parseInt($('#maxYear').html()); var minYear = parseInt($('#minYear').html()); if(curYear==(minYear+1)){ $('#yearLeft').hide(); } $('#yearRight').show(); $('#yearDisplay').html((curYear-1)); $('#availabilityCalendarScroller').animate({ marginLeft: "+=711px" }, 0 ); }); $('#yearRight').click(function() { var curYear = parseInt($('#yearDisplay').html()); var maxYear = parseInt($('#maxYear').html()); var minYear = parseInt($('#minYear').html()); if(curYear==(maxYear-1)){ $('#yearRight').hide(); } $('#yearLeft').show(); $('#yearDisplay').html((curYear+1)); $('#availabilityCalendarScroller').animate({ marginLeft: "-=711px" }, 0 ); }); $('#filmStripLeft').click(function() { var curSlide = parseInt($('#galleryCurrent').html()); var maxSlide = parseInt($('#galleryTotal').html()); if(curSlide==1){ var distanceToMove = ((maxSlide-7)*123); $('#filmStrip').animate({ marginLeft: '-='+distanceToMove+'px' }, 1000 ); $('#galleryCurrent').html((maxSlide-6)); }else{ $('#galleryCurrent').html((curSlide-1)); $('#filmStrip').animate({ marginLeft: "+=123px" }, 500 ); } }); $('#filmStripRight').click(function() { var curSlide = parseInt($('#galleryCurrent').html()); var maxSlide = parseInt($('#galleryTotal').html()); if(curSlide==(maxSlide-6)){ var distanceToMove = (0); $('#filmStrip').animate({ marginLeft: '0px' }, 1000 ); $('#galleryCurrent').html(1); }else{ $('#galleryCurrent').html((curSlide+1)); $('#filmStrip').animate({ marginLeft: "-=123px" }, 500 ); } }); /* availability ajax functionality*/ $('.tabOffAlt,.tabOnAlt').click(function(){ $('.tabOnAlt').removeClass('tabOnAlt').addClass('tabOffAlt'); $(this).removeClass('tabOffAlt').addClass('tabOnAlt'); $('#availabilityCalendarScroller').html('
'); $.post("/js/xhr/availability.php", { buildingType: $(this).attr('id'), baseUrl: '/nfs/c03/h07/mnt/81244/domains/lenyestate.com/html/' }, function(response){ $('#availabilityCalendarScroller').html(response); }); return false; }); /* tariff ajax functionality*/ $('.tab2OffAlt,.tab2OnAlt').click(function(){ $('.tab2OnAlt').removeClass('tab2OnAlt').addClass('tab2OffAlt'); $(this).removeClass('tab2OffAlt').addClass('tab2OnAlt'); $('#availabilityCalendarScroller').html('
'); $.post("/js/xhr/tariffs.inc.php", { buildingType: $(this).attr('id'), baseUrl: '/nfs/c03/h07/mnt/81244/domains/lenyestate.com/html/' }, function(response){ $('#availabilityCalendarScroller').html(response); }); return false; }); }); function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ /* alert("Invalid E-mail ID") */ return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ /* alert("Invalid E-mail ID") */ return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ /* alert("Invalid E-mail ID")*/ return false } if (str.indexOf(at,(lat+1))!=-1){ /* alert("Invalid E-mail ID")*/ return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ /* alert("Invalid E-mail ID")*/ return false } if (str.indexOf(dot,(lat+2))==-1){ /* alert("Invalid E-mail ID")*/ return false } if (str.indexOf(" ")!=-1){ /* alert("Invalid E-mail ID")*/ return false } return true } function passwordStrength(password){ var desc = new Array(); desc[0] = "Password strength: Very Weak"; desc[1] = "Password strength: Weak"; desc[2] = "Password strength: Better"; desc[3] = "Password strength: Medium"; desc[4] = "Password strength: Strong"; desc[5] = "Password strength: Strongest"; var score = 0; //if password bigger than 6 give 1 point if (password.length > 6) score++; //if password has both lower and uppercase characters give 1 point if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++; //if password has at least one number give 1 point if (password.match(/\d+/)) score++; //if password has at least one special caracther give 1 point if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++; //if password bigger than 12 give another 1 point if (password.length > 12) score++; document.getElementById("passwordDescription").innerHTML = desc[score]; document.getElementById("passwordStrength").className = "strength" + score; }