var coords1 = 43.545678;
var coords2 = -96.731160;

$(document).ready(function() {
	
	
	$(".popup-image").each(function() {
	
		$(".popup-image[rel="+$(this).attr("rel")+"]").fancybox();
	
	});
	
	
	$(".iframe").live("click", function() {
	
	
		var url = $(this).attr("data-id");	
	
		$.fancybox({type: 'iframe', href: url});
		
		
		return false;
	
	});


	/*
	$(".popup-image").live("click", function() {
	
	
		var url = $(this).attr("data-id");	
	
		//$.fancybox({href: url});
				   
		//return false;
	
	});
	*/
	
	
	
	$(".ulmore").live("click", function() {	
	
		$(this).parent().parent().find(".hideli").show();
		$(this).parent().hide();
		return false;
	
	});
	
	var count = 0;
	$("#sidebar2 ul li").each(function() {
		if (count % 2) {
			$(this).addClass("odd");		
		} else {
			$(this).addClass("even");	
		}
		count++;
	});
	
	
	$("#content table.style").each(function() {
		var count = 0;
		$(this).find("tr").each(function() {
			if (count % 2 && !$(this).hasClass("rowhead")) {
				$(this).addClass("odd");		
			} else {
				$(this).addClass("even");	
			}
			count++;	
		});
	});
	
	$("#content table.style").each(function() {
		$(this).find("tr:first").addClass("heading");
	});
	
	if ($("#map").length > 0)
	{
	
	centerloc = new google.maps.LatLng(coords1,coords2);
		
    var options = {
      zoom: 14,
      scrollwheel: false,
      center: centerloc,
      navigationControl: true,
      scaleControl: true,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };

    var iconimage = "/site/images/favicon/"+color+".jpg";
    
    
    var map = new google.maps.Map(document.getElementById("map"), options);
                  
    var myLatLng = new google.maps.LatLng(coords1, coords2);
         var marker = new google.maps.Marker({
            position: myLatLng,
            map: map,
            icon: iconimage
   	 });

	}

	
});


function hideList() {

	var hidelength = 9;

	$("#content ul").each(function() {
	
		if ($(this).find("li").length > hidelength) {
		
			var count = 0;
			$(this).find("li").each(function() {
				if (count > (hidelength-1)) {
					$(this).addClass("hideli");
					$(this).hide();	
				} 
				count++;
			});
			
			$(this).append("<li><a class='ulmore' href='#'>... Click For More Details</a></li>"); 
		
		
		}
			
	});
	
	
	$ul = $(".image-left").parent().find("ul");
	$ul.css("float", "left");
	$ul.next().css("clear", "left");



}


	
