Statistics
| Branch: | Tag: | Revision:

root / cloudcms / static / cloudcms / css / boxsizing.htc @ 148c25ed

History | View | Annotate | Download (8.5 kB)

1 f6e90a2b Kostas Papadimitriou
/**
2 f6e90a2b Kostas Papadimitriou
* CSS-JS-BOOSTER
3 f6e90a2b Kostas Papadimitriou
* 
4 f6e90a2b Kostas Papadimitriou
* A polyfill for box-sizing: border-box for IE6 & IE7.
5 f6e90a2b Kostas Papadimitriou
* 
6 f6e90a2b Kostas Papadimitriou
* JScript
7 f6e90a2b Kostas Papadimitriou
* 
8 f6e90a2b Kostas Papadimitriou
* This program is free software: you can redistribute it and/or modify
9 f6e90a2b Kostas Papadimitriou
* it under the terms of the GNU Lesser General Public License as published 
10 f6e90a2b Kostas Papadimitriou
* by the Free Software Foundation, either version 3 of the License, or
11 f6e90a2b Kostas Papadimitriou
* (at your option) any later version.
12 f6e90a2b Kostas Papadimitriou
* 
13 f6e90a2b Kostas Papadimitriou
* This program is distributed in the hope that it will be useful,
14 f6e90a2b Kostas Papadimitriou
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15 f6e90a2b Kostas Papadimitriou
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 f6e90a2b Kostas Papadimitriou
* GNU Lesser General Public License for more details.
17 f6e90a2b Kostas Papadimitriou
* 
18 f6e90a2b Kostas Papadimitriou
* See <http://www.gnu.org/licenses/lgpl-3.0.txt>
19 f6e90a2b Kostas Papadimitriou
* 
20 f6e90a2b Kostas Papadimitriou
* @category  JScript 
21 f6e90a2b Kostas Papadimitriou
* @package   box-sizing-polyfill
22 f6e90a2b Kostas Papadimitriou
* @author    Christian Schepp Schaefer <schaepp@gmx.de> <http://twitter.com/derSchepp>
23 f6e90a2b Kostas Papadimitriou
* @copyright 2010 Christian Schepp Schaefer
24 f6e90a2b Kostas Papadimitriou
* @license   http://www.gnu.org/copyleft/lesser.html The GNU LESSER GENERAL PUBLIC LICENSE, Version 3.0
25 f6e90a2b Kostas Papadimitriou
* @link      http://github.com/Schepp/box-sizing-polyfill 
26 f6e90a2b Kostas Papadimitriou
*
27 f6e90a2b Kostas Papadimitriou
* PREFACE:
28 f6e90a2b Kostas Papadimitriou
*
29 f6e90a2b Kostas Papadimitriou
* This box-sizing polyfill is based on previous work done by Erik Arvidsson, 
30 f6e90a2b Kostas Papadimitriou
* which he published in 2002 on http://webfx.eae.net/dhtml/boxsizing/boxsizing.html.
31 f6e90a2b Kostas Papadimitriou
*
32 f6e90a2b Kostas Papadimitriou
* USAGE:
33 f6e90a2b Kostas Papadimitriou
* 	
34 f6e90a2b Kostas Papadimitriou
* Add the behavior/HTC after every `box-sizing: border-box;` that you assign:
35 f6e90a2b Kostas Papadimitriou
* 
36 f6e90a2b Kostas Papadimitriou
* box-sizing: border-box;
37 f6e90a2b Kostas Papadimitriou
* *behavior: url(/scripts/boxsizing.htc);`
38 f6e90a2b Kostas Papadimitriou
* 
39 f6e90a2b Kostas Papadimitriou
* If you prefix the `behavior` property with a star, like seen above, it will only be seen by 
40 f6e90a2b Kostas Papadimitriou
* IE6 & IE7, not by IE8+ (it's a hack) which is better for the performance on those newer browsers.
41 f6e90a2b Kostas Papadimitriou
*
42 f6e90a2b Kostas Papadimitriou
* The URL to the HTC file must be relative to your HTML(!) document, not relative to your CSS.
43 f6e90a2b Kostas Papadimitriou
* That's why I'd advise you to use absolute paths like in the example.
44 f6e90a2b Kostas Papadimitriou
*
45 f6e90a2b Kostas Papadimitriou
*/
46 f6e90a2b Kostas Papadimitriou
<component lightWeight="true">
47 f6e90a2b Kostas Papadimitriou
<attach event="onpropertychange" onevent="checkPropertyChange()" />
48 f6e90a2b Kostas Papadimitriou
<attach event="ondetach" onevent="restore()" />
49 f6e90a2b Kostas Papadimitriou
<attach event="onresize" for="window" onevent="restore();init()" />
50 f6e90a2b Kostas Papadimitriou
<script type="text/javascript">
51 f6e90a2b Kostas Papadimitriou
//<![CDATA[
52 f6e90a2b Kostas Papadimitriou
53 f6e90a2b Kostas Papadimitriou
var viewportwidth = (typeof window.innerWidth != 'undefined' ? window.innerWidth : element.document.documentElement.clientWidth);
54 f6e90a2b Kostas Papadimitriou
// Shortcut for the document object
55 f6e90a2b Kostas Papadimitriou
var doc = element.document;
56 f6e90a2b Kostas Papadimitriou
57 f6e90a2b Kostas Papadimitriou
/*
58 f6e90a2b Kostas Papadimitriou
* init gets called once at the start and then never again, 
59 f6e90a2b Kostas Papadimitriou
* triggers box-sizing calculations and updates width and height
60 f6e90a2b Kostas Papadimitriou
*/
61 f6e90a2b Kostas Papadimitriou
function init(){
62 f6e90a2b Kostas Papadimitriou
	// check for IE8+
63 f6e90a2b Kostas Papadimitriou
	if(typeof(element.style.boxSizing) == "undefined"){
64 f6e90a2b Kostas Papadimitriou
		updateBorderBoxWidth();
65 f6e90a2b Kostas Papadimitriou
		updateBorderBoxHeight();
66 f6e90a2b Kostas Papadimitriou
	}
67 f6e90a2b Kostas Papadimitriou
}
68 f6e90a2b Kostas Papadimitriou
69 f6e90a2b Kostas Papadimitriou
/*
70 f6e90a2b Kostas Papadimitriou
* restore gets called when the behavior is being detached (see event binding at the top),
71 f6e90a2b Kostas Papadimitriou
* resets everything like it was before applying the behavior
72 f6e90a2b Kostas Papadimitriou
*/
73 f6e90a2b Kostas Papadimitriou
function restore(){
74 f6e90a2b Kostas Papadimitriou
	// check for IE8+
75 f6e90a2b Kostas Papadimitriou
	if(typeof(element.style.boxSizing) == "undefined"){
76 f6e90a2b Kostas Papadimitriou
		element.runtimeStyle.width = "";
77 f6e90a2b Kostas Papadimitriou
		element.runtimeStyle.height = "";
78 f6e90a2b Kostas Papadimitriou
	}
79 f6e90a2b Kostas Papadimitriou
}
80 f6e90a2b Kostas Papadimitriou
81 f6e90a2b Kostas Papadimitriou
/*
82 f6e90a2b Kostas Papadimitriou
* checkPropertyChange gets called as soon as an element property changes 
83 f6e90a2b Kostas Papadimitriou
* (see event binding at the top), it then checks if any property influencing its 
84 f6e90a2b Kostas Papadimitriou
* dimensions was changed and if yes recalculates width and height 
85 f6e90a2b Kostas Papadimitriou
*/
86 f6e90a2b Kostas Papadimitriou
function checkPropertyChange(){
87 f6e90a2b Kostas Papadimitriou
	// check for IE8+
88 f6e90a2b Kostas Papadimitriou
	if(typeof(element.style.boxSizing) == "undefined"){
89 f6e90a2b Kostas Papadimitriou
		var pn = event.propertyName;
90 f6e90a2b Kostas Papadimitriou
		var undef;
91 f6e90a2b Kostas Papadimitriou
		if(pn == "style.boxSizing" && element.style.boxSizing == ""){
92 f6e90a2b Kostas Papadimitriou
			element.style.removeAttribute("boxSizing");
93 f6e90a2b Kostas Papadimitriou
			element.runtimeStyle.boxSizing = undef;
94 f6e90a2b Kostas Papadimitriou
		}
95 f6e90a2b Kostas Papadimitriou
		switch (pn){
96 f6e90a2b Kostas Papadimitriou
			case "style.width":
97 f6e90a2b Kostas Papadimitriou
			case "style.borderLeftWidth":
98 f6e90a2b Kostas Papadimitriou
			case "style.borderLeftStyle":
99 f6e90a2b Kostas Papadimitriou
			case "style.borderRightWidth":
100 f6e90a2b Kostas Papadimitriou
			case "style.borderRightStyle":
101 f6e90a2b Kostas Papadimitriou
			case "style.paddingLeft":
102 f6e90a2b Kostas Papadimitriou
			case "style.paddingRight":
103 f6e90a2b Kostas Papadimitriou
				updateBorderBoxWidth();
104 f6e90a2b Kostas Papadimitriou
			break;
105 f6e90a2b Kostas Papadimitriou
		
106 f6e90a2b Kostas Papadimitriou
			case "style.height":
107 f6e90a2b Kostas Papadimitriou
			case "style.borderTopWidth":
108 f6e90a2b Kostas Papadimitriou
			case "style.borderTopStyle":
109 f6e90a2b Kostas Papadimitriou
			case "style.borderBottomWidth":
110 f6e90a2b Kostas Papadimitriou
			case "style.borderBottomStyle":
111 f6e90a2b Kostas Papadimitriou
			case "style.paddingTop":
112 f6e90a2b Kostas Papadimitriou
			case "style.paddingBottom":
113 f6e90a2b Kostas Papadimitriou
				updateBorderBoxHeight();
114 f6e90a2b Kostas Papadimitriou
			break;
115 f6e90a2b Kostas Papadimitriou
		
116 f6e90a2b Kostas Papadimitriou
			case "className":
117 f6e90a2b Kostas Papadimitriou
			case "style.boxSizing":
118 f6e90a2b Kostas Papadimitriou
				updateBorderBoxWidth();
119 f6e90a2b Kostas Papadimitriou
				updateBorderBoxHeight();
120 f6e90a2b Kostas Papadimitriou
			break;
121 f6e90a2b Kostas Papadimitriou
		}
122 f6e90a2b Kostas Papadimitriou
	}
123 f6e90a2b Kostas Papadimitriou
}
124 f6e90a2b Kostas Papadimitriou
125 f6e90a2b Kostas Papadimitriou
/* 
126 f6e90a2b Kostas Papadimitriou
 * Helper function, taken from Dean Edward's IE7 framework,
127 f6e90a2b Kostas Papadimitriou
 * added by Schepp on 12.06.2010.
128 f6e90a2b Kostas Papadimitriou
 * http://code.google.com/p/ie7-js/
129 f6e90a2b Kostas Papadimitriou
 *
130 f6e90a2b Kostas Papadimitriou
 * Allows us to convert from relative to pixel-values.
131 f6e90a2b Kostas Papadimitriou
 */
