var timer; var userEvent = "nothing"; var vbg=0; var bgby=30; var bgt1y=45; var bgt2y=70; var maxbgb=125; var texta1; //var texta2; //var texta3; var textb1; var textb2; var textb3; var textb4; var i=0; var rat; var ra1; var ra2; var ra3; var rab; var rbt; var rb1; var rb2; var rb3; var rb4; var rbb; //textsize=12; //textxa=10; //textxb=85; var ya1=0; var widtha1=0; var maxya1=25; var maxwidtha1=100; var heighta1=20; var ya2=0; var widtha2=0; var maxya2=45; var maxwidtha2=100; var heighta2=20; var ya3=0; var widtha3=0; var maxya3=65; var maxwidtha3=100; var heighta3=20; var ya4=0; var widtha4=0; var maxya4=85; var maxwidtha4=100; var heighta4=20; var ya5=0; var widtha5=0; var maxya5=105; var maxwidtha5=100; var heighta5=20; var ya6=0; var widtha6=0; var maxya6=125; var maxwidtha6=100; var heighta6=20; var ya1t=0; var maxya1t=40; var ya2t=0; var maxya2t=60; var ya3t=0; var maxya3t=80; var ya4t=0; var maxya4t=100; var ya5t=0; var maxya5t=120; var ya6t=0; var maxya6t=140; var heightat=25; var heighta1=20; var heighta2=20; var heighta3=20; var heighta4=20; var heighta5=20; var heighta6=20; var widtha=100; var widthab=100; var heightab=5; var yab=0; var maxyab=145; var yb1=0; var widthb1=0; var maxyb1=25; var maxwidthb1=100; var heightb1=20; var yb2=0; var widthb2=0; var maxyb2=45; var maxwidthb2=100; var heightb2=20; var yb3=0; var widthb3=0; var maxyb3=65; var maxwidthb3=100; var heightb3=20; var yb4=0; var widthb4=0; var maxyb4=85; var maxwidthb4=100; var heightb4=20; var yb1t=0; var maxyb1t=40; var yb2t=0; var maxyb2t=60; var yb3t=0; var maxyb3t=80; var yb4t=0; var maxyb4t=100; var heightbt=25; var heightb1=20; var heightb2=20; var heightb3=20; var heightb4=20; var widthb=100; var widthbb=100; var heightbb=5; var ybb=0; var maxybb=105; var spa1=2; var spa2=2.5; var spa3=3; var spa4=3.5; var spa5=4; var spa6=4.5; var spab=5; var spa1t=2; var spa2t=2.5; var spa3t=3; var spa4t=3.5; var spa5t=4; var spa6t=4.5; var spb1=2; var spb2=2.5; var spb3=3; var spb4=3.5; var spbb=4; var spb1t=2; var spb2t=2.5; var spb3t=3; var spb4t=3.5; var center; var opa1=0; var opa2=0; var opa3=0; var opa4=0; var opa5=0; var opa6=0; var opab=0; var opa1t=0; var opa2t=0; var opa3t=0; var opa4t=0; var opa5t=0; var opa6t=0; var opb1=0; var opb2=0; var opb3=0; var opb4=0; var opbb=0; var opb1t=0; var opb2t=0; var opb3t=0; var opb4t=0; var opabg=1; var textbox1; var textbox2; function initsvg(evt){ if ( window.svgDocument == null ){ svgDocument = e.target.ownerDocument; } svgObj = svgDocument.documentElement; var svgItem; //------------------------------------------------------------------------------ Object Search rat=svgDocument.getElementById("rat"); rat.addEventListener("mouseover", eventmouseOver, false); rat.addEventListener("mouseout", eventmouseOut, false); ra1=svgDocument.getElementById("ra1"); ra1.addEventListener("mouseover", eventmouseOver, false); ra1.addEventListener("mouseout", eventmouseOut, false); ra2=svgDocument.getElementById("ra2"); ra2.addEventListener("mouseover", eventmouseOver, false); ra2.addEventListener("mouseout", eventmouseOut, false); ra3=svgDocument.getElementById("ra3"); ra3.addEventListener("mouseover", eventmouseOver, false); ra3.addEventListener("mouseout", eventmouseOut, false); ra4=svgDocument.getElementById("ra4"); ra4.addEventListener("mouseover", eventmouseOver, false); ra4.addEventListener("mouseout", eventmouseOut, false); ra5=svgDocument.getElementById("ra5"); ra5.addEventListener("mouseover", eventmouseOver, false); ra5.addEventListener("mouseout", eventmouseOut, false); ra6=svgDocument.getElementById("ra6"); ra6.addEventListener("mouseover", eventmouseOver, false); ra6.addEventListener("mouseout", eventmouseOut, false); rab=svgDocument.getElementById("rab"); rab.addEventListener("mouseover", eventmouseOver, false); rab.addEventListener("mouseout", eventmouseOut, false); rbt=svgDocument.getElementById("rbt"); rbt.addEventListener("mouseover", eventmouseOver, false); rbt.addEventListener("mouseout", eventmouseOut, false); rb1=svgDocument.getElementById("rb1"); rb1.addEventListener("mouseover", eventmouseOver, false); rb1.addEventListener("mouseout", eventmouseOut, false); rb2=svgDocument.getElementById("rb2"); rb2.addEventListener("mouseover", eventmouseOver, false); rb2.addEventListener("mouseout", eventmouseOut, false); rb3=svgDocument.getElementById("rb3"); rb3.addEventListener("mouseover", eventmouseOver, false); rb3.addEventListener("mouseout", eventmouseOut, false); rb4=svgDocument.getElementById("rb4"); rb4.addEventListener("mouseover", eventmouseOver, false); rb4.addEventListener("mouseout", eventmouseOut, false); rbb=svgDocument.getElementById("rbb"); rbb.addEventListener("mouseover", eventmouseOver, false); rbb.addEventListener("mouseout", eventmouseOut, false); texta=svgDocument.getElementById("texta"); texta.addEventListener("mouseover", eventmouseOver, false); texta.addEventListener("mouseout", eventmouseOut, false); texta1=svgDocument.getElementById("texta1"); texta1.addEventListener("mouseover", eventmouseOver, false); texta1.addEventListener("mouseout", eventmouseOut, false); texta2=svgDocument.getElementById("texta2"); texta2.addEventListener("mouseover", eventmouseOver, false); texta2.addEventListener("mouseout", eventmouseOut, false); texta3=svgDocument.getElementById("texta3"); texta3.addEventListener("mouseover", eventmouseOver, false); texta3.addEventListener("mouseout", eventmouseOut, false); texta4=svgDocument.getElementById("texta4"); texta4.addEventListener("mouseover", eventmouseOver, false); texta4.addEventListener("mouseout", eventmouseOut, false); texta5=svgDocument.getElementById("texta5"); texta5.addEventListener("mouseover", eventmouseOver, false); texta5.addEventListener("mouseout", eventmouseOut, false); texta6=svgDocument.getElementById("texta6"); texta6.addEventListener("mouseover", eventmouseOver, false); texta6.addEventListener("mouseout", eventmouseOut, false); textb=svgDocument.getElementById("textb"); textb.addEventListener("mouseover", eventmouseOver, false); textb.addEventListener("mouseout", eventmouseOut, false); textb1=svgDocument.getElementById("textb1"); textb1.addEventListener("mouseover", eventmouseOver, false); textb1.addEventListener("mouseout", eventmouseOut, false); textb2=svgDocument.getElementById("textb2"); textb2.addEventListener("mouseover", eventmouseOver, false); textb2.addEventListener("mouseout", eventmouseOut, false); textb3=svgDocument.getElementById("textb3"); textb3.addEventListener("mouseover", eventmouseOver, false); textb3.addEventListener("mouseout", eventmouseOut, false); textb4=svgDocument.getElementById("textb4"); textb4.addEventListener("mouseover", eventmouseOver, false); textb4.addEventListener("mouseout", eventmouseOut, false); rbg=svgDocument.getElementById("rbg"); rbg.addEventListener("mouseover", eventmouseOver, false); rbg.addEventListener("mouseout", eventmouseOut, false); textbg1=svgDocument.getElementById("textbg1"); textbg1.addEventListener("mouseover", eventmouseOver, false); textbg1.addEventListener("mouseout", eventmouseOut, false); textbg2=svgDocument.getElementById("textbg2"); textbg2.addEventListener("mouseover", eventmouseOver, false); textbg2.addEventListener("mouseout", eventmouseOut, false); //------------------------------------------------------------------------------ Object Search end domefirst(); } function domefirst(){ timer = setTimeout("doWorld()", 1); } function doWorld(){ if ( userEvent != "nothing") { if ( userEvent == "bringa" ) { showra(); shutbg(); shutrb(); } if ( userEvent == "bringb" ) { showrb(); shutbg(); shutra(); } if ( userEvent == "shuta" ) { shutra();shutrb();showbg(); } if ( userEvent == "shutb" ) { shutrb();shutra();showbg(); } } else { // var x = parseInt(); } setTimeout("doWorld()", 1); } function showbg() { opabg = opabg + 0.1; if ( opabg > 1 ) opabg = 1; rbg.setAttribute("opacity", opabg); textbg1.setAttribute("opacity", opabg); textbg2.setAttribute("opacity", opabg); vbg = vbg - 4; if ( vbg < 0 ) vbg = 0; rbg.setAttribute("y", vbg + bgby ); textbg1.setAttribute("y", vbg + bgt1y ); textbg2.setAttribute("y", vbg + bgt2y ); } function shutbg() { opabg = opabg - 0.1; if ( opabg < 0.2 ) opabg = 0.2; rbg.setAttribute("opacity", opabg); textbg1.setAttribute("opacity", opabg); textbg2.setAttribute("opacity", opabg); vbg = vbg + 4; if ( vbg > maxbgb ) vbg = maxbgb; rbg.setAttribute("y", vbg + bgby ); textbg1.setAttribute("y", vbg + bgt1y ); textbg2.setAttribute("y", vbg + bgt2y ); } function showra() { increya1();posya1();widena1();opaa1(); increya2();posya2();widena2();opaa2(); increya3();posya3();widena3();opaa3(); increya4();posya4();widena4();opaa4(); increya5();posya5();widena5();opaa5(); increya6();posya6();widena6();opaa6(); increya1t();posya1t();opaa1t(); increya2t();posya2t();opaa2t(); increya3t();posya3t();opaa3t(); increya4t();posya4t();opaa4t(); increya5t();posya5t();opaa5t(); increya6t();posya6t();opaa6t(); increyab();posyab();opaab(); } function showrb() { increyb1();posyb1();widenb1();opab1(); increyb2();posyb2();widenb2();opab2(); increyb3();posyb3();widenb3();opab3(); increyb4();posyb4();widenb4();opab4(); increyb1t();posyb1t();opab1t(); increyb2t();posyb2t();opab2t(); increyb3t();posyb3t();opab3t(); increyb4t();posyb4t();opab4t(); increybb();posybb();opabb(); } function shutra() { decreya1();posya1();narrna1();opda1(); decreya2();posya2();narrna2();opda2(); decreya3();posya3();narrna3();opda3(); decreya4();posya4();narrna4();opda4(); decreya5();posya5();narrna5();opda5(); decreya6();posya6();narrna6();opda6(); decreya1t();posya1t();opda1t(); decreya2t();posya2t();opda2t(); decreya3t();posya3t();opda3t(); decreya4t();posya4t();opda4t(); decreya5t();posya5t();opda5t(); decreya6t();posya6t();opda6t(); decreyab();posyab();opdab(); } function shutrb() { decreyb1();posyb1();narrnb1();opdb1(); decreyb2();posyb2();narrnb2();opdb2(); decreyb3();posyb3();narrnb3();opdb3(); decreyb4();posyb4();narrnb4();opdb4(); decreyb1t();posyb1t();opdb1t(); decreyb2t();posyb2t();opdb2t(); decreyb3t();posyb3t();opdb3t(); decreyb4t();posyb4t();opdb4t(); decreybb();posybb();opdbb(); } function eventmouseOver(evt){ center = evt.target.id; if ( center == "ra1" || center == "ra2" || center == "ra3" || center == "ra4" || center == "ra5" || center == "ra6" || center == "texta1" || center == "texta2" || center == "texta3" || center == "texta4" || center == "texta5" || center == "texta6" || center == "texta" || center == "rat" || center == "rab" ) userEvent = "bringa"; if ( center == "rb1" || center == "rb2" || center == "rb3" || center == "rb4" || center == "textb1" || center == "textb2" || center == "textb3" || center == "textb4" || center == "textb" || center == "rbt" || center == "rbb" ) userEvent = "bringb"; } function eventmouseOut(evt){ center = evt.target.id; if ( center == "texta" || center == "rat" ) userEvent = "shuta"; if ( center == "textb" || center == "rbt" ) userEvent = "shutb"; } function increya1() { ya1 = ya1 + spa1; if ( ya1 > maxya1 ) ya1 = maxya1; } function increya2() { ya2 = ya2 + spa2; if ( ya2 > maxya2 ) ya2 = maxya2; } function increya3() { ya3 = ya3 + spa3; if ( ya3 > maxya3 ) ya3 = maxya3; } function increya4() { ya4 = ya4 + spa4; if ( ya4 > maxya4 ) ya4 = maxya4; } function increya5() { ya5 = ya5 + spa5; if ( ya5 > maxya5 ) ya5 = maxya5; } function increya6() { ya6 = ya6 + spa6; if ( ya6 > maxya6 ) ya6 = maxya6; } function increyb1() { yb1 = yb1 + spb1; if ( yb1 > maxyb1 ) yb1 = maxyb1; } function increyb2() { yb2 = yb2 + spb2; if ( yb2 > maxyb2 ) yb2 = maxyb2; } function increyb3() { yb3 = yb3 + spb3; if ( yb3 > maxyb3 ) yb3 = maxyb3; } function increyb4() { yb4 = yb4 + spb4; if ( yb4 > maxyb4 ) yb4 = maxyb4; } function increyab() { yab = yab + spab; if ( yab > maxyab ) yab = maxyab; } function increybb() { ybb = ybb + spbb; if ( ybb > maxybb ) ybb = maxybb; } function increya1t() { ya1t = ya1t + spa1t; if ( ya1t > maxya1t ) ya1t = maxya1t; } function increya2t() { ya2t = ya2t + spa2t; if ( ya2t > maxya2t ) ya2t = maxya2t; } function increya3t() { ya3t = ya3t + spa3t; if ( ya3t > maxya3t ) ya3t = maxya3t; } function increya4t() { ya4t = ya4t + spa4t; if ( ya4t > maxya4t ) ya4t = maxya4t; } function increya5t() { ya5t = ya5t + spa5t; if ( ya5t > maxya5t ) ya5t = maxya5t; } function increya6t() { ya6t = ya6t + spa6t; if ( ya6t > maxya6t ) ya6t = maxya6t; } function increyb1t() { yb1t = yb1t + spb1t; if ( yb1t > maxyb1t ) yb1t = maxyb1t; } function increyb2t() { yb2t = yb2t + spb2t; if ( yb2t > maxyb2t ) yb2t = maxyb2t; } function increyb3t() { yb3t = yb3t + spb3t; if ( yb3t > maxyb3t ) yb3t = maxyb3t; } function increyb4t() { yb4t = yb4t + spb4t; if ( yb4t > maxyb4t ) yb4t = maxyb4t; } function decreya1() { ya1 = ya1 - spa1; if ( ya1 < 0 ) ya1 = 0; } function decreya2() { ya2 = ya2 - spa2; if ( ya2 < 0 ) ya2 = 0; } function decreya3() { ya3 = ya3 - spa3; if ( ya3 < 0 ) ya3 = 0; } function decreya4() { ya4 = ya4 - spa4; if ( ya4 < 0 ) ya4 = 0; } function decreya5() { ya5 = ya5 - spa5; if ( ya5 < 0 ) ya5 = 0; } function decreya6() { ya6 = ya6 - spa6; if ( ya6 < 0 ) ya6 = 0; } function decreyb1() { yb1 = yb1 - spb1; if ( yb1 < 0 ) yb1 = 0; } function decreyb2() { yb2 = yb2 - spb2; if ( yb2 < 0 ) yb2 = 0; } function decreyb3() { yb3 = yb3 - spb3; if ( yb3 < 0 ) yb3 = 0; } function decreyb4() { yb4 = yb4 - spb4; if ( yb4 < 0 ) yb4 = 0; } function decreyab() { yab = yab - spab; if ( yab < 0 ) yab = 0; } function decreybb() { ybb = ybb - spbb; if ( ybb < 0 ) ybb = 0; } function decreya1t() { ya1t = ya1t - spa1t; if ( ya1t < 0 ) ya1t = 0; } function decreya2t() { ya2t = ya2t - spa2t; if ( ya2t < 0 ) ya2t = 0; } function decreya3t() { ya3t = ya3t - spa3t; if ( ya3t < 0 ) ya3t = 0; } function decreya4t() { ya4t = ya4t - spa4t; if ( ya4t < 0 ) ya4t = 0; } function decreya5t() { ya5t = ya5t - spa5t; if ( ya5t < 0 ) ya5t = 0; } function decreya6t() { ya6t = ya6t - spa6t; if ( ya6t < 0 ) ya6t = 0; } function decreyb1t() { yb1t = yb1t - spb1t; if ( yb1t < 0 ) yb1t = 0; } function decreyb2t() { yb2t = yb2t - spb2t; if ( yb2t < 0 ) yb2t = 0; } function decreyb3t() { yb3t = yb3t - spb3t; if ( yb3t < 0 ) yb3t = 0; } function decreyb4t() { yb4t = yb4t - spb4t; if ( yb4t < 0 ) yb4t = 0; } function posya1() { ra1.setAttribute("y", ya1); } function posya2() { ra2.setAttribute("y", ya2); } function posya3() { ra3.setAttribute("y", ya3); } function posya4() { ra4.setAttribute("y", ya4); } function posya5() { ra5.setAttribute("y", ya5); } function posya6() { ra6.setAttribute("y", ya6); } function posyb1() { rb1.setAttribute("y", yb1); } function posyb2() { rb2.setAttribute("y", yb2); } function posyb3() { rb3.setAttribute("y", yb3); } function posyb4() { rb4.setAttribute("y", yb4); } function posyab() { rab.setAttribute("y", yab); } function posybb() { rbb.setAttribute("y", ybb); } function posya1t() { texta1.setAttribute("y", ya1t); } function posya2t() { texta2.setAttribute("y", ya2t); } function posya3t() { texta3.setAttribute("y", ya3t); } function posya4t() { texta4.setAttribute("y", ya4t); } function posya5t() { texta5.setAttribute("y", ya5t); } function posya6t() { texta6.setAttribute("y", ya6t); } function posyb1t() { textb1.setAttribute("y", yb1t); } function posyb2t() { textb2.setAttribute("y", yb2t); } function posyb3t() { textb3.setAttribute("y", yb3t); } function posyb4t() { textb4.setAttribute("y", yb4t); } function widena1() { widtha1 = widtha1 + spa1; if ( widtha1 > maxwidtha1 ) widtha1 = maxwidtha1; ra1.setAttribute("width", widtha1); } function widena2() { widtha2 = widtha2 + spa2; if ( widtha2 > maxwidtha2 ) widtha2 = maxwidtha2; ra2.setAttribute("width", widtha2); } function widena3() { widtha3 = widtha3 + spa3; if ( widtha3 > maxwidtha3 ) widtha3 = maxwidtha3; ra3.setAttribute("width", widtha3); } function widena4() { widtha4 = widtha4 + spa4; if ( widtha4 > maxwidtha4 ) widtha4 = maxwidtha4; ra4.setAttribute("width", widtha4); } function widena5() { widtha5 = widtha5 + spa5; if ( widtha5 > maxwidtha5 ) widtha5 = maxwidtha5; ra5.setAttribute("width", widtha5); } function widena6() { widtha6 = widtha6 + spa6; if ( widtha6 > maxwidtha6 ) widtha6 = maxwidtha6; ra6.setAttribute("width", widtha6); } function widenb1() { widthb1 = widthb1 + spb1; if ( widthb1 > maxwidthb1 ) widthb1 = maxwidthb1; rb1.setAttribute("width", widthb1); } function widenb2() { widthb2 = widthb2 + spb2; if ( widthb2 > maxwidthb2 ) widthb2 = maxwidthb2; rb2.setAttribute("width", widthb2); } function widenb3() { widthb3 = widthb3 + spb3; if ( widthb3 > maxwidthb3 ) widthb3 = maxwidthb3; rb3.setAttribute("width", widthb3); } function widenb4() { widthb4 = widthb4 + spb4; if ( widthb4 > maxwidthb4 ) widthb4 = maxwidthb4; rb4.setAttribute("width", widthb4); } function narrna1() { widtha1 = widtha1 - spa1; if ( widtha1 < 0 ) widtha1 = 0; ra1.setAttribute("width", widtha1); } function narrna2() { widtha2 = widtha2 - spa2; if ( widtha2 < 0 ) widtha2 = 0; ra2.setAttribute("width", widtha2); } function narrna3() { widtha3 = widtha3 - spa3; if ( widtha3 < 0 ) widtha3 = 0; ra3.setAttribute("width", widtha3); } function narrna4() { widtha4 = widtha4 - spa4; if ( widtha4 < 0 ) widtha4 = 0; ra4.setAttribute("width", widtha4); } function narrna5() { widtha5 = widtha5 - spa5; if ( widtha5 < 0 ) widtha5 = 0; ra5.setAttribute("width", widtha5); } function narrna6() { widtha6 = widtha6 - spa6; if ( widtha6 < 0 ) widtha6 = 0; ra6.setAttribute("width", widtha6); } function narrnb1() { widthb1 = widthb1 - spb1; if ( widthb1 < 0 ) widthb1 = 0; rb1.setAttribute("width", widthb1); } function narrnb2() { widthb2 = widthb2 - spb2; if ( widthb2 < 0 ) widthb2 = 0; rb2.setAttribute("width", widthb2); } function narrnb3() { widthb3 = widthb3 - spb3; if ( widthb3 < 0 ) widthb3 = 0; rb3.setAttribute("width", widthb3); } function narrnb4() { widthb4 = widthb4 - spb4; if ( widthb4 < 0 ) widthb4 = 0; rb4.setAttribute("width", widthb4); } function opaa1() { if ( widtha1 > 50 ) opa1 = 0.2; ra1.setAttribute("opacity", opa1); } function opaa2() { if ( widtha2 > 50 ) opa2 = 0.2; ra2.setAttribute("opacity", opa2); } function opaa3() { if ( widtha3 > 50 ) opa3 = 0.2; ra3.setAttribute("opacity", opa3); } function opaa4() { if ( widtha4 > 50 ) opa4 = 0.2; ra4.setAttribute("opacity", opa4); } function opaa5() { if ( widtha5 > 50 ) opa5 = 0.2; ra5.setAttribute("opacity", opa5); } function opaa6() { if ( widtha6 > 50 ) opa6 = 0.2; ra6.setAttribute("opacity", opa6); } function opab1() { if ( widthb1 > 50 ) opb1 = 0.2; rb1.setAttribute("opacity", opb1); } function opab2() { if ( widthb2 > 50 ) opb2 = 0.2; rb2.setAttribute("opacity", opb2); } function opab3() { if ( widthb3 > 50 ) opb3 = 0.2; rb3.setAttribute("opacity", opb3); } function opab4() { if ( widthb4 > 50 ) opb4 = 0.2; rb4.setAttribute("opacity", opb4); } function opaab() { if ( yab > 30 ) opab = 1; rab.setAttribute("opacity", opab); } function opabb() { if ( ybb > 30 ) opbb = 1; rbb.setAttribute("opacity", opbb); } function opaa1t() { if ( widtha1 > 50 ) opa1t = opa1t + 0.04; if ( opa1t >= 1 ) opa1t = 1; svgDocument.getElementById("texta1").setAttribute("opacity", opa1t); } function opaa2t() { if ( widtha2 > 50 ) opa2t = opa2t + 0.04; if ( opa2t >= 1 ) opa2t = 1; svgDocument.getElementById("texta2").setAttribute("opacity", opa2t); } function opaa3t() { if ( widtha3 > 50 ) opa3t = opa3t + 0.04; if ( opa3t >= 1 ) opa3t = 1; svgDocument.getElementById("texta3").setAttribute("opacity", opa3t); } function opaa4t() { if ( widtha4 > 50 ) opa4t = opa4t + 0.04; if ( opa4t >= 1 ) opa4t = 1; svgDocument.getElementById("texta4").setAttribute("opacity", opa4t); } function opaa5t() { if ( widtha5 > 50 ) opa5t = opa5t + 0.04; if ( opa5t >= 1 ) opa5t = 1; svgDocument.getElementById("texta5").setAttribute("opacity", opa5t); } function opaa6t() { if ( widtha6 > 50 ) opa6t = opa6t + 0.04; if ( opa6t >= 1 ) opa6t = 1; svgDocument.getElementById("texta6").setAttribute("opacity", opa6t); } function opab1t() { if ( widthb1 > 50 ) opb1t = opb1t + 0.04; if ( opb1t >= 1 ) opb1t = 1; svgDocument.getElementById("textb1").setAttribute("opacity", opb1t); } function opab2t() { if ( widthb2 > 50 ) opb2t = opb2t + 0.04; if ( opb2t >= 1 ) opb2t = 1; svgDocument.getElementById("textb2").setAttribute("opacity", opb2t); } function opab3t() { if ( widthb3 > 50 ) opb3t = opb3t + 0.04; if ( opb3t >= 1 ) opb3t = 1; svgDocument.getElementById("textb3").setAttribute("opacity", opb3t); } function opab4t() { if ( widthb4 > 50 ) opb4t = opb4t + 0.04; if ( opb4t >= 1 ) opb4t = 1; svgDocument.getElementById("textb4").setAttribute("opacity", opb4t); } function opda1() { if ( widtha1 < 50 ) opa1 = 0; ra1.setAttribute("opacity", opa1); } function opda2() { if ( widtha2 < 50 ) opa2 = 0; ra2.setAttribute("opacity", opa2); } function opda3() { if ( widtha3 < 50 ) opa3 = 0; ra3.setAttribute("opacity", opa3); } function opda4() { if ( widtha4 < 50 ) opa4 = 0; ra4.setAttribute("opacity", opa4); } function opda5() { if ( widtha5 < 50 ) opa5 = 0; ra5.setAttribute("opacity", opa5); } function opda6() { if ( widtha6 < 50 ) opa6 = 0; ra6.setAttribute("opacity", opa6); } function opdb1() { if ( widthb1 < 50 ) opb1 = 0; rb1.setAttribute("opacity", opb1); } function opdb2() { if ( widthb2 < 50 ) opb2 = 0; rb2.setAttribute("opacity", opb2); } function opdb3() { if ( widthb3 < 50 ) opb3 = 0; rb3.setAttribute("opacity", opb3); } function opdb4() { if ( widthb4 < 50 ) opb4 = 0; rb4.setAttribute("opacity", opb4); } function opdab() { if ( yab < 30 ) opab = 0; rab.setAttribute("opacity", opab); } function opdbb() { if ( ybb < 30 ) opbb = 0; rbb.setAttribute("opacity", opbb); } function opda1t() { if ( ya1t < 48 ) opa1t = opa1t - 0.2; if ( opa1t < 0 ) opa1t = 0; texta1.setAttribute("opacity", opa1t); } function opda2t() { if ( ya2t < 48 ) opa2t = opa2t - 0.2; if ( opa2t < 0 ) opa2t = 0; texta2.setAttribute("opacity", opa2t); } function opda3t() { if ( ya3t < 48 ) opa3t = opa3t - 0.2; if ( opa3t < 0 ) opa3t = 0; texta3.setAttribute("opacity", opa3t); } function opda4t() { if ( ya4t < 48 ) opa4t = opa4t - 0.2; if ( opa4t < 0 ) opa4t = 0; texta4.setAttribute("opacity", opa4t); } function opda5t() { if ( ya5t < 48 ) opa5t = opa5t - 0.2; if ( opa5t < 0 ) opa5t = 0; texta5.setAttribute("opacity", opa5t); } function opda6t() { if ( ya6t < 48 ) opa6t = opa6t - 0.2; if ( opa6t < 0 ) opa6t = 0; texta6.setAttribute("opacity", opa6t); } function opdb1t() { if ( yb1t < 48 ) opb1t = opb1t - 0.2; if ( opb1t < 0 ) opb1t = 0; textb1.setAttribute("opacity", opb1t); } function opdb2t() { if ( yb2t < 48 ) opb2t = opb2t - 0.2; if ( opb2t < 0 ) opb2t = 0; textb2.setAttribute("opacity", opb2t); } function opdb3t() { if ( yb3t < 48 ) opb3t = opb3t - 0.2; if ( opb3t < 0 ) opb3t = 0; textb3.setAttribute("opacity", opb3t); } function opdb4t() { if ( yb4t < 48 ) opb4t = opb4t - 0.2; if ( opb4t < 0 ) opb4t = 0; textb4.setAttribute("opacity", opb4t); } function opaa1tdummy() { textbox = svgDocument.getElementById("texta1"); opa1t=opa1t+0.04; textbox.setAttribute("opacity", opa1t); textbox = textbox.getFirstChild(); textbox.setData("Baboya");} function calculateRadius(x, y, x1, y1){ var radius = Math.round(Math.sqrt( Math.pow((x1 - x), 2) + Math.pow((y1 - y), 2) )); return(radius); } function calculateAngle(x, y, x1, y1){ var angle; // in the event that they are both the same if (x1 == x && y1 == y){ angle = 0; } else if (x > x1 && y == y1){ angle = 0; } else if (x == x1 && y > y1){ angle = 90; } else if (x < x1 && y == y1){ angle = 180; } else if (x == x1 && y < y1){ angle = 270; } else if (x > x1 && y > y1){ angle = Math.atan((y - y1)/(x - x1)) / (Math.PI / 180); } else if (x < x1 && y > y1){ angle = Math.atan((x1 - x)/(y - y1)) / (Math.PI / 180); angle = angle + 90; } else if (x < x1 && y < y1){ angle = Math.atan((y1 - y)/(x1 - x)) / (Math.PI / 180); angle = angle + 180; } else if (x > x1 && y < y1){ angle = Math.atan((x - x1)/(y1 - y)) / (Math.PI / 180); angle = angle + 270; } else { alert("LOST"); } if ( ++angle > 359 ){ angle = 0; } return(Math.round(angle)); } //============================================================================== // Function that Creates Box //------------------------------------------------------------------------------ function createBox(id,x,y,w,h,f,s,o) { var svgItem; svgItem = svgDocument.createElement("rect"); svgItem.setAttribute("id", id); svgItem.setAttribute("x", x); svgItem.setAttribute("y", y); svgItem.setAttribute("width", w); svgItem.setAttribute("height", h); svgItem.setAttribute("fill", f); svgItem.setAttribute("stroke", s); svgItem.setAttribute("opacity", o); svgDocument.getElementById("worldofcircles").appendChild(svgItem); return svgItem; } //============================================================================== //============================================================================== // Function that Creates Text //------------------------------------------------------------------------------ //function createText(id,x,y,f,s,o,fs,txt) { function createText(id,x,y,f,o,fs,txt) { var svgItem; var textBlock; var svgItem2; textBlock = svgDocument.createTextNode(txt); svgItem = svgDocument.createElement("text"); svgItem.setAttribute("id", id); svgItem.setAttribute("x", x); svgItem.setAttribute("y", y); svgItem.setAttribute("fill", f); // svgItem.setAttribute("stroke", s); svgItem.setAttribute("opacity", o); svgItem.setAttribute("font-size", fs); svgItem2 = svgDocument.createElement("a"); svgItem2.setAttribute("xlink:href", "http://172.16.2.1/"); svgItem2.appendChild(textBlock); svgItem.appendChild(svgItem2); svgDocument.getElementById("worldoflines").appendChild(svgItem); return svgItem } //============================================================================== //============================================================================== // Function that Creates Anchor //------------------------------------------------------------------------------ //function createAnchor(id,x,y,f,s,o,fs,txt) { function createAnchor(id,x,y,f,o,fs,txt) { var svgItem; var textBlock; textBlock = svgDocument.createTextNode(txt); svgItem = svgDocument.createElement("text"); svgItem.setAttribute("id", id); svgItem.setAttribute("x", x); svgItem.setAttribute("y", y); svgItem.setAttribute("fill", f); // svgItem.setAttribute("stroke", s); svgItem.setAttribute("opacity", o); svgItem.setAttribute("font-size", fs); svgItem.appendChild(textBlock); svgDocument.getElementById("worldoflines").appendChild(svgItem); return svgItem } //==============================================================================