
$j(document).ready(setupPage);

function setupPage(){
	//var sh_win = window_factory($('sh_window'));
	//var cop_win = window_factory($('cop_window'), {offsetLeft:-300}); 
} 

//styled examples use the window factory for a shared set of behavior  
var window_factory = function(container,options){  
    var window_header = new Element('div',{  
        className: 'window_header'  
    });  
    var window_title = new Element('div',{  
        className: 'window_title'  
    });  
    var window_close = new Element('div',{  
        className: 'window_close'  
    });  
    var window_contents = new Element('div',{  
        className: 'window_contents'  
    });  
    var w = new Control.Window(container,Object.extend({  
        className: 'relative',
		position:'relative',
        closeOnClick: window_close,  
        draggable: window_header,
		fade:true,
		fadeDuration:0.75,
		offsetLeft:420,
		closeOnClick:true,
        insertRemoteContentAt: window_contents,  
        afterOpen: function(){  
            window_title.update(container.readAttribute('title'))
			container.addClassName('active');
        } ,
		afterClose: function(){
			container.removeClassName('active');
		}
    },options || {}));  
    w.container.insert(window_header);  
    window_header.insert(window_title);  
    window_header.insert(window_close);  
    w.container.insert(window_contents);  
    return w;  
}; 