132 f6e90a2b Kostas Papadimitriou
function getPixelValue(value){
133 f6e90a2b Kostas Papadimitriou
	var PIXEL = /^\d+(px)?$/i;
134 f6e90a2b Kostas Papadimitriou
	if (PIXEL.test(value)) return parseInt(value);
135 f6e90a2b Kostas Papadimitriou
	var style = element.style.left;
136 f6e90a2b Kostas Papadimitriou
	var runtimeStyle = element.runtimeStyle.left;
137 f6e90a2b Kostas Papadimitriou
	element.runtimeStyle.left = element.currentStyle.left;
138 f6e90a2b Kostas Papadimitriou
	element.style.left = value || 0;
139 f6e90a2b Kostas Papadimitriou
	value = parseInt(element.style.pixelLeft);
140 f6e90a2b Kostas Papadimitriou
	element.style.left = style;
141 f6e90a2b Kostas Papadimitriou
	element.runtimeStyle.left = runtimeStyle;
142 f6e90a2b Kostas Papadimitriou
	
143 f6e90a2b Kostas Papadimitriou
	return value;
144 f6e90a2b Kostas Papadimitriou
}
145 f6e90a2b Kostas Papadimitriou
146 f6e90a2b Kostas Papadimitriou
function getPixelWidth(object, value){
147 f6e90a2b Kostas Papadimitriou
	// For Pixel Values
148 f6e90a2b Kostas Papadimitriou
	var PIXEL = /^\d+(px)?$/i;
149 f6e90a2b Kostas Papadimitriou
	if (PIXEL.test(value)) return parseInt(value);
150 f6e90a2b Kostas Papadimitriou
	
151 f6e90a2b Kostas Papadimitriou
	// For Percentage Values
152 f6e90a2b Kostas Papadimitriou
	var PERCENT = /^[\d\.]+%$/i;
153 f6e90a2b Kostas Papadimitriou
	if (PERCENT.test(value)){
154 f6e90a2b Kostas Papadimitriou
		try{
155 f6e90a2b Kostas Papadimitriou
			parentWidth = getPixelWidth(object.parentElement,(object.parentElement.currentStyle.width != "auto" ? object.parentElement.currentStyle.width : "100%"));
156 f6e90a2b Kostas Papadimitriou
			value = (parseFloat(value) / 100) * parentWidth;
157 f6e90a2b Kostas Papadimitriou
		}
158 f6e90a2b Kostas Papadimitriou
		catch(e){
159 f6e90a2b Kostas Papadimitriou
			value = (parseFloat(value) / 100) * element.document.documentElement.clientWidth;
160 f6e90a2b Kostas Papadimitriou
		}
161 f6e90a2b Kostas Papadimitriou
		return parseInt(value);
162 f6e90a2b Kostas Papadimitriou
	}
163 f6e90a2b Kostas Papadimitriou
	
164 f6e90a2b Kostas Papadimitriou
	// For EM Values
165 f6e90a2b Kostas Papadimitriou
	var style = object.style.left;
166 f6e90a2b Kostas Papadimitriou
	var runtimeStyle = object.runtimeStyle.left;
167 f6e90a2b Kostas Papadimitriou
	object.runtimeStyle.left = object.currentStyle.left;
168 f6e90a2b Kostas Papadimitriou
	object.style.left = value || 0;
169 f6e90a2b Kostas Papadimitriou
	value = parseInt(object.style.pixelLeft);
170 f6e90a2b Kostas Papadimitriou
	object.style.left = style;
171 f6e90a2b Kostas Papadimitriou
	object.runtimeStyle.left = runtimeStyle;
172 f6e90a2b Kostas Papadimitriou
	
173 f6e90a2b Kostas Papadimitriou
	return value;
174 f6e90a2b Kostas Papadimitriou
}
175 f6e90a2b Kostas Papadimitriou
176 f6e90a2b Kostas Papadimitriou
177 f6e90a2b Kostas Papadimitriou
/*
178 f6e90a2b Kostas Papadimitriou
 * getBorderWidth & friends
179 f6e90a2b Kostas Papadimitriou
 * Border width getters
180 f6e90a2b Kostas Papadimitriou
 */
