//////////////////////
// jquery-ui.config //
//////////////////////

/////////////////////////////
// jquery.formclear.config //
/////////////////////////////

$(function() { 
   $('.cleardefault').formclear({
   inactivecolor:'', // Defaults to #777 (dark grey)
   activecolor:'',  // defaults to #000 (black)
   emptyval:'' // defaults to '' (nothing, as in cleared)
	}); 
});

/////////////////////////////
// jquery.linkIcons.config //
/////////////////////////////

$(function() {

	// Add pdf icons to pdf links
	$("a[href$='.pdf']").addClass("pdf");
	 
	// Add txt icons to document links (doc, rtf, txt)
	$("a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("txt");

	// Add zip icons to Zip file links (zip, rar)
	$("a[href$='.zip'], a[href$='.rar']").addClass("zip"); 
	
	// Add email icons to email links
	$("a[href^='mailto:']").addClass("email");

	//Add external link icon to external links - 
	$('a').filter(function() {
		//Compare the anchor tag's host name with location's host name
	    return this.hostname && this.hostname !== location.hostname;
	  }).addClass("external");

});

////////////////////////////
// jquery.jTwitter.config //
////////////////////////////

$(function(){
    $(".tweet").tweet({
        username: "getComposting",
        join_text: "auto",
        avatar_size: 32,
        count: 5,
        auto_join_text_default: "we said,", 
        auto_join_text_ed: "we",
        auto_join_text_ing: "we were",
        auto_join_text_reply: "we replied to",
        auto_join_text_url: "we were checking out",
        loading_text: "loading tweets..."
    });
});

////////////////////////////
// jquery.validity.config //
////////////////////////////
$.validity.setup({ outputMode:"modal" });

$(function() { 		   
	$("#search-postcode").validity(function() {
								
		var regexp = /^([A-PR-UWYZa-pr-uwyz]([0-9]{1,2}|([A-HK-Ya-hk-y][0-9]|[A-HK-Ya-hk-y][0-9]([0-9]|[ABEHMNPRV-Yabehmnprv-y]))|[0-9][A-HJKS-UWa-hjks-uw])\ {0,1}[0-9][ABD-HJLNP-UW-Zabd-hjlnp-uw-z]{2}|([Gg][Ii][Rr]\ 0[Aa][Aa])|([Ss][Aa][Nn]\ {0,1}[Tt][Aa]1)|([Bb][Ff][Pp][Oo]\ {0,1}([Cc]\/[Oo]\ )?[0-9]{1,4})|(([Aa][Ss][Cc][Nn]|[Bb][Bb][Nn][Dd]|[BFSbfs][Ii][Qq][Qq]|[Pp][Cc][Rr][Nn]|[Ss][Tt][Hh][Ll]|[Tt][Dd][Cc][Uu]|[Tt][Kk][Cc][Aa])\ {0,1}1[Zz][Zz]))$/;
		
		$('#postcode').require().match(regexp,"Postcode is invalid - eg. M60 1NW");
//		$.trim($('#postcode')).require().match(regexp,"Postcode is invalid - eg. M60 1NW");
	});
});

////////////////////////////
// jquery.konami.config //
////////////////////////////
$(document).konami(function(){alert('Konami Code Activated!')});
