/* --------------------------------- Text Classes --------------------------- */

<?PHP

global $User;

$BaseFontSize = ($User->PrefFontSize() > 0) ? $User->PrefFontSize() : 11;
$BaseFontTypeFace = strlen($User->PrefFontTypeFace()) ? $User->PrefFontTypeFace() : "Verdana, Arial, Geneva, Helvetica, sans-serif";

$PrefFontColor = $User->PrefFontColor();
$PrefBackgroundColor = $User->PrefBackgroundColor();
if ($User->PrefColorAvoidanceFlags() & SPTUser::UIPREF_AVOID_USEMAXMONOCHR)
{
    $PrefFontColor = "Black";
    $PrefBackgroundColor = "White";
}

# alternate shades of HTML colors (for links and areas that need a different background color)
$AltHtmlColorList = array(
        "aliceblue" =>            "#A0A8AF", # (#F0F8FF),
        "antiquewhite" =>         "#AA9B87", # (#FAEBD7),
        "aqua" =>                 "#00AFAF", # (#00FFFF),
        "aquamarine" =>           "#2FAF84", # (#7FFFD4),
        "azure" =>                "#A0AFAF", # (#F0FFFF),
        "beige" =>                "#A5A58C", # (#F5F5DC),
        "bisque" =>               "#AF9474", # (#FFE4C4),
        "black" =>                "#505050", # (#000000),
        "blanchedalmond" =>       "#AF9B7D", # (#FFEBCD),
        "blue" =>                 "#5050FF", # (#0000FF),
        "blueviolet" =>           "#3A2B92", # (#8A2BE2),
        "brown" =>                "#F57A7A", # (#A52A2A),
        "burlywood" =>            "#8E6837", # (#DEB887),
        "cadetblue" =>            "#0F4E50", # (#5F9EA0),
        "chartreuse" =>           "#CFFF50", # (#7FFF00),
        "chocolate" =>            "#D2B96E", # (#D2691E),
        "coral" =>                "#FFCFA0", # (#FF7F50),
        "cornflowerblue" =>       "#14459D", # (#6495ED),
        "cornsilk" =>             "#AFA88C", # (#FFF8DC),
        "crimson" =>              "#DC648C", # (#DC143C),
        "cyan" =>                 "#00AFAF", # (#00FFFF),
        "darkblue" =>             "#5050DB", # (#00008B),
        "darkcyan" =>             "#003B3B", # (#008B8B),
        "darkgoldenrod" =>        "#68360B", # (#B8860B),
        "darkgray" =>             "#595959", # (#A9A9A9),
        "darkgreen" =>            "#50B450", # (#006400),
        "darkkhaki" =>            "#6D671B", # (#BDB76B),
        "darkmagenta" =>          "#3B003B", # (#8B008B),
        "darkolivegreen" =>       "#A5BB7F", # (#556B2F),
        "darkorange" =>           "#AF3C00", # (#FF8C00),
        "darkorchid" =>           "#49327C", # (#9932CC),
        "darkred" =>              "#DB5050", # (#8B0000),
        "darksalmon" =>           "#99462A", # (#E9967A),
        "darkseagreen" =>         "#3F6C3F", # (#8FBC8F),
        "darkslateblue" =>        "#988DDB", # (#483D8B),
        "darkslategray" =>        "#7F9F9F", # (#2F4F4F),
        "darkturquoise" =>        "#007E81", # (#00CED1),
        "darkviolet" =>           "#440083", # (#9400D3),
        "deeppink" =>             "#AF1443", # (#FF1493),
        "deepskyblue" =>          "#006FAF", # (#00BFFF),
        "dimgray" =>              "#B9B9B9", # (#696969),
        "dodgerblue" =>           "#1E40AF", # (#1E90FF),
        "feldspar" =>             "#814225", # (#D19275),
        "firebrick" =>            "#B27272", # (#B22222),
        "floralwhite" =>          "#AFAAA0", # (#FFFAF0),
        "forestgreen" =>          "#72DB72", # (#228B22),
        "fuchsia" =>              "#AF00AF", # (#FF00FF),
        "gainsboro" =>            "#8C8C8C", # (#DCDCDC),
        "ghostwhite" =>           "#A8A8AF", # (#F8F8FF),
        "gold" =>                 "#AF8700", # (#FFD700),
        "goldenrod" =>            "#8A5520", # (#DAA520),
        "gray" =>                 "#303030", # (#808080),
        "green" =>                "#50D050", # (#008000),
        "greenyellow" =>          "#5DAF2F", # (#ADFF2F),
        "honeydew" =>             "#A0AFA0", # (#F0FFF0),
        "hotpink" =>              "#AF1964", # (#FF69B4),
        "indianred" =>            "#CDACAC", # (#CD5C5C),
        "indigo" =>               "#9B50D2", # (#4B0082),
        "ivory" =>                "#AFAFA0", # (#FFFFF0),
        "khaki" =>                "#A0963C", # (#F0E68C),
        "lavender" =>             "#9696AA", # (#E6E6FA),
        "lavenderblush" =>        "#AFA0A5", # (#FFF0F5),
        "lawngreen" =>            "#CCFC50", # (#7CFC00),
        "lemonchiffon" =>         "#AFAA7D", # (#FFFACD),
        "lightblue" =>            "#5D8896", # (#ADD8E6),
        "lightcoral" =>           "#A03030", # (#F08080),
        "lightcyan" =>            "#90AFAF", # (#E0FFFF),
        "lightgoldenrodyellow" => "#AAAA82", # (#FAFAD2),
        "lightgrey" =>            "#838383", # (#D3D3D3),
        "lightgreen" =>           "#409E40", # (#90EE90),
        "lightpink" =>            "#AF6671", # (#FFB6C1),
        "lightsalmon" =>          "#AF502A", # (#FFA07A),
        "lightseagreen" =>        "#20625A", # (#20B2AA),
        "lightskyblue" =>         "#377EAA", # (#87CEFA),
        "lightslateblue" =>       "#3420AF", # (#8470FF),
        "lightslategray" =>       "#273849", # (#778899),
        "lightsteelblue" =>       "#60748E", # (#B0C4DE),
        "lightyellow" =>          "#AFAF90", # (#FFFFE0),
        "lime" =>                 "#50FF50", # (#00FF00),
        "limegreen" =>            "#82CD82", # (#32CD32),
        "linen" =>                "#AAA096", # (#FAF0E6),
        "magenta" =>              "#AF00AF", # (#FF00FF),
        "maroon" =>               "#D05050", # (#800000),
        "mediumaquamarine" =>     "#167D5A", # (#66CDAA),
        "mediumblue" =>           "#5050CD", # (#0000CD),
        "mediumorchid" =>         "#6A0583", # (#BA55D3),
        "mediumpurple" =>         "#432088", # (#9370D8),
        "mediumseagreen" =>       "#8CB3C1", # (#3CB371),
        "mediumslateblue" =>      "#CBB8EE", # (#7B68EE),
        "mediumspringgreen" =>    "#00AA4A", # (#00FA9A),
        "mediumturquoise" =>      "#48817C", # (#48D1CC),
        "mediumvioletred" =>      "#771535", # (#C71585),
        "midnightblue" =>         "#6969C0", # (#191970),
        "mintcream" =>            "#A5AFAA", # (#F5FFFA),
        "mistyrose" =>            "#AF9491", # (#FFE4E1),
        "moccasin" =>             "#AF9465", # (#FFE4B5),
        "navajowhite" =>          "#AF8E5D", # (#FFDEAD),
        "navy" =>                 "#5050D0", # (#000080),
        "oldlace" =>              "#ADA596", # (#FDF5E6),
        "olive" =>                "#303000", # (#808000),
        "olivedrab" =>            "#BBDE73", # (#6B8E23),
        "orange" =>               "#AF5500", # (#FFA500),
        "orangered" =>            "#FF9550", # (#FF4500),
        "orchid" =>               "#8A2086", # (#DA70D6),
        "palegoldenrod" =>        "#9E985A", # (#EEE8AA),
        "palegreen" =>            "#48AB48", # (#98FB98),
        "paleturquoise" =>        "#5F9E9E", # (#AFEEEE),
        "palevioletred" =>        "#882043", # (#D87093),
        "papayawhip" =>           "#AF9F85", # (#FFEFD5),
        "peachpuff" =>            "#AF8A69", # (#FFDAB9),
        "peru" =>                 "#7D353F", # (#CD853F),
        "pink" =>                 "#AF707B", # (#FFC0CB),
        "plum" =>                 "#8D508D", # (#DDA0DD),
        "powderblue" =>           "#609096", # (#B0E0E6),
        "purple" =>               "#300030", # (#800080),
        "red" =>                  "#FF5050", # (#FF0000),
        "rosybrown" =>            "#6C3F3F", # (#BC8F8F),
        "royalblue" =>            "#91B9E1", # (#4169E1),
        "saddlebrown" =>          "#DB9563", # (#8B4513),
        "salmon" =>               "#AA3022", # (#FA8072),
        "sandybrown" =>           "#A45410", # (#F4A460),
        "seagreen" =>             "#7EDBA7", # (#2E8B57),
        "seashell" =>             "#AFA59E", # (#FFF5EE),
        "sienna" =>               "#F0A27D", # (#A0522D),
        "silver" =>               "#707070", # (#C0C0C0),
        "skyblue" =>              "#377E9B", # (#87CEEB),
        "slateblue" =>            "#BAAACD", # (#6A5ACD),
        "slategray" =>            "#203040", # (#708090),
        "snow" =>                 "#AFAAAA", # (#FFFAFA),
        "springgreen" =>          "#50FFCF", # (#00FF7F),
        "steelblue" =>            "#463264", # (#4682B4),
        "tan" =>                  "#82643C", # (#D2B48C),
        "teal" =>                 "#003030", # (#008080),
        "thistle" =>              "#886F88", # (#D8BFD8),
        "tomato" =>               "#FFB397", # (#FF6347),
        "turquoise" =>            "#409080", # (#40E0D0),
        "violet" =>               "#9E329E", # (#EE82EE),
        "violetred" =>            "#802040", # (#D02090),
        "wheat" =>                "#A58E63", # (#F5DEB3),
        "white" =>                "#AFAFAF", # (#FFFFFF),
        "whitesmoke" =>           "#A5A5A5", # (#F5F5F5),
        "yellow" =>               "#AFAF00", # (#FFFF00),
        "yellowgreen" =>          "#4A7D32", # (#9ACD32),
	);