181 f6e90a2b Kostas Papadimitriou
function getBorderWidth(sSide){
182 f6e90a2b Kostas Papadimitriou
	if(element.currentStyle["border" + sSide + "Style"] == "none"){
183 f6e90a2b Kostas Papadimitriou
		return 0;
184 f6e90a2b Kostas Papadimitriou
	}
185 f6e90a2b Kostas Papadimitriou
	var n = getPixelValue(element.currentStyle["border" + sSide + "Width"]);
186 f6e90a2b Kostas Papadimitriou
	return n || 0;
187 f6e90a2b Kostas Papadimitriou
}
188 f6e90a2b Kostas Papadimitriou
function getBorderLeftWidth() { return getBorderWidth("Left"); }
189 f6e90a2b Kostas Papadimitriou
function getBorderRightWidth() { return getBorderWidth("Right"); }
190 f6e90a2b Kostas Papadimitriou
function getBorderTopWidth() { return getBorderWidth("Top"); }
191 f6e90a2b Kostas Papadimitriou
function getBorderBottomWidth() { return getBorderWidth("Bottom"); }
192 f6e90a2b Kostas Papadimitriou
193 f6e90a2b Kostas Papadimitriou
194 f6e90a2b Kostas Papadimitriou
/*
195 f6e90a2b Kostas Papadimitriou
 * getPadding & friends
196 f6e90a2b Kostas Papadimitriou
 * Padding width getters
197 f6e90a2b Kostas Papadimitriou
 */
