$(document).ready(function() {
	
	/* cont h1 */
	$("#cont h1 span a").hover(function(){
			$(this).animate({
				color: "#FF3"
			}, 100);
		}, function() {
			$(this).animate({
				color: "#930"
			}, 100);
	});
	
	/* blockHeader */
	$("p.blockHeader span").click(function(){
		elem = $(this).parent().next("form");
		if (elem.is(":hidden")) { 
			elem.slideDown(150);
			$.cookie('hideSearch', 'false'); 
		} else { 
			elem.slideUp(150);
			$.cookie('hideSearch', 'true' ); 
		}
	});
	
	
	/* blockVert */
	$("th.required").prepend("<span class='rrrrr' title='Required field'>*</span>");
	
	/* Pager */
	$("#cont div.pager ul li a").hover(function(){
			$(this).animate({
				backgroundColor: "#D76"
			}, 100);
		}, function() {
			$(this).animate({
				backgroundColor: "#DCC"
			}, 100);
	});
	
	/* List */
	$("table.list tr.lr").hover(function(){
		$(this).children("td").animate({
			backgroundColor: "#F2F2F2"
		}, 100);
	}, function() {
		$(this).children("td").animate({
			backgroundColor: "transparent"
		}, 100);
	});

	/* Page Sets */
	$("#pageSizeSelector").change(function() {
		$( "#pageSize" ).val($(this).val());
		$( "#searchForm" ).submit();
	});
	
	/* Preview images */
	$("p.prv").hover(function(){
		$(this).children("span.preview").css("display", "block");
	}, function(){
		$(this).children("span.preview").css("display", "none");
	});
});

function page( page ) {
	$( "#pageId" ).val( page );
	$( "#searchForm" ).submit();
}

$(function() {
	$('.tooltip').Tooltip({
		track: true,
		delay: 250
	});

	$('.tooltipWarning').Tooltip({
		event: "click",
		delay: 0
	});
});


function BaseSelector( path ) {
    this.path = path;
    
    this.title = 'Select';
    
    this.height = 760;
    
    this.width = 860;
    
    this.left = (screen.width/2)-(this.width/2);
    
    this.top  = (screen.height/2)-(this.height/2);
    
    this.controlName = "selector";
    
    this.Unblock = function() {
         $.unblockUI();
    }
    
    this.Block  = function() {
	    if($.blockUI){
	     $.blockUI({
	      message: 'External window is opened!<br /> <a style="color:#FFFFFF" href="javascript: ' + this.controlName + '.Unblock();">unblock</a>',
	      css: { 
	       border:'none', padding:'15px', size:'12.0pt',
	       backgroundColor:'#900', color:'#fff',
	       opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px'
	      }
	     });
	    }
    }
}
