// ui.actions.js
$.fn.toggleVal = function(text) {
	return $(this).each(function() {
		$(this).val(text);
		$(this).click(
			function() {
				if($(this).val() == text) {
					$(this).val("");
				}
			}
		);
		$(this).focusout(
			function() {
				if($(this).val() == "") {
					$(this).val(text);
				}
			}
		);
	});
}
$(document).ready(
function() {
	var searchText = $("label#searchLabel[for=search]").text();
	$("#search").toggleVal(searchText);
	$("#Submit").click(function() {
		if($("#search").val() == searchText) {
			$("#search").val("");
		}
	});
	var src = $('a.reg-form').attr('href');
	$('a.reg-form').click(function(e) {
		e.preventDefault();
		$.modal('<iframe src="' + src + '" height="600" scrolling="no" width="600" style="border:0; width:600px; height:600px; overflow:hidden;">', {
			closeClass: "modalClose",
			closeHTML:"<a href=\"#\" style=\"color:#fff;\">Close this window</a>",
			containerCss:{
				backgroundColor:"#0A64A4",
				borderColor:"#000",
				borderWidth:"1px",
				borderStyle:"solid",
				height:620,
				padding:0,
				margin:0,
				width:600
			},
			overlayClose:true
		});
	});
//	$('a.reg-form').prettyPhoto();	
	$('a[rel="external"]').click(function() {
		$(this).attr('target', '_blank');
	});
});