198 f6e90a2b Kostas Papadimitriou
function getPadding(sSide) {
199 f6e90a2b Kostas Papadimitriou
	var n = getPixelValue(element.currentStyle["padding" + sSide]);
200 f6e90a2b Kostas Papadimitriou
	return n || 0;
201 f6e90a2b Kostas Papadimitriou
}
202 f6e90a2b Kostas Papadimitriou
function getPaddingLeft() { return getPadding("Left"); }
203 f6e90a2b Kostas Papadimitriou
function getPaddingRight() { return getPadding("Right"); }
204 f6e90a2b Kostas Papadimitriou
function getPaddingTop() { return getPadding("Top"); }
205 f6e90a2b Kostas Papadimitriou
function getPaddingBottom() { return getPadding("Bottom"); }
206 f6e90a2b Kostas Papadimitriou
207 f6e90a2b Kostas Papadimitriou
208 f6e90a2b Kostas Papadimitriou
209 f6e90a2b Kostas Papadimitriou
/*
210 f6e90a2b Kostas Papadimitriou
 * getBoxSizing
211 f6e90a2b Kostas Papadimitriou
 * Get the box-sizing value for the current element
212 f6e90a2b Kostas Papadimitriou
 */
213 f6e90a2b Kostas Papadimitriou
function getBoxSizing(){
214 f6e90a2b Kostas Papadimitriou
	var s = element.style;
215 f6e90a2b Kostas Papadimitriou
	var cs = element.currentStyle
216 f6e90a2b Kostas Papadimitriou
	if(typeof s.boxSizing != "undefined" && s.boxSizing != ""){
217 f6e90a2b Kostas Papadimitriou
		return s.boxSizing;
218 f6e90a2b Kostas Papadimitriou
	}
219 f6e90a2b Kostas Papadimitriou
	if(typeof s["box-sizing"] != "undefined" && s["box-sizing"] != ""){
220 f6e90a2b Kostas Papadimitriou
		return s["box-sizing"];
221 f6e90a2b Kostas Papadimitriou
	}
222 f6e90a2b Kostas Papadimitriou
	if(typeof cs.boxSizing != "undefined" && cs.boxSizing != ""){
223 f6e90a2b Kostas Papadimitriou
		return cs.boxSizing;
224 f6e90a2b Kostas Papadimitriou
	}
225 f6e90a2b Kostas Papadimitriou
	if(typeof cs["box-sizing"] != "undefined" && cs["box-sizing"] != ""){
226 f6e90a2b Kostas Papadimitriou
		return cs["box-sizing"];
227 f6e90a2b Kostas Papadimitriou
	}
228 f6e90a2b Kostas Papadimitriou
	return getDocumentBoxSizing();
229 f6e90a2b Kostas Papadimitriou
}
230 f6e90a2b Kostas Papadimitriou
231 f6e90a2b Kostas Papadimitriou
232 f6e90a2b Kostas Papadimitriou
/*
233 f6e90a2b Kostas Papadimitriou
 * getDocumentBoxSizing
234 f6e90a2b Kostas Papadimitriou
 * Get the default document box sizing (check for quirks mode)
235 f6e90a2b Kostas Papadimitriou
 */
