
/*
 * LDMguide v0.0.1 - jQuery guides
 * Copyright (c) 2009 Launch Dynamic Media | launchdm.com
 * written by Sal Ferrarello
 *
 */
    
    jQuery.fn.ldmguide = function(values_vert, values_hor) {
        // create toggle link
        jQuery('body')
            .css('position','relative')
                .prepend(jQuery("<a href='###'>LDMguide Toggle</a>")
                    .css({
                        'background-color'  :   'white',
                        'color'             :   '#B5BE6B',
                        'text-decoration'   :   'underline',
                        'display'           :   'block',
                        'width'             :   '100px',
						'position'			:	'absolute'
                    }) // end css
                    .toggle(
                        function() {
                            jQuery('.ldmguide').hide();
                        },
                        function() {
                            jQuery('.ldmguide').show();
                        }) // end toggle
                 
            ); // end prepend
                
        // if values_vert exists assign it an array with one value, zero
        // otherwise keep the current values
        values_vert = (values_vert ? values_vert : ['0'] );

        // add guides (vertical)            
        var i = 0;
        while(i < values_vert.length)
        {
            jQuery(this)
                .css('position','relative')
                .prepend(jQuery("<div class='ldmguide'></div>")
                    .css({
                        'display'           :   'block',
                        'background-color'  :   'blue',
                        'position'          :   'absolute',
                        'z-index'           :   '9999',
                        'width'             :   '1px',
                        'height'            :   '2000px',
                        'left'              :   values_vert[i]+'px'
                    }) // .css
                ); // .css   
            i+=1;       
        } // end while
        // end add guides (vertical)    
        
        // if values_hor exists assign it an array with one value, zero
        // otherwise keep the current values
        values_hor = (values_hor ? values_hor : ['0'] );
                
        // add guides (horizontal)            
        var i = 0;
        while(i < values_hor.length)
        {
            jQuery(this)
                .css('position','relative')
                .prepend(jQuery("<div class='ldmguide'></div>")
                    .css({
                        'display'           :   'block',
                        'background-color'  :   'blue',
                        'position'          :   'absolute',
                        'z-index'           :   '9999',
                        'width'             :   '960px',
                        'height'            :   '1px',
                        'top'               :   values_hor[i]+'px',
                        /* css required for ie6 */
                        'overflow'          :   'hidden',
                        'line-height'       :   '0px',
                        'font-size'         :   '0px'
                    }) // .css
                ); // .css   
            i+=1;       
        } // end while
        // end add guides (horizontal)          
                  
    }  // jQuery.fn.ldmguide = function() {    