if (strlen($PrefFontColor))
{
    $BaseFontColor = preg_replace("/\s+/", "", $PrefFontColor);
    if (isset($AltHtmlColorList[strtolower($BaseFontColor)]))
    {
        $AltFontColor = $AltHtmlColorList[strtolower($BaseFontColor)];
    }
    else
    {
        $AltFontColor = $BaseFontColor;
    }
}
else
{
    $BaseFontColor = "#333333";
    $AltFontColor = "#333399";
}

$BackgroundColorAttrib = "";
if (strlen($PrefBackgroundColor))
{
    $BaseBackgroundColor = preg_replace("/\s+/", "", $PrefBackgroundColor);
    $BackgroundColorAttrib = "background: ".$BaseBackgroundColor.";\n";

    if (isset($AltHtmlColorList[strtolower($BaseBackgroundColor)]))
    {
        $AltBackgroundColorAttrib = "background: ".$AltHtmlColorList[strtolower($BaseBackgroundColor)].";\n";
    }
    else
    {
        $AltBackgroundColorAttrib = $BackgroundColorAttrib;
    }
}


?>

/* Base font and font-size for all portal pages */
.text, p, td, tr, body, div, dt, dd, li, a, a:link, a:hover, a:visited
{
	font-size: <?PHP  print($BaseFontSize);  ?>px;
	font-family: <?PHP  print($BaseFontTypeFace);  ?>;
  	_font-size:  <?PHP  print(number_format($BaseFontSize*0.0927, 2, ".", ""));  ?>em; /* Allows text resizing in IE */
}

