//$(function() {
$(document).ready(function() {
	$("#primary li").each(function(i){
		$(this).bind("mouseenter",function(){
			$(this).addClass("hover");
			$('#primary ul.links').css('height','500px');
		});
		$(this).bind("mouseleave",function(){
			$(this).removeClass("hover");
			$('#primary ul.links').css('height','26px');
		});
	});

	$("#edit-field-priority-value-wrapper").append(' <a onclick="popupPriority();" href="#">Click here for detail priority information.</a>');
	$(".section-user #edit-field-contact-suite-nid-nid-wrapper").append(' <a href="/node/add/suite">Click here to add a new Suite.</a>');

/*	$("#edit-field-srf-client-nid-nid-wrapper").append(' <a href="/popups/test/" class="popups" on-popups-options="{href: &quot;test/response&quot;}">Pop with options (href override).</a> ');
	setTimeout("reloadPopups()", 5000);*/

	$(".field-field-images .field-items").prepend("<div id='field-field-images_zoom'></div>");
	var first = true;
	$(".field-field-images a.lightbox-processed").each(function(i){
		if(first) {
			first = false;
			$("#field-field-images_zoom").empty().append("<img src='"+$(this).attr('href')+"' />");
		}
		$(this).bind("mouseenter",function(){
			$("#field-field-images_zoom").empty().append("<img src='"+$(this).attr('href')+"' />");
		});
//    $(this).bind("mouseleave",function(){
//    });
	});
});

function popupPriority() {
	window.open('/srf_priority_levels','','width=890,height=530,location=no,menubar=no,status=no,titlebar=no,toolbar=no,top=50,left=50',false);
	return false;
}

function reloadPopups() {
	Drupal.popups.attach(context, '.popups', {}); // ajax reload.
}


