/*
    SiteComponents version:
    6.7.0.1, tag SC_6_7_0_1, created Mon May 10 09:27:59 +0200 2010

    Disclaimer
    
    While we make every effort to ensure that this code is fit for its intended
    purpose, we make no guarantees as to its functionality. CoreTrek AS will
    accept no responsibility for the loss of data or any other damage or
    financial loss caused by use of this code.


    Copyright
    
    This programming code is copyright of CoreTrek AS. Permission to run this
    code is given to approved users of CoreTrek's publishing system CorePublish.
    
    This source code may not be copied, modified or otherwise repurposed for use
    by a third party without the written permission of CoreTrek AS.
    
    Contact webmaster@coretrek.com for information.
    
*/

/**
 * Configuration for site components javascript
 *
 * Configuration array structure:
 * {<component>: {<parameter>: value, <parameter>: value, ... }, ...}
 */
var siteComponentsConfig = {
    
    // Configuration for the keyword module.
    
    keywords: {
        elements: ['placeholder-content'],
        skiptags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
        usetooltip: true
    }
    // Remember to add a comma above when enabling more options
    
    /*
    // Valid keys:
    //    disable: true/false (default enabled)
    //    collapsedPageInfoPosition: Use this to move the collapsed debug
    //                               position to the left, instead of the
    //                               default right.
    debug: {
        disable: true,
        collapsedPageInfoPosition: 'right'
    }
    */
    
    /*
    // Configuration for tooltop.
    // 
    // Valid keys:
    //    disable: true/false (default enabled)
    //    positionby: Use this to override the default position for tooltip.
    //                Valid values is:
    //                  mouse (default), tooltip follows mouse
    //                  element, tooltip is attached to the title element
    tooltip: {
        disable: false,
        positionby: 'mouse'
    }
    */
    
    /*
    // Use this to override the default fontsizes in the fontsize selector
    // (html/lib/fontsize.js)
    
    fontsize: {
        sizes: ["10pt", "15pt", "24pt"]
    }
    */
    
};

function autoLabel() {
	$$('.autolabel').each( function(field) {
		var defaultValue = field.value;
		
		field.observe('focus', function(event) {
			field.setValue('');
			field.removeClassName('blurred');
			field.addClassName('focused');
		});
	
		field.observe('blur', function(event) {
			if (field.value.length == 0) {
				field.setValue(defaultValue);
				field.removeClassName('focused');
				field.addClassName('blurred');
			}
		});
	});
}

/*
document.observe("dom:loaded", function() {
	autoLabel();
});
*/