/* base color and decoration */
.text, p, td, tr, body, div, dt, dd, li
{
	text-decoration: none;
	color: <?PHP  print($BaseFontColor);  ?>;
	<?PHP  print($BackgroundColorAttrib);  ?>
}

/* Base styles for links*/
A:link, A:visited, A:link.link, A:visited.link
{
	text-decoration: none;
	color: <?PHP  print($AltFontColor);  ?>;
}

A:hover, A:hover.link
{
	text-decoration: underline;
	color: <?PHP  print($AltFontColor);  ?>;
}


/*
    The header class is used for headers throughout CWIS.
    For example, the headlines of the two news areas on
    SPT--Home use the header class.
*/
A:link.header, A:visited.header
{
	font-size: <?PHP  print($BaseFontSize + 3);  ?>px;
	text-decoration: none;
	font-weight: bold;
	color: <?PHP  print($AltFontColor);  ?>;
}
A:hover.header
{
	font-size: <?PHP  print($BaseFontSize + 3);  ?>px;
	text-decoration: underline;
	font-weight: bold;
	color: <?PHP  print($AltFontColor);  ?>;
}
.header
{
	font-size: <?PHP  print($BaseFontSize + 3);  ?>px;
	text-decoration: none;
	font-weight: bold;
	color: <?PHP  print($BaseFontColor);  ?>;
}



