﻿
$(document).ready(function() {

	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	//Default Action
	$(".featured_tab_content").hide(); //Hide all content
	$("ul.ftabs li:first").addClass("active").show(); //Activate first tab
	$(".featured_tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.ftabs li").click(function() {
		$("ul.ftabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".featured_tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	//Default Action
	$(".quick_tab_content").hide(); //Hide all content
	$("ul.quicktabs li:first").addClass("active").show(); //Activate first tab
	$(".quick_tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.quicktabs li").click(function() {
		$("ul.quicktabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".quick_tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});

$(function(){
			$('form').jqTransform({imgPath:'images/secondHeaderImages/'});
		});
		//******************Home Page News Rotation code******************//
		$(document).ready(function()
 {
     setupRotator();
 });
 function setupRotator()
 {
     if($('.textItem').length > 1)
     {
         $('.textItem:first').addClass('current').fadeIn(1000);
         setInterval('textRotate()', 3000);
     }
 }
     function textRotate()
     {
         var current = $('#quotes > .current');
         if(current.next().length == 0)
         {
             current.removeClass('current').fadeOut(5);
             $('.textItem:first').addClass('current').fadeIn(100);
         }
         else
         {
             current.removeClass('current').fadeOut(5);
             current.next().addClass('current').fadeIn(100);
         }
     }
     
     //****************** End Home Page News Rotation code******************//
     
     //****Search By PropertyID***/
     function SearchProperty()
     {
        var id= $('#Txt_SPID').val();
  //check it contains only digits
    if($('#Txt_SPID').val()!="")
    {
        if($('#Txt_SPID').val().length==5)
        {
            var value=$('#Txt_SPID').val();
            var numericExpression = /^[0-9]+$/;
            if(value.match(numericExpression))
            {   
                document.getElementById("SPReq").style.display ="none";
                document.getElementById("SPReq").innerHTML ="";
                NewCommonAjaxCall("SearchById!"+value);
               
            }
            else
            {
            document.getElementById("SPReq").style.display ="inline";
            document.getElementById("SPReq").innerHTML="Invalid";
           
            }
        }
        else
        {
        document.getElementById("SPReq").style.display ="inline";
        document.getElementById("SPReq").innerHTML="Invalid Id";
       
        }
    }
    else
    {
        document.getElementById("SPReq").style.display ="inline";
        document.getElementById("SPReq").innerHTML="Required";
        
    } 
       
       
     }