236 f6e90a2b Kostas Papadimitriou
function getDocumentBoxSizing(){
237 f6e90a2b Kostas Papadimitriou
	if(doc.compatMode == null || doc.compatMode == "BackCompat"){
238 f6e90a2b Kostas Papadimitriou
		return "border-box";
239 f6e90a2b Kostas Papadimitriou
	}
240 f6e90a2b Kostas Papadimitriou
	return "content-box"
241 f6e90a2b Kostas Papadimitriou
}
242 f6e90a2b Kostas Papadimitriou
243 f6e90a2b Kostas Papadimitriou
244 f6e90a2b Kostas Papadimitriou
/*
245 f6e90a2b Kostas Papadimitriou
 * setBorderBoxWidth & friends
246 f6e90a2b Kostas Papadimitriou
 * Width and height setters
247 f6e90a2b Kostas Papadimitriou
 */
248 f6e90a2b Kostas Papadimitriou
function setBorderBoxWidth(n){
249 f6e90a2b Kostas Papadimitriou
	element.runtimeStyle.width = Math.max(0, n - getBorderLeftWidth() -
250 f6e90a2b Kostas Papadimitriou
		getPaddingLeft() - getPaddingRight() - getBorderRightWidth()) + "px";
251 f6e90a2b Kostas Papadimitriou
}
252 f6e90a2b Kostas Papadimitriou
function setBorderBoxHeight(n){
253 f6e90a2b Kostas Papadimitriou
	element.runtimeStyle.height = Math.max(0, n - getBorderTopWidth() -
254 f6e90a2b Kostas Papadimitriou
		getPaddingTop() - getPaddingBottom() - getBorderBottomWidth()) + "px";
255 f6e90a2b Kostas Papadimitriou
}
256 f6e90a2b Kostas Papadimitriou
function setContentBoxWidth(n){
257 f6e90a2b Kostas Papadimitriou
	element.runtimeStyle.width = Math.max(0, n + getBorderLeftWidth() +
258 f6e90a2b Kostas Papadimitriou
		getPaddingLeft() + getPaddingRight() + getBorderRightWidth()) + "px";
259 f6e90a2b Kostas Papadimitriou
}
260 f6e90a2b Kostas Papadimitriou
function setContentBoxHeight(n){
261 f6e90a2b Kostas Papadimitriou
	element.runtimeStyle.height = Math.max(0, n + getBorderTopWidth() +
262 f6e90a2b Kostas Papadimitriou
		getPaddingTop() + getPaddingBottom() + getBorderBottomWidth()) + "px";
263 f6e90a2b Kostas Papadimitriou
}
264 f6e90a2b Kostas Papadimitriou
265 f6e90a2b Kostas Papadimitriou
266 f6e90a2b Kostas Papadimitriou
/*
267 f6e90a2b Kostas Papadimitriou
 * updateBorderBoxWidth & updateBorderBoxHeight
268 f6e90a2b Kostas Papadimitriou
 * 
269 f6e90a2b Kostas Papadimitriou
 */