/*
    The pagetitle class is used for the portal name displayed at the
    top of every page (SPT--StandardPageStart.html)
*/
.pagetitle
{
	font-size: <?PHP  print($BaseFontSize + 3);  ?>px;
	text-decoration: none;
	font-weight: bold;
    <?PHP  if (strlen($PrefFontColor)) {
               print("color: ".$AltFontColor.";\n");
           }
	   else
	   {?>
	color: #FFFFFF;
    <?PHP  }  ?>
}

/*
    The KeywordTitle class and #searchForm span styles the phrase "Keyword Search" at the
    top of every page (SPT--StandardPageStart.html)
*/
.KeywordTitle, #SearchForm span
{
	text-decoration: none;
	<?PHP  if (strlen($PrefFontColor)) {
               print("color: ".$AltFontColor.";\n");
           }
	   else
	   {?>
	color: #666;
    <?PHP  }  ?>
	font-weight: bold;
	display: block;
}

/*
    form#SearchForm styles the the entire search form at the top of every page.
    (SPT--StandardPageStart.html)
*/
form#SearchForm {
    float: right;
    color: #666;
    font-size: 11px;
    font-weight: bold;
    margin-top: 20px;
    padding-right: 11px;
    width: 170px;
}


/*
    #goButton styles the submit button of the search form at the top of every page.
    (SPT--StandardPageStart.html)
*/
#goButton {
    float: right;
    padding-top: 16px;
}

/*
    #SearchText styles the text box that is part of the search at the top of every page.
    (SPT--StandardPageStart.html)
*/
input#SearchText {
    width: 135px;
    height: 12px;
    margin-top: 3px;
}

/*
    The whitenav class styles the navigation options on the right side
    of every page (SPT--StandardPageEnd.html)
*/
.whitenav, A:link.whitenav, A:visited.whitenav
{
	text-decoration: none;
    line-height: 40px;
    <?PHP  if (strlen($PrefFontColor)) {
               print("color: ".$AltFontColor.";\n");
           }
	   else
	   {?>
    color: #FFFFFF;
    <?PHP  }  ?>
	margin-left: 20px;
	font-weight: bold;
}

A:hover.whitenav
{
	text-decoration: underline;
    line-height: 40px;
    <?PHP  if (strlen($PrefFontColor)) {
               print("color: ".$AltFontColor.";\n");
           }
	   else
	   {?>
    color: #FFFFFF;
    <?PHP  }  ?>
	margin-left: 20px;
	font-weight: bold;
}


li
{
   	padding: 3px;
}

/* LightRow and DarkRow are used when we want alternating row colors  */
.LightRow {
    background: #F2F9FA;;
}
.DarkRow {
    background: #EAF1F3;
}



/* --------------------------------- Structure ----------------------------- */

