/**
 *	Theme Name:	    iA³
 *	Theme URI:	    http://informationarchitects.jp/
 *	Author:		    Information Architects,Inc
 *	Version:	    1.2.1
 */

ia3={hasInitialized:function(){jQuery(".ielt9 *:first-child").addClass("firstChild");jQuery(".ielt9 *:last-child").addClass("lastChild");if(typeof twttr!=="undefined"&&typeof twttr.anywhere!=="undefined"){twttr.anywhere(function(A){A("a.twooser").hovercards({username:function(B){return B.text;}});A("img.twooser").hovercards({username:function(B){return B.alt;}});});}
jQuery(document).trigger("CORE:HAS_RESIZED");},hasResized:function(){var A=jQuery(document).width();if(A>1024){if(typeof jQuery.fancybox!=="undefined"){jQuery(".containsGallery a,.eStore-thumbnail a, a.enlarge").fancybox({'autoScale':'true','cyclic':'true','margin':'24','overlayColor':'#000','overlayOpacity':'0.666','padding':'0','transitionIn':'fade','transitionOut':'fade'});}
if(jQuery("#screen > header > form").length==1){jQuery("#screen > header > form").remove();}}else{if(typeof jQuery.fancybox!=="undefined"){jQuery(".containsGallery a,.eStore-thumbnail a, a.enlarge").unbind("click.fb");}
if(jQuery("#screen > header > form").length==0){jQuery("#footerOne > li:nth-child(1) > form").clone().insertBefore("#screen > header > h1");}
if(A>595){if(jQuery("#screen > header > form fieldset").length==2){jQuery("#screen > header > form fieldset:nth-child(2)").remove();}}else{if(jQuery("#screen > header > form fieldset").length==1){jQuery("#screen > header > form").append('<fieldset><label for="mobile-menu"></label><select id="mobile-menu"><option value="'+window.BASE_URL+'">Home</option></select><select id="mobile-lang"></select></fieldset>');jQuery("#screen > header > nav > ul").each(function(C){var B=jQuery(this),D=C+1;jQuery("li li a",B).each(function(){if(jQuery(this).parent().is("strong")){jQuery("#screen > header > form select:nth-of-type("+D+")").append('<option selected value="'+jQuery(this).attr("href")+'">'+jQuery(this).text()+"</option>");}else{jQuery("#screen > header > form select:nth-of-type("+D+")").append('<option value="'+jQuery(this).attr("href")+'">'+jQuery(this).text()+"</option>");}});});jQuery("#mobile-lang, #mobile-menu").change(function(){window.location.href=jQuery(this).val();});}}}},loadMap:function(){var coordinates=jQuery('#map').attr('class');var remP=new RegExp('[()]','gi');coordinates=coordinates.replace(remP,'');var coords=coordinates.split(',');var organisationName=jQuery('dt.url').html();var ordagnisatiomaddress=jQuery('address').html();if(GBrowserIsCompatible()&&document.getElementById("map")){var map=new GMap2(document.getElementById("map"));map.setCenter(new GLatLng(coords[0],coords[1]),16);var zoomControl=new GSmallZoomControl();map.addControl(zoomControl);var pointLocation=new GLatLng(coords[0],coords[1]);var baseIcon=new GIcon(G_DEFAULT_ICON);baseIcon.shadow="http://www.google.com/mapfiles/shadow50.png";baseIcon.iconSize=new GSize(20,34);baseIcon.shadowSize=new GSize(37,34);baseIcon.iconAnchor=new GPoint(9,34);baseIcon.infoWindowAnchor=new GPoint(9,2);markerOptions={icon:baseIcon};var marker=new GMarker(pointLocation,markerOptions);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml("<div style='color:black'>"+organisationName+'<br /><p>'+ordagnisatiomaddress+"</p></div>");});map.addOverlay(marker);}},foundTweetlist:function(){var D="",B={},C=jQuery("#containsTweets"),A=jQuery("#containsTwoosers");jQuery(document).bind("CORE:FOUND_TWEETS:FETCH",function(){jQuery.getJSON("http://search.twitter.com/search.json?callback=?&rpp=10&q="+D.replace(/\+OR\+$/,""),function(E){if(typeof E.results=="object"||typeof E.results=="array"){B=E.results;jQuery(document).trigger("CORE:FOUND_TWEETS:UPDATE");}});});jQuery(document).bind("CORE:FOUND_TWEETS:UPDATE",function(){C.empty();for(var E in B){var F=B[E];F.text=F.text.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/g,'<a href="$1">$1</a>');F.text=F.text.replace(/\@(\w+)/g,'<a class="twooser" href="http://twitter.com/$1">@$1</a>');C.append('<li><img alt="" src="'+F.profile_image_url+'" /><blockquote><p><a class="twooser" href="http://twitter.com/'+F.from_user+'">'+F.from_user+"</a>: "+F.text+'</p></blockquote><p><a href="http://twitter.com/'+F.from_user+"/status/"+F.id_str+'/">'+jQuery.timeago(new Date(F.created_at))+"</a></p></li>");}
setTimeout(function(){jQuery(document).trigger("CORE:FOUND_TWEETS:FETCH");},180000);});jQuery("li h2 a",A).each(function(){D+="from%3A"+jQuery(this).html()+"+OR+";});jQuery(document).trigger("CORE:FOUND_TWEETS:FETCH");}};jQuery(document).bind("CORE:HAS_INITIALIZED",ia3.hasInitialized).bind("CORE:HAS_RESIZED",ia3.hasResized).bind("CORE:FOUND_TWEETLIST",ia3.foundTweetlist).bind("CORE:LOAD_MAP",ia3.loadMap);
