/*
# main_css.js Version 2.2
# Copyright (c) 2000 Luca Borrione write@tiscali-no.spam.it
# Created 16 October 2000 Last Modified 10 January 2003
# _________________
# COPYRIGHT NOTICE:
# Copyright (c) 2000-2003 Luca Borrione All Rights Reserved.
# Permission granted to use and modify free of charge this script so long as this
# copyright notice above is maintained, modifications are documented,
# and credit is given for any use of the script.
# By using this code you agree to indemnify Luca Borrione from any liability that
# might arise from its use.
# Selling the code contained in this script without prior written consent is
# expressly forbidden.
# Obtain permission before redistributing this script over the Internet or
# in any other medium.
# In all cases copyright and header must remain intact.
# ______
# NOTES:
# To edit this code correctly please check the following options in your editor:
# - TAB Stop: 2
# - Block Indent Step Size: 2
# ____________
# SCRIPT CODE:
*/
/*
# NB:
# nn4 e opera solo durante caricamento della pagina.
*/
var d = (self.d) ? self.d : document;
if (is.ie || is.nn >= 5)
d.write ('');
// d.css = new CSS( true );
function css (Selector)
{
if (!d.css || !d.css[Selector]) init_css (Selector);
if (d.css[Selector]) return d.css[Selector];
else return null;
}
function init_css (Selector)
{
if (!d.css)
{
d.css = [];
d.css._properties = new CSS();
}
d.css[Selector] = new CSS (Selector);
}
/*
# CUSTOMIZE
*/
generic = [];
generic.fontFamily = "Verdana, Arial, Lucida";
with (css ('.normal'))
{
fontFamily = generic.fontFamily;
fontSize = (is.ie) ? "8pt" :
(is.nn4) ? (is.win) ? "11" : "10pt" :
(is.nn>=5) ? "8pt" : "8pt";
add();
}
with (css ('.small'))
{
fontFamily = generic.fontFamily;
fontSize = (is.ie) ? "7pt" :
(is.nn4) ? (is.win) ? "10" : "9pt" :
(is.nn>=5) ? "7pt" : "7pt";
add();
}
with (css ('.clrE5EEF7'))
{
// backgroundColor = (is)
fontFamily = generic.fontFamily;
fontSize = (is.ie) ? "7pt" :
(is.nn4) ? (is.win) ? "10" : "9pt" :
(is.nn>=5) ? "7pt" : "7pt";
add();
}
/*
# END
*/
function CSS (Selector)
{
if (Selector)
{
if (is.nn4)
this._contextual = [];
// this.selector = "";
this.selector = Selector;
this.add = add;
this.inheritFrom = inheritFrom;
}
this.fontFamily = (!Selector) ? "font-family" : "";
this.fontSize = (!Selector) ? "font-size" : "";
this.fontWeight = (!Selector) ? "font-weight" : "";
this.color = (!Selector) ? "color" : "";
this.width = (!Selector) ? "width" : "";
this.height = (!Selector) ? "height" : "";
if (!Selector)
return this;
function add()
{
var rules = "";
for (var rule in this)
{
if (this[rule].constructor == Array || this[rule].constructor == Function || rule == "selector") {continue;}
if (this[rule] == "") {continue;}
// rules += d.css[rule] +":"+ this[rule] +";";
rules += d.css._properties[rule] +":"+ this[rule] +";";
if (is.nn4)
{
if (this.selector.indexOf(" ") != -1 )
{
if( this._contextual.length == 0 )
{
var contexts = this.selector.split(" ");
for (var i=0; i= 5)
{
var styleSheet = d.getElementById("mainStyle").sheet;
var length = styleSheet.cssRules.length;
styleSheet.insertRule( this.selector +"{"+ rules +"}", length );
}
else // if (is.opera)
d.write( "