body {
   margin: 0px;
   padding: 0px;
   color: #000;
   height: 100%;
   width: 100%;
}

/*
    The AdvSearchBox class styles colored boxes throughout the
    portal. The Advanced Search page, for example, uses this style
    for the area with the title "Enter your search"
*/
.AdvSearchBox
{
    <?PHP  if (strlen($PrefBackgroundColor)) {
               print($AltBackgroundColorAttrib);
           }
	   else
	   {?>
    background: #EAF1F3;
    <?PHP  }  ?>
    position: relative;
    padding: 10px;
    border: 1px solid #DDDDDD;
    margin: 0px;
}

.AdvSearchBox select
{
	font-size: <?PHP  print($BaseFontSize);  ?>px;
	font-family: <?PHP  print($BaseFontTypeFace);  ?>;
}

/*
    The GradientBackground class styles heading areas throughout the
    site. For example, this class styles the "Available Forums" heading
    on the SPT--Forums.php.
*/
.GradientBackground
{
    background: #FFF url("../images/resource_gradient.gif") repeat-x center bottom;
}

/* --------------------------------- Common Nav ---------------------------- */
/*
    These styles control the basic two-column format of every page
    ( SPT--StandardPageStart.html, SPT--StandardPageEnd.html )
*/
#navbodyframe {
   position:relative;
   clear:both;
   margin: 0px;
   padding: 0px;
}
#navleftcolumn {
   margin-right: 190px;
}
#navrightcolumn {
   position: absolute;
   top: 0px;
   padding: 0px;
   width: 190px;
   right: 0px;
}
.rightnav {
    width: 170px;
    padding: 10px;
    text-align: left;
    <?PHP  if (strlen($PrefBackgroundColor)) {
               print($AltBackgroundColorAttrib);
           }
	   else
	   {?>
    background: #DDDDDD;
    <?PHP  }  ?>
    border-top: 10px solid white;

}
.RightNavBottom {
    <?PHP  if (strlen($PrefBackgroundColor)) {
               print($AltBackgroundColorAttrib);
           }
	   else
	   {?>
    background: #F0F0F0;
    <?PHP  }  ?>
}

/* --------------------------------- Top Nav ----------------------------- */

#header {
   <?PHP  if (!strlen($PrefBackgroundColor)) {  ?>
   background: url("../images/header.gif");
   <?PHP  }  ?>
   padding: 0px;
   border-top: 4px solid #7B7B7B;
   height: 90px;
}
#navbar {
    <?PHP  if (strlen($PrefBackgroundColor)) {
               print($AltBackgroundColorAttrib);
           }
	   else
	   {?>
   background: #7A7A8F;
    <?PHP  }  ?>
   border: 1px solid #2A4F5E;
}

/* --------------------------- SPT--Home --------------------------------*/
/*
    These styles are used on SPT--Home to contain the New Resources
    and Announcements areas
*/
#contentframe {
	position: static;
	margin: 20px 20px 20px 20px;
	clear: both;
}

/* This is a hack */

div>#contentframe
{
    position: relative;
}
#contentbox {
	position: relative;
}
#ResourceBox {

   border: 5px solid #DDDDDD;
   padding: 0px;
}

/*
    The styles the "New Resources" heading area.
*/
#ResourceHeaderBox {
    <?PHP  if (strlen($PrefBackgroundColor)) {
               print($AltBackgroundColorAttrib);
           }
	   else
	   {?>
   background: #FFF url("../images/resource_gradient.gif");
    <?PHP  }  ?>
   height: 25px;
   line-height: 25px;
	font-size: <?PHP  print($BaseFontSize + 1);  ?>px;
	text-decoration: none;
	font-weight: bold;
	padding-left: 10px;
}

/* ---------------------------- Resources ---------------------------- */

/*
    The ResourceHeader class is used for the title of resources
    printed using the PrintResource function in SPT--Common.html
*/
A:link.ResourceHeader, A:visited.ResourceHeader, .ResourceHeader
{
	color: <?PHP  print($BaseFontColor);  ?>;
	margin-bottom: 15px;
}
.A:hover.ResourceHeader
{
	color: <?PHP  print($BaseFontColor);  ?>;
	margin-bottom: 15px;
}

