# Surgeweb newlook module that tweaks default surgeweb to get the "standard" look

(function(){
	var obj = { 
			central_css:central_css, populate_message:populate_message
	};

	newlook_register('standard', 'standard', obj, {alt:false});
	//window.plain_look = obj;
		
	function central_css(src,cs)
	{
		var txt = '';	

		if(src=='default'){
	
			txt += '||css_begin()||\
				#banner_img { position:absolute; top:0;left:0;width:400px;height:50px; }
				.left_panel_header, .toolbar { background: url(||www_base||shared/img/gradient_big.gif?||vz||);}

				#lpanel_mail .flist_link{
					display:none;
				}

			||css_end()||';

||if_not(newlook_banner_gradient_disable)||
			txt += '#top_banner.modern { background-image: linear-gradient(90deg,#a076b4 0%,#00afef 50%,#91ce9b 100%);}';
||endif||
			
			if('||logo||'!='default' && '||logo||'!='none'){
				sw.custom_logo = true; 			// also see custom_bg_init
			}
			if(sw.custom_logo){
				txt += '||css_begin()||\
					#banner_img {background:url(||www_base||custom/||logo||?||vz||) no-repeat;}
					#modern_title_text{ display:none; }
				||css_end()||';
			}		
			if(pref.scrollbar_type=='modern'){
				txt += '#message_preview{overflow-y:hidden !important; overflow-x:hidden !important;}';  
			}

||if_not(newlook_body_gradient_disable)||
			cs.page_background_css = 'background: #A0BFE8 url(||www_base||shared/img/gradient_huge.jpg?||vz||) repeat-x;'
||endif||
# a radial gradient for pretty colouring??	
			txt+=' #page_width { background: radial-gradient(ellipse at 30% 30%, white, #6699c2 125%) fixed; _background-opacity:100%;}';

			cs.border_color_css = '||border_color||';



			return txt;
		}else if(src=='anycolor'){
		
		}else if(src=='dark'){
			col = rgb2hsl(txt2col('#272822')); //obj.cur_col_hsl;

			cs.bg_center = col; //rgb2hsl(txt2col('#272822')); //hsl_init(0,0,1);
			cs.bg_outer = col;
				cs.msghdr_reading = hsl_init(col[hsl_h],col[hsl_s]+0.25,0.92);
				cs.msghdr_compose = hsl_init(col[hsl_h],col[hsl_s]+0.25,0.91);
				cs.appmenu_dark = hsl_modulate(col,0,-0.2,-0.1);
				cs.ac_sel = hsl_modulate(col,0,+0.1,+0.7);
				cs.ac_bg = hsl_modulate(col,0,+0.1,+0.9);
				cs.ac_panel = hsl_modulate(col,0,+0.1,+0.7);
			cs.border = col;

				cs.page_background_css = 'background: '+hsl_out(cs.bg_center)+';';
				cs.border_color_css = hsl_out(cs.border);


				txt += '#app_menu div { background: '+hsl_out(cs.appmenu_dark)+';}';
				txt += '#msg_headers, .msg_headers { background: '+hsl_out(cs.msghdr_reading)+';}';
				txt += '.compose { background: '+hsl_out(cs.msghdr_compose)+';}';	
				txt += '#ac { background: '+hsl_out(cs.ac_bg)+';}' 
				txt += '#ac span.sel{  background:'+hsl_out(cs.ac_sel)+';}';
				txt += '.contacts_picker, .contacts_picker_edge{  background:'+hsl_out(cs.ac_panel)+';}';

			cs.col = col;
			cs.col1 = hsl_modulate(col,0,0,0.1);
			cs.col2 = hsl_modulate(col,0,0,0.2);
			cs.col3 = hsl_modulate(col,0,0,0.3);
			cs.col4 = hsl_modulate(col,0,0,0.4);
			cs.col5 = hsl_modulate(col,0,0,0.5);
			cs.col6 = hsl_modulate(col,0,0,0.6);
			cs.col7 = hsl_modulate(col,0,0,0.7);
			cs.col8 = hsl_modulate(col,0,0,0.8);
			cs.col9 = hsl_modulate(col,0,0,0.9);
			cs.col9a = hsl_modulate(col,0,0,0.95);

			var left_bg = cs.col3;
			var center_bg = cs.col2;
			var sel_bg = cs.col1;


#			Top right text		
			txt += '#link_bar, #link_bar a{ color: white; }';
			txt += '.left_panel_header {background:white}';
			txt += '.toolbar { background:'+hsl_out(cs.col2)+';}';
			txt += '.mw_menu, .mnu_foldername,.menu_extra, .xwide { color: white; }';
			txt += '.top_line .rnd1 {background:'+hsl_out(cs.col3)+' !important}';

#			Left panel css
			txt += '#lpanel_body{ background:'+hsl_out(left_bg)+' }';
			txt += '#folders .part_cursor a{color:white;}';
			txt += '#folders .part_cursor:hover, #folders .part_cursor a:hover {color:white; background:'+hsl_out(sel_bg)+'}';	
			txt += '.ftree .selected{color:white; background:'+hsl_out(sel_bg)+';}';		
			txt += '#folders li{border-bottom: 1px solid '+hsl_out(cs.col1)+' !important;}';
			txt += '.ftree{color:white;}';
			txt += '.folder_green_text{color:white;}';
			txt += '.flist_link, .ftree a, .ftree a:visited{color:'+hsl_out(cs.col8)+'; !important}';
			txt += '.fld_link {border-bottom:1px solid '+hsl_out(cs.col1)+';}';
			txt += '.folders_loading, .messages_loading {color:white !important;}';

#	 		Message list css
			txt += '#msglist_box{background:'+hsl_out(center_bg)+' }';
			txt += '#msglist_box a {color:white !important}';
			txt += '.snippet {color: '+hsl_out(cs.col7)+' !important}';
			txt += '.wxc {color:white !important;}';
			txt += '.msgs_line td {border-bottom: 1px solid '+hsl_out(cs.col1)+' !important;}';
			txt += '.nomessages {color:white !important;}';
			txt += '.msglist_nav, #msg_navigator {color:white !important;}';
			txt += '.msgs_line td {color:white !important;}';

			txt += '.msgs_line:hover td{ background:'+hsl_out(cs.col1)+' !important}';
			txt += '#messages_list .selected{background:'+hsl_out(cs.col1)+' !important}';
			txt += '.msgs_line.selected:hover td { background:'+hsl_out(cs.col1)+'  !important;}';

			txt += '#message_preview{ background:black !important; }';
			txt += '#msg_headers{color:#BBB;}';
			txt += '.sw_message {color:white;background:black;}';
			txt += '.raw_links {color:white;background:black;}';
			txt += '#messages a, #messages a:visited {color:white}';

			txt += '.mnu {color:white;background:black; border:1px solid black;}';
			
			txt += '#app_menu .mnu {color:white;background:black; border:1px solid black;}';
			txt += '.act_panel {color:white; background:'+hsl_out(cs.col2)+'; border-bottom: '+hsl_out(cs.col2)+' 1px solid;}';
			txt += '#accounts { border-top: '+hsl_out(cs.col2)+' 1px solid; }';
			txt += '.lpanel_style {background:'+hsl_out(cs.col2)+' !important;}';
			txt += '.lpanel_style a {color:white !important;}';
			txt += '.left_panel_header {background:'+hsl_out(cs.col2)+'}';
			txt += '.border_lift {border-top:1px solid '+hsl_out(cs.col3)+' !important;}';
			txt += '.left_panel_header{color:white;}';
			txt += '.swish_edit_outer{background:'+hsl_out(cs.col8)+'}';
			txt += '#switcher .selected .amsg_class{background:'+hsl_out(cs.col8)+'}';
			txt += '.pg_title{color:white;}'
			
			txt += '.compose{}'

			return txt;		
		}else{
			return '';
		}

		var col = cs.one_color;
		if(col[hsl_l]>0.75) col[hsl_l]=0.75;
			
		cs.bg_center = hsl_init(0,0,1);
		cs.bg_outer = col;
		cs.msghdr_reading = hsl_init(col[hsl_h],col[hsl_s]+0.25,0.92);
		cs.msghdr_compose = hsl_init(col[hsl_h],col[hsl_s]+0.25,0.91);
		cs.appmenu_dark = hsl_modulate(col,0,-0.2,-0.1);
		cs.ac_sel = hsl_modulate(col,0,+0.1,+0.7);
		cs.ac_bg = hsl_modulate(col,0,+0.1,+0.9);
		cs.ac_panel = hsl_modulate(col,0,+0.1,+0.7);
		cs.border = hsl_modulate(col,0,-0.6,+0.2);	cs.border[hsl_l]=Math.max(cs.border[hsl_l],0.5);

		cs.page_background_css = 'background: radial-gradient(ellipse at 35% 30%, '+hsl_out(cs.bg_center)+', '+hsl_out(cs.bg_outer)+' 125%) fixed;';
		cs.border_color_css = hsl_out(cs.border);

		txt += '#app_menu div { background: '+hsl_out(cs.appmenu_dark)+';}';
		txt += '#msg_headers, .msg_headers { background: '+hsl_out(cs.msghdr_reading)+';}';
		txt += '.compose { background: '+hsl_out(cs.msghdr_compose)+';}';	
		txt += '#ac { background: '+hsl_out(cs.ac_bg)+';}' 
		txt += '#ac span.sel{  background:'+hsl_out(cs.ac_sel)+';}';
		txt += '.contacts_picker, .contacts_picker_edge{  background:'+hsl_out(cs.ac_panel)+';}';

//		txt += extra_msg_padding();

		return txt;
	}

	function populate_message()
	{
		var revert_main=U;
		if(!sw.is_popup && sw.active /*&& nodeid!=sw.active.id*/){
			window_manager_minimise(sw.active, revert_main);
		}
	}

})();
# NO CODE BELOW HERE