// Created by:    BOLAND WERBUNG, D. Rittershaus
// Created:       2007-11-27
// Notes: 
/*Script liefert zufällig Artikel für 2 Newsboxen auf Homepage. 
Bestandteile der Artikel werden in 2 Arrays gespeichert und zur Ausgabe
durch Zufallszahl Adressiert und ausgegeben.Artikel-Arrays könne ungleich
lang sein.
Modified:
2011-03-15: Removed Column B
2008-11-03: neue Texte aus AMB2008 Einladung
*/ 
// 



var random_0;     // Zufallszahl mit der der Artikel für die erste Box (A) bestimmt wird
var random_1;     // Zufallszahl mit der der Artikel für die zweite Box (B) bestimmt wird

var articles_0 = new Array(4); // Sammel-Array für Artikel A
articles_0[0] = new Array(); // Headline
articles_0[1] = new Array(); // Text
articles_0[2] = new Array(); // Link
articles_0[3] = new Array(); // Image

/* var articles_1 = new Array(4); // Sammel-Array für Artikel B
articles_1[0] = new Array(); // Headline
articles_1[1] = new Array(); // Text
articles_1[2] = new Array(); // Link
articles_1[3] = new Array(); // Image */

/* Artikel, bestehend aus Headline, Text, Link u. Image bereitstellen */

/* Box A */
articles_0[0].push("APHP Advanced Pico Hard Precision | Ø8 - Ø32 | High Hardness Cutting &amp; High Feed Cutting HRC62");
articles_0[1].push("<ul class='ListStyle1'><li>Modular Type</li><li>New inserts: CAM Radius R2</li><li>PJP-Coating for hard &amp; tough materials</li><li>D-Coating for graphite</li></ul>");
articles_0[2].push("products/index/shape/radius/");
articles_0[3].push("thumb_aphp.jpg");

articles_0[0].push("ASR Pico Maxi Turbo Metric Series | Ø30 - Ø100 | High Feed Cutting &amp; High Hardness Cutting");
articles_0[1].push("<ul class='ListStyle1'><li>Modular &amp; Bore Type</li><li>New Inserts Ø10</li><li>For maximum feed in materials up to HRC62</li></ul>");
articles_0[2].push("products/index/shape/radius/");
articles_0[3].push("thumb_asr_pico_maxi.jpg");

articles_0[0].push("Customers amazed by catalogue software");
articles_0[1].push('<p class="TextStyle1">Now 1.500 activations and more than 3.000 Downloads of free Tool Selection-Software P50QuickFinder</p><p class="TextStyle1">Main features:</p><ul class="ListStyle1"><li>Tool Sselection by filters</li><li>Brochres as PDF</li><li>Cutting Conditions-Database</li><li>CAD/CAM-Data in various formats for download</li></ul>');
articles_0[2].push("products/index/shape/radius/");
articles_0[3].push("teaser_qf1500.jpg");

articles_0[0].push("CBN-EPSx <br /> Epoch CBN End Mill");
articles_0[1].push("<ul class='ListStyle1'><li>2-flute Cubical Boron Nitride end mills</li><li>For machining of hardest materials up to HRC72</li><li>Extremely durable</li></ul>");
articles_0[2].push("products/solid/material/epoch21/index.php#row-cbn-epsb");
articles_0[3].push("thumb-cbn.jpg");

articles_0[0].push("ASM/AHU Mini Type |Indexable Side-Milling and High Feed End Mill");
articles_0[1].push("<ul class='ListStyle1'><li>Available as shank &amp; modular type</li><li>2 different insert geometries:<ul class='ListStyle1'><li>JDMT for 90°-machining for highest surface quality</li><li>EDMT for high feed cutting</li></ul><li>New DLC-coating especially for Aluminium</li></ul>");
articles_0[2].push("products/index/shape/radius/index.php#row-asm-ahu-shank");
articles_0[3].push("thumb-asm.jpg");

articles_0[0].push("ASRF <br /> Super Radius Mill Four Corners");
articles_0[1].push("<ul class='ListStyle1'><li>Indexable milling tool</li><li>High feed and contour accuracy</li></ul>");
articles_0[2].push("products/index/shape/radius/index.php#row-asrf");
articles_0[3].push("thumb-asrf.jpg");

articles_0[0].push("ZDFG <br /> No-joint full radius inserts");
articles_0[1].push("<ul class='ListStyle1'><li>Insert for ABPF</li><li>New Nano-Composite-Coatings ATH and ACS</li></ul>");
articles_0[2].push("products/index/shape/ball/index.php");
articles_0[3].push("thumb-zdfg.jpg");

articles_0[0].push("WHNSB <br /> Non Step Borer");
articles_0[1].push("<ul class='ListStyle1'><li>Solid carbide TH-coated non step borer for machining by MQL or with internal cooling</li><li>4 times more efficient than a standard gun drill</li></ul>");
articles_0[2].push("products/borer/index.php#row-whnsb-th");
articles_0[3].push("thumb-whnsb.jpg");

articles_0[0].push("EPDRF <br /> Epoch Deep Radius Four Fast Finish");
articles_0[1].push("<ul class='ListStyle1'><li>4 flute solid carbde end mill with TH-coating for high performance – from roughing to finishing</li></ul>");
articles_0[2].push("products/solid/shape/radius/index.php#row-epdrf-th");
articles_0[3].push("thumb-epdrf.jpg");