/*
    RatingDiv contains the fast user rating graphic and text
    in PrintResource
*/
div.RatingDiv
{
    float: right;
    width: 75px;
    padding: 0px;
    font-size: 10px;
    text-align: right;
    line-height: 27px;
}
div.RatingDiv img
{
    margin-top: 5px;
}
/* ---------------------------- Footer ---------------------------- */

#footer {
    <?PHP  if (strlen($PrefBackgroundColor)) {
               print($AltBackgroundColorAttrib);
           }
	   else
	   {?>
   background: #B3B3B3;
    <?PHP  }  ?>
   border: 1px solid #B3B3B3;
   margin-top: 10px;
   position: relative;
}

/*
    The BottomNav class styles the text in the footer of each page.
    (SPT--StandardPageEnd.html)
*/
.BottomNav
{
    font-size: <?PHP  print($BaseFontSize);  ?>px;
    line-height: 13px;
    margin: 16px 0 16px 20px;
    color: <?PHP  print($BaseFontColor);  ?>;
}

/*
    These control the position of the two small logos in the lower right
    corner of the page.
*/
#footer img#CWISLogo
{
    float: right;
    margin: 12px 10px 0px 0px;
    border: 0px;
}

#footer img#NSDLLogo
{
    float: right;
    margin: 12px 15px 0px 0px;
    border: 0px;
}

/* ------------ Help System Navigation ----------------- */

/*
    There are two styles of Help navigation in the portal. The
    first displays navigation options as a stack of list items
    and is styled by the HelpNav class. The second displays navigation
    options as a linear arangement of list items and is styled by
    the HelpNavLinear class
*/

ul.HelpNav
{
    list-style: none;
    width: 180px;
	border: 1px solid #DDDDDD;
    <?PHP  if (strlen($PrefBackgroundColor)) {
               print($AltBackgroundColorAttrib);
           }
	   else
	   {?>
 	background: #EAF1F3;
    <?PHP  }  ?>
 	padding: 0;
 	float: left;
 	margin: 10px;
}

ul.HelpNav li
{
    display: block;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #F3FAFC;
}

ul.HelpNav li:hover, ul.HelpNavLinear li:hover
{
    background-color: #E0F0F4;
}

ul.HelpNav li a, ul.HelpNavLinear li a
{
    display: block;
    font-size: <?PHP  print($BaseFontSize);  ?>px;
    width: 170px;
	text-decoration: none;
    line-height: 12px;
    color: #666;
    margin: 5px;
	font-weight: bold;
}

ul.HelpNavLinear
{
    list-style: none;
 	padding: 0;
 	margin: 10px 0 0 10px;
}

ul.HelpNavLinear li
{
    display: block;
    float: left;
    margin: 0;
    <?PHP  if (strlen($PrefBackgroundColor)) {
               print($AltBackgroundColorAttrib);
           }
	   else
	   {?>
 	background: #EAF1F3;
    <?PHP  }  ?>
    padding: 0;
    border: 1px solid #F3FAFC;
}

/*
    These styles are for the saved search area on the Advanced Search screen
*/
ul.SPTSavedSearches
{
    list-style: none;
    padding: 0;
    margin: 0;
}
ul.SPTSavedSearches li
{
    display: block;
    padding: 0;
    border: 1px solid #F3FAFC;
    background-color: #F2F9FB;
}
ul.SPTSavedSearches li:hover
{
    background-color: #F6FDFF;
}
ul.SPTSavedSearches li a
{
    display: block;
    width: 150px;
    text-decoration: none;
    margin: 2px;
}

.FloatLeft, ul.SPTSavedSearches li
{
    float: left;
    margin: 3px;
}
.FloatRight
{
    float: right;
    margin: 3px;
}

body {
    _font-size: 62.5%; /* Allows text resizing in IE */
}

/*
    a.AddField: The button on the Advanced Search page that adds additional fields
    to search.
*/
a.AddField {
    padding: 0px 5px;
}
