

// clear default value in forms
function doClear(theText) {
	if (theText.value == theText.defaultValue) {
		theText.value = "";
	}
}
// undo clear of default value
function undoClear(theText) {
	if (theText.value == "") {
		theText.value = theText.defaultValue;
	}
}
// open external links in a new window ("target" is not valid XHTML strict)
function externallinks() {
                if (!document.getElementsByTagName) return;
                var anchors = document.getElementsByTagName("a");
                for (var i=0; i<anchors.length; i++) {
                        var anchor = anchors[i];
                        anchor.tabindex = i;
                        if (anchor.getAttribute("href") && 
anchor.getAttribute("rel") == "external")
                                anchor.target = "_blank";
                }
        }
function pageOpen() {
// slideshow
$(document).ready(function(){
    $('#navlocation').hide;
	$('#pause').click(function() { $('#slides').cycle('pause'); return false; });
    $('#play').click(function() { $('#slides').cycle('resume'); return false; });  
    $('#slideshow').hover(
        function() { $('#controls').fadeIn(); },
        function() { $('#controls').fadeOut(); }
    );   
    $('#slides').cycle({
        fx:     'fade',
        speed:   700,
        timeout: 5000,
        next:   '#next',
        prev:   '#prev'
    });
	$('#navlocation').hover(function() { $('#locationsubnav').fadeIn(); });   
});

// banner hover fx
$(document).ready(function(){

$("#banners li").hover(function() {
	$(this).css({'z-index' : '100'});
	$(this).find('img').addClass("hover").stop()
		.animate({
			marginTop: '-10px', 
			marginLeft: '-10px', 
			top: '5%',
			width: '110%', 
			height: '110%'
		}, 200);
	
	} , function() {
	$(this).css({'z-index' : '0'});
	$(this).find('img').removeClass("hover").stop()
		.animate({
			marginTop: '0', 
			marginLeft: '0',
			top: '0', 
			left: '0', 
			width: '260px', 
			height: '114px'
		}, 400);
	});
});

// GoogleAnalytics (1/2)
    var _gaq = _gaq || [];
  	_gaq.push(['_setAccount', 'UA-326367-14']);
  	_gaq.push(['_trackPageview']);
};
function pageClose() {
	Cufon.replace('#nav li a',{hover:true});
	Cufon.replace('#subnav li a',{hover:true});
	Cufon.replace('h2');
	Cufon.replace('h3');
	Cufon.replace('h4');
	Cufon.replace('.sidebar em');
	Cufon.replace('.sidebar p');
	Cufon.replace('.branches .book');
	Cufon.replace('.branches .map');
	Cufon.now();
// GoogleAnalytics (2/2)
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
};