function rule(selector,nam,val) // for each rule, the name and the value is created
{
	this.selector = selector;
	this.nam = nam + ':';
	this.val = val + ';';
}

function writeSheet(s,r) // pass two arrays: selectors & rules
{
	document.write('<style type="text\/css">\n');
	outer = 0;

	while (outer < s.length)
	{
		var css = ''
		css = s[outer] + '\n' + '{\n';
		inner = 0;
		while(inner < r.length)
		{
			if (s[outer] == r[inner].selector)
			{
				css += '\t' + r[inner].nam + ' ' + r[inner].val + '\n';
			}
			inner++;
		}
		css += '}\n';
		document.write(css);
		outer++;
	}
	document.write('\n<\/style>');
}