articles_0[0].push("ETRP <br /> Epoch Turbo Rib Pencil Neck");
articles_0[1].push("<ul class='ListStyle1'><li>4 flute solid carbde end mill with TH-coating for high-speed-cutting of deep ribs and slots</li></ul>");
articles_0[2].push("products/solid/material/epoch21/index.php#row-etrp-th");
articles_0[3].push("thumb-etrp.jpg");


/* Box B */
articles_0[0].push("EMX | Epoch ATH Mirus Series | Multi Function „All Way“ Solid Carbide End Mill");
articles_0[1].push("<ul class='ListStyle1'><li>Comes in 2 geometries: </li><li>Type R specialized on Mould & Die Milling</li><li>Typ N specialized on Parts Machinin</li><li>ATH – Advanced TH coating</li></ul>");
articles_0[2].push("products/solid/material/epoch21/index.php#row-mirus");
articles_0[3].push("thumb-mirus.jpg");

articles_0[0].push("AHR Mini | Advanced Heavy Roughing | For High Performance Feed & Depth");
articles_0[1].push("<ul class='ListStyle1'><li>The optimum tool for casting work, </li><li>using non-uniform stock material</li><li>Inserts available in 6 Grades & 2 Geometries</li></ul>");
articles_0[2].push("products/index/shape/radius/index.php#row-ahrb");
articles_0[3].push("thumb-ahr.jpg");

articles_0[0].push("D-EPDx | Epoch HD Coated Deep End Mill | Ball & Radius Type");
articles_0[1].push("<ul class='ListStyle1'><li>Diamond coated solid carbide end mills for machining of graphite(-electrodes)</li><li>2-flute ball type end mills ØD 1–10 mm</li><li>2-flute radius type end mills ØD 1 – 4 mm, 4-flute radius type end mills ØD 6 – 10 mm</li><li>Up to 30 x ØD</li></ul>");
articles_0[2].push("products/solid/material/epoch21/index.php#row-d-epdb");
articles_0[3].push("thumb-d-epdx.jpg");

articles_0[0].push("AHU15 <br /> High Feed Ultra End Mill");
articles_0[1].push("<ul class='ListStyle1'><li>High performance indexable milling tool with optimized insert geometry for maximum surface quality</li></ul>");
articles_0[2].push("products/index/shape/square/index.php#row-ahu-b");
articles_0[3].push("thumb-ahu15.jpg");

articles_0[0].push("EPP-TH <br /> Epoch TH Power Mill");
articles_0[1].push("<ul class='ListStyle1'><li>Solid carbide end mill with TH-coating for hardened tool steels up to HRC70</li></ul>");
articles_0[2].push("products/solid/material/epoch21/index.php#row-epp-th");
articles_0[3].push("thumb-epp-th.jpg");

articles_0[0].push("EMB <br /> Epoch Mega Feed Ball");
articles_0[1].push("<ul class='ListStyle1'><li>3-flute solid carbide end mill with the precision of a 2-flute end mill</li><li>Maximum surface quality at high feed rates</li></ul>");
articles_0[2].push("products/solid/shape/ball/index.php#row-emb-th");
articles_0[3].push("thumb-emb.jpg");

articles_0[0].push("ETM-P <br /> Epoch Turbo Mill Pencil Neck");
articles_0[1].push("<ul class='ListStyle1'><li>Solid carbide end mill for high feed cutting at up to 10 x ØD</li></ul>");
articles_0[2].push("products/solid/shape/radius/index.php#row-etmp-th");
articles_0[3].push("thumb-etmp.jpg");

articles_0[0].push("HGOF <br /> GO-Line High Feed");
articles_0[1].push("<ul class='ListStyle1'><li>High feed - low rpm</li></ul>");
articles_0[2].push("products/solid/shape/radius/index.php#row-hgof");
articles_0[3].push("thumb-hgof.jpg");

/* Vorrat
articles_0[0].push("");
articles_0[1].push("");
articles_0[2].push("");
articles_0[3].push("");

*/

/* Preload images */
function init_article() {
	var image;
	for (var i=0; i<articles_0[3].length; i++) {
		image = new Image();
		image.src = "/images/home/news/" + articles_0[3][i];
	}
}

/* Zufallszahlen bestimmen */
function randomizer () {
	/* fuer erste Text-Box '0' */
	var max_random_0 = articles_0[0].length;
	random_0 = Math.floor(Math.random() * (max_random_0));
	
	/* fuer Text-Box B '1'
	var max_random_1 = articles_1[0].length;
	random_1 = Math.floor(Math.random() * (max_random_1));  */
	return;
}

function deliver_article() {
	randomizer();
	for (var i = 0; i < 1; i++) {	// reduced to single column 3/14/2011
		// Headline schreiben
		window.document.getElementById('feature_headline_' + i).innerHTML = eval("articles_" + i + "[0][" + "random_" + i + "]");
		// Artikel schreiben
		window.document.getElementById('feature_copy_' + i).innerHTML = eval("articles_" + i + "[1][" + "random_" + i + "]");
		// Bild schreiben
		window.document.getElementById('feature_image_' + i).innerHTML = "<img src=\"/images/home/news/" + eval("articles_" + i + "[3][" + "random_" + i + "]") + "\" width=\"100\" />";
		// Detail-Link schreiben 
		window.document.getElementById('feature_detail_href_' + i).href = eval('articles_' + i + '[2][' + "random_" + i + ']');
		// Headline-Link schreiben
		window.document.getElementById('feature_head_href_' + i).href = eval("articles_" + i + "[2][" + "random_" + i + "]");
		
	}
}