270 f6e90a2b Kostas Papadimitriou
function updateBorderBoxWidth() {
271 f6e90a2b Kostas Papadimitriou
	if(getDocumentBoxSizing() == getBoxSizing()){
272 f6e90a2b Kostas Papadimitriou
		return;
273 f6e90a2b Kostas Papadimitriou
	}
274 f6e90a2b Kostas Papadimitriou
	var csw = element.currentStyle.width;
275 f6e90a2b Kostas Papadimitriou
	if(csw != "auto"){
276 f6e90a2b Kostas Papadimitriou
		csw = getPixelWidth(element,csw);
277 f6e90a2b Kostas Papadimitriou
		if(getBoxSizing() == "border-box"){
278 f6e90a2b Kostas Papadimitriou
			setBorderBoxWidth(parseInt(csw));
279 f6e90a2b Kostas Papadimitriou
		}
280 f6e90a2b Kostas Papadimitriou
		else{
281 f6e90a2b Kostas Papadimitriou
			setContentBoxWidth(parseInt(csw));
282 f6e90a2b Kostas Papadimitriou
		}
283 f6e90a2b Kostas Papadimitriou
	}
284 f6e90a2b Kostas Papadimitriou
}
285 f6e90a2b Kostas Papadimitriou
286 f6e90a2b Kostas Papadimitriou
function updateBorderBoxHeight() {
287 f6e90a2b Kostas Papadimitriou
	if(getDocumentBoxSizing() == getBoxSizing()){
288 f6e90a2b Kostas Papadimitriou
		return;
289 f6e90a2b Kostas Papadimitriou
	}
290 f6e90a2b Kostas Papadimitriou
	var csh = element.currentStyle.height;
291 f6e90a2b Kostas Papadimitriou
	if(csh != "auto"){
292 f6e90a2b Kostas Papadimitriou
		csh = getPixelValue(csh);
293 f6e90a2b Kostas Papadimitriou
		if(getBoxSizing() == "border-box"){
294 f6e90a2b Kostas Papadimitriou
			setBorderBoxHeight(parseInt(csh));
295 f6e90a2b Kostas Papadimitriou
		}
296 f6e90a2b Kostas Papadimitriou
		else{
297 f6e90a2b Kostas Papadimitriou
			setContentBoxHeight(parseInt(csh));
298 f6e90a2b Kostas Papadimitriou
		}
299 f6e90a2b Kostas Papadimitriou
	}
300 f6e90a2b Kostas Papadimitriou
}
301 f6e90a2b Kostas Papadimitriou
302 f6e90a2b Kostas Papadimitriou
303 f6e90a2b Kostas Papadimitriou
// Run the calculations
304 f6e90a2b Kostas Papadimitriou
init();
305 f6e90a2b Kostas Papadimitriou
306 f6e90a2b Kostas Papadimitriou
//]]>
307 f6e90a2b Kostas Papadimitriou
</script>
308 f6e90a2b Kostas Papadimitriou
</component>