/*------------------------------------------------------------------------------
    JS Document (https://developer.mozilla.org/en/JavaScript)

    project:    Vive le Jardin
    created:    2010-11-23
    author:     sanjus

    summary:    MAJX_CORE
                CONSTANTES
                UTILITIES
                WINDOW.ONLOAD
				PNGHACK
                PLACEHOLDER

----------------------------------------------------------------------------- */

/* =MAJX_CORE (http://code.google.com/p/majx-js/)
----------------------------------------------------------------------------- */
(function(){if(typeof majx=="undefined"){majx={};majx.init=function(){if(!majx.config){majx.config={};}}();}}());majx.set=function(){var e=arguments[0]||{};var b=null;var d=arguments.length;var c=1;if(d==c){e=majx.config;--c;}for(;c<d;c++){if((b=arguments[c])!=null){for(var a in b){var f=e[a];var g=b[a];if(e===g){continue;}else{if(g!==undefined){e[a]=g;}}}}}majx.config=e;};


/*  =CONSTANTES
----------------------------------------------------------------------------- */
jQuery.noConflict();
var d = document;
var w = window;
pm = {};
majx.set({
    firebuglite : {
        active : false, // disable (false) in production environment
        url : ''
    }
});


/*  =UTILITIES
----------------------------------------------------------------------------- */
var log = function(x) {
    if (typeof console != 'undefined') {
        console.log(x);
    }
};

var debuger = function(){
    if (majx.config.firebuglite.active && typeof console == 'undefined') {
        document.write('<script src="'+majx.config.firebuglite.url+'" type="text/javascript"></script>');
    }
}();


/*  =WINDOW.ONLOAD
----------------------------------------------------------------------------- */
jQuery(document).ready(function(){

    // Call Functions
    pm.placeholder();                 // placeholder for input fields

    if (jQuery.browser.msie && jQuery.browser.version == 6) {
        // IE 6 FUNCTIONS ONLY
    }

});


/*  =PNGHACK
----------------------------------------------------------------------------- */
// PNGHack 1.0.1 (2008-06-18)
// Copyright (c) 2008 Yves Van Goethem and png-hack project contributors
// http://code.google.com/p/png-hack/
// Distributed under MIT X11 License
document.write('<!--[if lte IE 6]><style type="text/css">.hack-png{visibility:hidden}</style><![endif]-->');var PNGHack=function(o){var p='http://pnghack.googlepages.com/spacer.gif';var q=function(f,g,h){if(h.checkIE&&!navigator.userAgent.match(h.checkIE))return;if(!f)f={};var d=f.scope||document;var j=(!f.elm&&g!=2)?d.all:d.getElementsByTagName(f.elm);var k=f.src||'src';var l=new RegExp((f.ext)?'\\w+.'+f.ext.toUpperCase():'\.PNG$');var m=function(a,b){var c=a.style;if(!a.pngsrc)h.elements.push(a);a.pngsrc=a.getAttribute(b);c.width=a.clientWidth;c.height=a.clientHeight;c.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.pngsrc+"',sizingMethod='scale')";if(h.remotehost==true)o=p;else if(h.remotehost!=false){var d=function(){a.setAttribute(b,p);};var e=function(){if(a.readyState=='complete'){a.detachEvent('onerror',d);a.detachEvent('onreadystatechange',e);}};a.attachEvent('onerror',d);a.attachEvent('onreadystatechange',e);}a.setAttribute(b,o||'images/spacer.gif');if(a.className.match(/\bhack-png\b/))var x=setTimeout(function(){a.className=a.className.replace(/hack-png/g,'');clearTimeout(x);		},300);};if(g==2){m(f.elm,k);return;}for(var i=0;i<j.length;++i){var n=j[i].getAttribute(k)||'';if(g==0&&j[i].className.match(/\bhack-png\b/)||(g==1&&n.toUpperCase().match(l)))m(j[i],k);}};return{hackClass:function(a){q(a,0,this);},hackExtension:function(a){q(a,1,this);},hackElement:function(a){q(a,2,this);},elements:[],checkIE:'MSIE 5\.5|MSIE 6',remotehost:null};};

ph = new PNGHack('img/pixel.png');
	window.onload = function() {
	ph.hackClass();
};


/*  =PLACEHOLDER
----------------------------------------------------------------------------- */
pm.placeholder = function(){
    jQuery('input[type=text], input[type=search], textarea').each(function(i){
    
        var that = jQuery(this);
        that.val(that.attr('title'));
        
        // only for webkit, thank you Steve
        that.bind('mouseup', function(e){
            e.preventDefault();
        });

        that.bind('focus', function(e){
            //if (that.val() == that.attr('title')){
                 that.select();
            //}
        });
        
        that.bind('blur', function(e){
            // refill if empty
            if (!/[a-zA-Z0-9]/.test(that.val())) that.val(that.attr('title'));
            
        });
    });
};


