
if ($('.project-details').length > 0) {

    function GetPopup() {

        $("a[rel='example1']").colorbox();
        $("a[rel='example2']").colorbox({ transition: "fade" });
        $("a[rel='example3']").colorbox({ transition: "none" });
        $("a[rel='example4']").colorbox({ transition: "none" });
        $("a[rel='example5']").colorbox();
        $("a[rel='example6']").colorbox();
        $("a[rel='example7']").colorbox();
        $("a[rel='example8']").colorbox();
        $("a[rel='example9']").colorbox({ transition: "fade" });
        $("a[rel='example10']").colorbox({ transition: "none" });
        $("a[rel='example11']").colorbox({ transition: "none" });
        $("a[rel='example12']").colorbox();
        $("a[rel='example13']").colorbox();
        $("a[rel='example14']").colorbox();
        $("a[rel='example15']").colorbox();
        $("a[rel='example16']").colorbox();
        $("a[rel='example17']").colorbox();
        $("a[rel='example18']").colorbox();
        $("a[rel='example19']").colorbox();
        $("a[rel='example20']").colorbox();
        $(".example6").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
        $(".example7").colorbox({ width: "80%", height: "80%", iframe: true });
        $(".example8").colorbox({ width: "50%", inline: true, href: "#inline_example1" });
        $(".example9").colorbox({
            onOpen: function() { alert('onOpen: colorbox is about to open'); },
            onLoad: function() { alert('onLoad: colorbox has started to load the targeted content'); },
            onComplete: function() { alert('onComplete: colorbox has displayed the loaded content'); },
            onCleanup: function() { alert('onCleanup: colorbox has begun the close process'); },
            onClosed: function() { alert('onClosed: colorbox has completely closed'); }
        });

        //Example of preserving a JavaScript event for inline calls.
        $("#click").click(function() {
            $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here.");
            return false;
        });
    }


    $(function() {
        $('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
        $('img.image1').data('ad-title', 'Title through $.data');
        $('img.image4').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
        $('img.image5').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
        var galleries = $('.ad-gallery').adGallery();
        $('#switch-effect').change(
      function() {
          galleries[0].settings.effect = $(this).val();
          return false;
      }
    );
        $('#toggle-slideshow').click(
      function() {
          galleries[0].slideshow.toggle();
          return false;
      }
    );
        $('#toggle-description').click(
      function() {
          if (!galleries[0].settings.description_wrapper) {
              galleries[0].settings.description_wrapper = $('#descriptions');
          } else {
              galleries[0].settings.description_wrapper = false;
          }
          return false;
      }
    );
    });
}

function expandMenu() {
    var locArray = location.pathname.split('index.html');
    var fileName = locArray[locArray.length - 1];
    var _cat = locArray[locArray.length - 2];
    if (fileName.toLowerCase().indexOf("index") != -1) {
        fileName = "Index.aspx";
    }
    else if (fileName.toLowerCase().indexOf("projectmanagement") != -1) {
        fileName = "Services.aspx";
    }
    else if (fileName.toLowerCase().indexOf("project") != -1) {
        fileName = "Projects.aspx";
    }
    else if (fileName.toLowerCase().indexOf("designs") != -1) {
        fileName = "Services.aspx";
    }
    else if (fileName.toLowerCase().indexOf("loan") != -1) {
        fileName = "NRILoans.aspx";
    }
    else if (fileName.toLowerCase().indexOf("calc") != -1) {
        fileName = "NRILoans.aspx";
    }
    else if (fileName.toLowerCase().indexOf("glossary") != -1) {
        fileName = "NRILoans.aspx";
    }
    else if (fileName.toLowerCase().indexOf("contactus") != -1) {
        fileName = "ContactUs.aspx";
    }
    else if (fileName.toLowerCase().indexOf("enquiry") != -1) {
        fileName = "ContactUs.aspx";
    }
    else if (fileName.toLowerCase().indexOf("guestbook") != -1) {
        fileName = "ContactUs.aspx";
    }

    else if (fileName.toLowerCase().indexOf("div") != -1) {
        fileName = "Services.aspx";
    }
    else if (fileName.toLowerCase().indexOf("video") != -1) {
        fileName = "Services.aspx";
    }
    else if (fileName.toLowerCase().indexOf("google") != -1) {
        fileName = "Projects.aspx";
    }
    else if (_cat.toLowerCase().indexOf("projects") != -1) {
        fileName = "Projects.aspx";
    }

    jQuery('#menu li').removeClass('current');
    jQuery('#menu li a[href*="' + fileName + '"]').parent().addClass('current');

}

// JavaScript Document
jQuery(function() {
    // common first and last
if (jQuery('div:has(ul)')) {
    jQuery('li:last-child').addClass("last-child");
    jQuery('ul.btn-list li:nth-child(4n)').addClass("fourth-child");
    jQuery('.list-04 ul li:last-child').addClass("last-child");
    jQuery('.radio-list	ul li:nth-child(2n)').addClass("second-child");
    jQuery('ul.project-list li:nth-child(3n)').addClass("third-child");
    jQuery('ul.project-list li:nth-child(2n)').addClass("second-child");
    jQuery('ul.project-list li:nth-child(1n)').addClass("first-child");
    jQuery('ul.foote-links li:last-child').addClass("last-child");
    jQuery('ul.img-list-01 li:nth-child(3n)').addClass("second-child");
    jQuery('.list-03 ul li:nth-child(2n)').addClass("second-child");
    jQuery('.list-01	ul li:last-child').addClass("last-child");
    jQuery('ul .quick-link-02 li:last-child').addClass("last-child");
    jQuery('ul.enquary-list li:nth-child(2n)').addClass("second-child");
   }





});


// AUTOHEIGHT

	function equalHeight(group) {
	tallest = 0;
	group.each(function() {
	thisHeight = $(this).height();
	if(thisHeight > tallest) {
	tallest = thisHeight;
	}
	});

	group.height(tallest);
	
	}
	jQuery(document).ready(function() {

	equalHeight(jQuery(".list-wid-01, .list-wid-02, .list-wid-03"));
	});


// Mouse Over

	jQuery(function()
{
    jQuery(".quick-link-02 li").hover(function()
	{
	    jQuery(this).addClass("active");
	},function()
	{
	    jQuery(this).removeClass("active");
	});
});
