
// Initialize Canvas

canvas = document.getElementById("canvas");

ctx = canvas.getContext('2d');
var stage = new createjs.Stage("canvas");
var count = 0;
createjs.Touch.enable(stage);
stage.enableMouseOver();

var glow1 = new createjs.Shape();
var oudet = new createjs.Shape();
var oudet_text = new createjs.Text("ουδέτερος", "20px Arial", "blue");
oudet_text.x = 40;
oudet_text.y = 160;

var fasi1 = new createjs.Shape();
var fasi2 = new createjs.Shape();
var fasi3 = new createjs.Shape();
var fasi4 = new createjs.Shape();
var fasi5 = new createjs.Shape();
var fasi6 = new createjs.Shape();
var fasi7 = new createjs.Shape();
var fasi8 = new createjs.Shape();
var fasi9 = new createjs.Shape();

var hit1=new createjs.Shape();
var hit2=new createjs.Shape();
var hit3=new createjs.Shape();

var listener1, listener2, listener3;



var fasi_text = new createjs.Text("φάση", "20px Arial", "brown");
fasi_text.x = 40;
fasi_text.y = 210;

var fasi2 = new createjs.Shape();

var switchk1_1_l = new createjs.Shape();
var switchk1_1_r = new createjs.Shape();
var switchk1_2_r = new createjs.Shape();
var switchk1_2_l = new createjs.Shape();
var switch1_rect = new createjs.Shape();


var switchk2_1_l = new createjs.Shape();
var switchk2_1_r = new createjs.Shape();
var switchk2_2_r = new createjs.Shape();
var switchk2_2_l = new createjs.Shape();



var switchk2_3_l = new createjs.Shape();
var switchk2_3_r = new createjs.Shape();
var switchk2_3_r = new createjs.Shape();
var switchk2_3_l = new createjs.Shape();



var switch2_rect = new createjs.Shape();
var switch3_rect = new createjs.Shape();

switch1_rect.shadow = new createjs.Shadow("#000000", 3, 3, 14);
switch2_rect.shadow = new createjs.Shadow("#000000", 3, 3, 14);
switch3_rect.shadow = new createjs.Shadow("#000000", 3, 3, 14);

var switch1_text = new createjs.Text("Διακόπτης Δ1", "13px Arial", "#444444");
switch1_text.x = 0;
switch1_text.y = 340;

var switch2_text = new createjs.Text("Διακόπτης Δ2", "13px Arial", "#444444");
switch2_text.x = 570;
switch2_text.y = 340;

var switch3_text = new createjs.Text("Διακόπτης Δ3", "13px Arial", "#444444");
switch3_text.x = 393;
switch3_text.y = 330;

var lamp_on1, lamp_off1, lamp_on2, lamp_off2;
var electron1,electron2,electron3,electron4,electron5,electron6,electron7,electron8,electron9,electron10,electron11,electron12,electron13,electron14,electron15,electron16,electron17,electron18,electron19,electron20,electron21,electron22,electron23;
var electron24,electron25,electron26,electron27,electron28,electron29,electron30,electron31,electron32,electron33,electron34,electron35;

var electronk2_1,electronk2_2,electronk2_3,electronk2_24,electronk2_25,electronk2_26,electronk2_27,electronk2_28,electronk2_29,electronk2_30,electronk2_31,electronk2_32,electronk2_33,electronk2_34,electronk2_35;
var electron36,electron37,electron38,electron39,electron40,electron41,electron42,electron43,electron44,electron45,electron46,electron47,electron48,electron49,electron50,electron51,electron52,electron53,electron54,electron55,electron56,electron57,electron58,electron59,electron60,electron61;



var queue = new createjs.LoadQueue();

queue.on("complete", handleComplete);
queue.on("fileload", handleFileLoad);
queue.loadManifest([
    { id: "lamp_on", src: "images/lamp-on.png" },
    { id: "lamp_off", src: "images/lamp-off-2.png" }
]);


function handleFileLoad(event) {
    count += 1
    //console.log("asset " + count + " loaded");
}

function handleComplete(event) {
    lamp_on1 = new createjs.Bitmap(queue.getResult("lamp_on"));
    lamp_on1.x = 301.5;
    lamp_on1.y = 32;
    lamp_on1.scaleX = lamp_on1.scaleY = 0.42;

    lamp_off1 = new createjs.Bitmap(queue.getResult("lamp_off"));
    lamp_off1.x = 301;
    lamp_off1.y = 32;
    lamp_off1.scaleX = lamp_off1.scaleY = 0.42;

    lamp_on2 = new createjs.Bitmap(queue.getResult("lamp_on"));
    lamp_on2.x = 301.5;
    lamp_on2.y = 32;
    lamp_on2.scaleX = lamp_on2.scaleY = 0.42;
    lamp_on2.visible = false;


    lamp_off2 = new createjs.Bitmap(queue.getResult("lamp_off"));
    lamp_off2.x = 301;
    lamp_off2.y = 32;
    lamp_off2.scaleX = lamp_off2.scaleY = 0.42;
    lamp_off2.visible = false;

    stage.addChild(lamp_on1);
    stage.addChild(lamp_off1);
    //stage.addChild(lamp_on2);
    //stage.addChild(lamp_off2);

    
    //stage.addChild(glow1);




    oudet.graphics.setStrokeStyle(15).beginStroke("blue").moveTo(20, 190).lineTo(326, 190);
    stage.addChild(oudet);
    stage.addChild(oudet_text);

    fasi1.graphics.setStrokeStyle(15).beginStroke("brown").moveTo(20, 240).lineTo(95, 240).lineTo(95, 365).endStroke().setStrokeStyle(5).beginStroke("brown").moveTo(95,365).lineTo(95,378);
    //fasi1.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(90,382.4,3);
    //fasi1.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(75,415,3).endFill();
    //fasi1.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(105,415,3);
   

    stage.addChild(fasi_text);

    //switch1_rect.x=59.5;
    //switch1_rect.y=370.5;
    switch1_rect.graphics.beginStroke("black").setStrokeStyle(2).drawRect(59.5, 370.5, 70, 70);
    switch1_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(95, 382.4, 4);
    switch1_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(75, 429, 4).endFill();
    switch1_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(115, 429, 4);
    stage.addChild(switch1_rect);
    hit1 = new createjs.Shape();
	hit1.graphics.beginFill("#000").drawRect(59.5,370.5,70,70);
    switch1_rect.hitArea = hit1;
    switch1_rect.cursor="pointer";
    listener1 = switch1_rect.on("click", toggle_k1_1);
    

    switch2_rect.graphics.beginStroke("black").setStrokeStyle(2).drawRect(630.5, 370.5, 70, 70);
    switch2_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(665, 382.4, 4);
    switch2_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(644, 429, 4).endFill();
    switch2_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(685, 429, 4);
    stage.addChild(switch2_rect);
    hit2 = new createjs.Shape();
	hit2.graphics.beginFill("#000").drawRect(630.5, 370.5, 70, 70);
    switch2_rect.hitArea = hit2;
    switch2_rect.cursor="pointer";
    listener2 = switch2_rect.on("click", toggle_k1_2);


    switchk1_1_l.x = 94;
    switchk1_1_l.y = 387.5;
    switchk1_1_l.graphics.setStrokeStyle(5).beginStroke("#fccf5d").moveTo(0, 0).lineTo(-16, 37);
    //switchk1_1_l.cursor = "pointer";
    //switchk1_1_l.on("click", toggle_k1_1);

    switchk1_1_r.x = 94.6;
    switchk1_1_r.y = 387.5;
    switchk1_1_r.graphics.setStrokeStyle(5).beginStroke("#fccf5d").moveTo(0, 0).lineTo(17.4, 37);
    //switchk1_1_r.cursor = "pointer";
    //switchk1_1_r.on("click", toggle_k1_1);


    
    stage.addChild(switchk1_1_l);
    stage.addChild(switchk1_1_r);
    
    switchk1_1_r.visible = false;

    //switchk1_2 -START

    switchk1_2_l.x = 665;
    switchk1_2_l.y = 387.2;
    switchk1_2_l.graphics.setStrokeStyle(5).beginStroke("#fccf5d").moveTo(0, 0).lineTo(-17, 38);
    
    //switchk1_2_l.on("click", toggle_k1_2);

    switchk1_2_r.x = 665;
    switchk1_2_r.y = 387.2;
    switchk1_2_r.graphics.setStrokeStyle(5).beginStroke("#fccf5d").moveTo(0, 0).lineTo(17, 38);
    //switchk1_2_r.cursor = "pointer";
    //switchk1_2_r.on("click", toggle_k1_2);


    
    stage.addChild(switchk1_2_l);
    stage.addChild(switchk1_2_r);
    
    switchk1_2_r.visible = true;
    switchk1_2_l.visible = false;

    //switchk1_2 -END

    stage.addChild(fasi1);
    fasi2.graphics.setStrokeStyle(5).beginStroke("black").moveTo(75, 433).lineTo(75,446).beginStroke("black").setStrokeStyle(15).moveTo(75,446).lineTo(75, 510).lineTo(685, 510).lineTo(685, 446).setStrokeStyle(5).moveTo(685, 446).lineTo(685, 432);
    stage.addChild(fasi2);

    fasi3.graphics.setStrokeStyle(5).beginStroke("black").moveTo(115, 432).lineTo(115, 447).setStrokeStyle(15).moveTo(115,447).lineTo(115, 480).lineTo(644, 480).lineTo(644, 446).setStrokeStyle(5).moveTo(644, 446).lineTo(644,433);
    stage.addChild(fasi3);

    fasi4.graphics.setStrokeStyle(5).beginStroke("brown").moveTo(665, 379).lineTo(665, 364).setStrokeStyle(15).moveTo(665, 364).lineTo(665, 220).lineTo(352, 220).lineTo(352, 213);
    stage.addChild(fasi4);


    
    electron1=new createjs.Shape();
    electron1.x=35;
    electron1.y=240;
    electron1.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron1.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron1);

    electron2=new createjs.Shape();
    electron2.x=95;
    electron2.y=257;
    electron2.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron2.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron2);

    electron3=new createjs.Shape();
    electron3.x=95;
    electron3.y=317;
    electron3.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron3.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron3);

    electronk2_1=new createjs.Shape();
    electronk2_1.x=35;
    electronk2_1.y=240;
    electronk2_1.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_1.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    

    electronk2_2=new createjs.Shape();
    electronk2_2.x=95;
    electronk2_2.y=257;
    electronk2_2.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_2.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    

    electronk2_3=new createjs.Shape();
    electronk2_3.x=95;
    electronk2_3.y=317;
    electronk2_3.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_3.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    



    electron4=new createjs.Shape();
    electron4.x=75;
    electron4.y=460;
    electron4.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron4.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron4);

    electron5=new createjs.Shape();
    electron5.x=105;
    electron5.y=510;
    electron5.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron5.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron5);

   


     electron6=new createjs.Shape();
    electron6.x=173;
    electron6.y=510;
    electron6.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron6.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron6);

    electron7=new createjs.Shape();
    electron7.x=241;
    electron7.y=510;
    electron7.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron7.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron7);

    electron8=new createjs.Shape();
    electron8.x=309;
    electron8.y=510;
    electron8.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron8.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron8);

    electron9=new createjs.Shape();
    electron9.x=377;
    electron9.y=510;
    electron9.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron9.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron9);

    electron10=new createjs.Shape();
    electron10.x=445;
    electron10.y=510;
    electron10.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron10.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron10);

    electron11=new createjs.Shape();
    electron11.x=513;
    electron11.y=510;
    electron11.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron11.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron11);

    electron12=new createjs.Shape();
    electron12.x=581;
    electron12.y=510;
    electron12.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron12.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron12);

    electron13=new createjs.Shape();
    electron13.x=649;
    electron13.y=510;
    electron13.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron13.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron13);

    electron14=new createjs.Shape();
    electron14.x=686;
    electron14.y=498;
    electron14.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron14.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron14);

    //
    electron15=new createjs.Shape();
    electron15.x=115;
    electron15.y=460;
    electron15.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron15.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron15);

    electron16=new createjs.Shape();
    electron16.x=173;
    electron16.y=480;
    electron16.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron16.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron16);

    electron17=new createjs.Shape();
    electron17.x=241;
    electron17.y=480;
    electron17.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron17.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron17);

    electron18=new createjs.Shape();
    electron18.x=309;
    electron18.y=480;
    electron18.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron18.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron18);

    electron19=new createjs.Shape();
    electron19.x=377;
    electron19.y=480;
    electron19.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron19.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron19);

    electron20=new createjs.Shape();
    electron20.x=445;
    electron20.y=480;
    electron20.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron20.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron20);

    electron21=new createjs.Shape();
    electron21.x=513;
    electron21.y=480;
    electron21.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron21.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron21);

    electron22=new createjs.Shape();
    electron22.x=581;
    electron22.y=480;
    electron22.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron22.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron22);

    electron23=new createjs.Shape();
    electron23.x=630;
    electron23.y=480;
    electron23.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron23.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron23);

    electron24=new createjs.Shape();
    electron24.x=665;
    electron24.y=340;
    electron24.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron24.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron24);

    electron25=new createjs.Shape();
    electron25.x=665;
    electron25.y=272;
    electron25.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron25.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron25);

    electron26=new createjs.Shape();
    electron26.x=656;
    electron26.y=220;
    electron26.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron26.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron26);

    electron27=new createjs.Shape();
    electron27.x=588;
    electron27.y=220;
    electron27.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron27.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron27);

    electron28=new createjs.Shape();
    electron28.x=520;
    electron28.y=220;
    electron28.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron28.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron28);

    electron29=new createjs.Shape();
    electron29.x=452;
    electron29.y=220;
    electron29.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron29.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron29);

    electron30=new createjs.Shape();
    electron30.x=384;
    electron30.y=220;
    electron30.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron30.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron30);

    

    electron32=new createjs.Shape();
    electron32.x=93;
    electron32.y=190;
    electron32.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron32.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron32);

    electron33=new createjs.Shape();
    electron33.x=161;
    electron33.y=190;
    electron33.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron33.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron33);

    electron34=new createjs.Shape();
    electron34.x=229;
    electron34.y=190;
    electron34.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron34.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron34);

    electron35=new createjs.Shape();
    electron35.x=291;
    electron35.y=190;
    electron35.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron35.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    stage.addChild(electron35);

    
    for (i=1;i<=30;i++){
        window['electron'+i].visible=false;
    }

    for (i=32;i<=35;i++){
        window['electron'+i].visible=false;
    }





    createjs.Tween.get(electron1,{loop:true}).to({x:78},600,createjs.Ease.getPowInOut(2.5)).to({x:35},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron2,{loop:true}).to({y:295},600,createjs.Ease.getPowInOut(2.5)).to({y:257},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron3,{loop:true}).to({y:355},600,createjs.Ease.getPowInOut(2.5)).to({y:317},600,createjs.Ease.getPowInOut(2.5));
    
    createjs.Tween.get(electronk2_1,{loop:true}).to({x:78},600,createjs.Ease.getPowInOut(2.5)).to({x:35},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_2,{loop:true}).to({y:295},600,createjs.Ease.getPowInOut(2.5)).to({y:257},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_3,{loop:true}).to({y:355},600,createjs.Ease.getPowInOut(2.5)).to({y:317},600,createjs.Ease.getPowInOut(2.5));

    createjs.Tween.get(electron4,{loop:true}).to({y:498},600,createjs.Ease.getPowInOut(2.5)).to({y:460},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron5,{loop:true}).to({x:143},600,createjs.Ease.getPowInOut(2.5)).to({x:105},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron6,{loop:true}).to({x:211},600,createjs.Ease.getPowInOut(2.5)).to({x:173},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron7,{loop:true}).to({x:279},600,createjs.Ease.getPowInOut(2.5)).to({x:241},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron8,{loop:true}).to({x:347},600,createjs.Ease.getPowInOut(2.5)).to({x:309},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron9,{loop:true}).to({x:415},600,createjs.Ease.getPowInOut(2.5)).to({x:377},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron10,{loop:true}).to({x:483},600,createjs.Ease.getPowInOut(2.5)).to({x:445},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron11,{loop:true}).to({x:551},600,createjs.Ease.getPowInOut(2.5)).to({x:513},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron12,{loop:true}).to({x:619},600,createjs.Ease.getPowInOut(2.5)).to({x:581},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron13,{loop:true}).to({x:684},600,createjs.Ease.getPowInOut(2.5)).to({x:649},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron14,{loop:true}).to({y:461},600,createjs.Ease.getPowInOut(2.5)).to({y:498},600,createjs.Ease.getPowInOut(2.5));

    //
    createjs.Tween.get(electron15,{loop:true}).to({x:115,y:480},300).to({x:133,y:480},300,createjs.Ease.getPowInOut(2.5)).to({x:115,y:480},300,createjs.Ease.getPowInOut(2.5)).to({x:115,y:460},300,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron16,{loop:true}).to({x:211},600,createjs.Ease.getPowInOut(2.5)).to({x:173},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron23,{loop:true}).to({x:644,y:480},221).to({x:644,y:456},379,createjs.Ease.getPowInOut(2.5)).to({x:644,y:480},379,createjs.Ease.getPowInOut(2.5)).to({x:630,y:480},221);
    createjs.Tween.get(electron17,{loop:true}).to({x:279},600,createjs.Ease.getPowInOut(2.5)).to({x:241},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron18,{loop:true}).to({x:347},600,createjs.Ease.getPowInOut(2.5)).to({x:309},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron19,{loop:true}).to({x:415},600,createjs.Ease.getPowInOut(2.5)).to({x:377},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron20,{loop:true}).to({x:483},600,createjs.Ease.getPowInOut(2.5)).to({x:445},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron21,{loop:true}).to({x:551},600,createjs.Ease.getPowInOut(2.5)).to({x:513},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron22,{loop:true}).to({x:619},600,createjs.Ease.getPowInOut(2.5)).to({x:581},600,createjs.Ease.getPowInOut(2.5));

    //
    createjs.Tween.get(electron24,{loop:true}).to({y:302},600,createjs.Ease.getPowInOut(2.5)).to({y:340},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron25,{loop:true}).to({y:234},600,createjs.Ease.getPowInOut(2.5)).to({y:272},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron26,{loop:true}).to({x:618},600,createjs.Ease.getPowInOut(2.5)).to({x:656},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron27,{loop:true}).to({x:550},600,createjs.Ease.getPowInOut(2.5)).to({x:588},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron28,{loop:true}).to({x:482},600,createjs.Ease.getPowInOut(2.5)).to({x:520},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron29,{loop:true}).to({x:414},600,createjs.Ease.getPowInOut(2.5)).to({x:452},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron30,{loop:true}).to({x:353},600,createjs.Ease.getPowInOut(2.5)).to({x:384},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron32,{loop:true}).to({x:54},600,createjs.Ease.getPowInOut(2.5)).to({x:93},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron33,{loop:true}).to({x:122},600,createjs.Ease.getPowInOut(2.5)).to({x:161},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron34,{loop:true}).to({x:185},600,createjs.Ease.getPowInOut(2.5)).to({x:229},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron35,{loop:true}).to({x:253},600,createjs.Ease.getPowInOut(2.5)).to({x:291},600,createjs.Ease.getPowInOut(2.5));
    

    
    
    createjs.Ticker.interval=30;
    createjs.Ticker.on("tick",stage);

    stage.addChild(switch1_text);
    stage.addChild(switch2_text);

    

    
    

    switch3_rect.x = 340;
    switch3_rect.y = 365;
    switch3_rect.graphics.beginStroke("black").setStrokeStyle(2).drawRect(0, 0, 80, 75);
    //3 kykloi panw
    switch3_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(39, 17, 4);
    switch3_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(13, 17, 4);
    switch3_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(66, 17, 4);
    //2 kykloi katw
    switch3_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(27, 62, 4).endFill();
    switch3_rect.graphics.setStrokeStyle(2).beginStroke("black").drawCircle(53, 62, 4);

    //βραχυκύκλωση πάνω ακροδεκτών
    switch3_rect.graphics.setStrokeStyle(1).beginStroke("black").moveTo(12, 5).lineTo(66, 5).lineTo(66, 13).moveTo(12, 5).lineTo(12, 13);

    hit3 = new createjs.Shape();
	hit3.graphics.beginFill("#000").drawRect(0,0, 80, 75);
    switch3_rect.hitArea = hit3;
    switch3_rect.cursor="pointer";
    listener3 = switch3_rect.on("click", toggle_k2_3);
    

    switchk2_3_r.x = 366;
    switchk2_3_r.y = 422;
    switchk2_3_r.graphics.setStrokeStyle(4).beginStroke("#fccf5d").moveTo(0, 0).lineTo(11, -35);
    switchk2_3_r.graphics.setStrokeStyle(4).beginStroke("#fccf5d").moveTo(26, 0).lineTo(37, -35);
    switchk2_3_r.graphics.setStrokeStyle(2).beginStroke("#599100").moveTo(7, -17).lineTo(29.5, -17);
    switchk2_3_r.graphics.setStrokeStyle(2).beginStroke("#599100").moveTo(5, -11).lineTo(27.3, -11);
    //switchk2_3_r.cursor = "pointer";
    //switchk2_3_r.on("click", toggle_k2_3);

    switchk2_3_l.x = 366;
    switchk2_3_l.y = 422;
    switchk2_3_l.graphics.setStrokeStyle(4).beginStroke("#fccf5d").moveTo(0, 0).lineTo(-11, -35);
    switchk2_3_l.graphics.setStrokeStyle(4).beginStroke("#fccf5d").moveTo(26, 0).lineTo(14, -34);
    switchk2_3_l.graphics.setStrokeStyle(2).beginStroke("#599100").moveTo(-5, -17).lineTo(18, -17);
    switchk2_3_l.graphics.setStrokeStyle(2).beginStroke("#599100").moveTo(-2, -11).lineTo(20, -11);
    //switchk2_3_l.cursor = "pointer";
    //switchk2_3_r.on("click", toggle_k2_3);

   
    //switchk2_3_r.on("click", toggle_k2_3);


    
   //K2-3 switch END

    handle_k1_lamp();

    //start k2 circuit


    fasi5.graphics.setStrokeStyle(5).beginStroke("black").moveTo(115, 432).lineTo(115, 446).setStrokeStyle(15).beginStroke("black").moveTo(115, 446).lineTo(115,480).lineTo(270,480).lineTo(270,340).lineTo(379,340).lineTo(379,360).setStrokeStyle(5).beginStroke("black").moveTo(379,360).lineTo(379,377);//.lineTo(275, 480).lineTo(275, 350).lineTo(370, 350).lineTo(370, 380);
    //stage.addChild(fasi5);
    fasi6.graphics.setStrokeStyle(5).beginStroke("black").moveTo(75, 432).lineTo(75,446).setStrokeStyle(15).beginStroke("black").moveTo(75,446).lineTo(75, 510).lineTo(300, 510).lineTo(300, 381).lineTo(334,381).setStrokeStyle(5).beginStroke("black").moveTo(334,381).lineTo(349, 381);
    fasi7.graphics.setStrokeStyle(5).beginStroke("grey").moveTo(367, 432).lineTo(367,446).setStrokeStyle(15).beginStroke("grey").moveTo(367,446).lineTo(367, 510).lineTo(685, 510).lineTo(685,446).setStrokeStyle(5).beginStroke("grey").lineTo(685,446).lineTo(685, 433);
    fasi8.graphics.setStrokeStyle(5).beginStroke("grey").moveTo(393, 432).lineTo(393, 480).setStrokeStyle(15).beginStroke("grey").moveTo(392,446).lineTo(392, 485).lineTo(644, 485).lineTo(644, 446).setStrokeStyle(5).beginStroke("grey").moveTo(644,446).lineTo(644, 433);
    fasi9.graphics.setStrokeStyle(5).beginStroke("brown").moveTo(665, 380).lineTo(665,366).setStrokeStyle(15).beginStroke("brown").moveTo(665,366).lineTo(665, 220).lineTo(345, 220);
    
    electronk2_24=new createjs.Shape();
    electronk2_24.x=665;
    electronk2_24.y=340;
    electronk2_24.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_24.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_25=new createjs.Shape();
    electronk2_25.x=665;
    electronk2_25.y=272;
    electronk2_25.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_25.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_26=new createjs.Shape();
    electronk2_26.x=656;
    electronk2_26.y=220;
    electronk2_26.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_26.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_27=new createjs.Shape();
    electronk2_27.x=588;
    electronk2_27.y=220;
    electronk2_27.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_27.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_28=new createjs.Shape();
    electronk2_28.x=520;
    electronk2_28.y=220;
    electronk2_28.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_28.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_29=new createjs.Shape();
    electronk2_29.x=452;
    electronk2_29.y=220;
    electronk2_29.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_29.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_30=new createjs.Shape();
    electronk2_30.x=384;
    electronk2_30.y=220;
    electronk2_30.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_30.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_31=new createjs.Shape();
    electronk2_31.x=25;
    electronk2_31.y=190;
    electronk2_31.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_31.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    //stage.addChild(electronk2_31);

    electronk2_32=new createjs.Shape();
    electronk2_32.x=93;
    electronk2_32.y=190;
    electronk2_32.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_32.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_33=new createjs.Shape();
    electronk2_33.x=161;
    electronk2_33.y=190;
    electronk2_33.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_33.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_34=new createjs.Shape();
    electronk2_34.x=229;
    electronk2_34.y=190;
    electronk2_34.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_34.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    electronk2_35=new createjs.Shape();
    electronk2_35.x=291;
    electronk2_35.y=190;
    electronk2_35.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electronk2_35.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);

    createjs.Tween.get(electronk2_24,{loop:true}).to({y:302},600,createjs.Ease.getPowInOut(2.5)).to({y:340},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_25,{loop:true}).to({y:234},600,createjs.Ease.getPowInOut(2.5)).to({y:272},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_26,{loop:true}).to({x:618},600,createjs.Ease.getPowInOut(2.5)).to({x:656},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_27,{loop:true}).to({x:550},600,createjs.Ease.getPowInOut(2.5)).to({x:588},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_28,{loop:true}).to({x:482},600,createjs.Ease.getPowInOut(2.5)).to({x:520},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_29,{loop:true}).to({x:414},600,createjs.Ease.getPowInOut(2.5)).to({x:452},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_30,{loop:true}).to({x:353},600,createjs.Ease.getPowInOut(2.5)).to({x:384},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_32,{loop:true}).to({x:54},600,createjs.Ease.getPowInOut(2.5)).to({x:93},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_33,{loop:true}).to({x:122},600,createjs.Ease.getPowInOut(2.5)).to({x:161},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_34,{loop:true}).to({x:185},600,createjs.Ease.getPowInOut(2.5)).to({x:229},600,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electronk2_35,{loop:true}).to({x:253},600,createjs.Ease.getPowInOut(2.5)).to({x:291},600,createjs.Ease.getPowInOut(2.5));
    
    
    
    
    
    
    //sthn fasi5
    electron36=new createjs.Shape();
    electron36.x=115;
    electron36.y=453;
    electron36.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron36.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    //stage.addChild(electron36);
    //createjs.Tween.get(electron36,{loop:true}).to({y:483},473,createjs.Ease.getPowInOut(2.5)).to({x:123},127,createjs.Ease.getPowInOut(2.5)).to({x:115},127,createjs.Ease.getPowInOut(2.5)).to({y:453},473,createjs.Ease.getPowInOut(2.5));
    createjs.Tween.get(electron36,{loop:true}).to({y:480},473).to({x:123},127).to({x:115},127).to({y:453},473);


    electron37=new createjs.Shape();
    electron37.x=134;
    electron37.y=480;
    electron37.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron37.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron37,{loop:true}).to({x:172},600,createjs.Ease.getPowInOut(2.5)).to({x:134},600,createjs.Ease.getPowInOut(2.5));

    electron38=new createjs.Shape();
    electron38.x=202;
    electron38.y=480;
    electron38.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron38.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron38,{loop:true}).to({x:240},600,createjs.Ease.getPowInOut(2.5)).to({x:202},600,createjs.Ease.getPowInOut(2.5));

    electron39=new createjs.Shape();
    electron39.x=270;
    electron39.y=480;
    electron39.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron39.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron39,{loop:true}).to({y:445},600,createjs.Ease.getPowInOut(2.5)).to({y:480},600,createjs.Ease.getPowInOut(2.5));
    
    electron40=new createjs.Shape();
    electron40.x=270;
    electron40.y=415;
    electron40.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron40.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron40,{loop:true}).to({y:377},600,createjs.Ease.getPowInOut(2.5)).to({y:415},600,createjs.Ease.getPowInOut(2.5));
    
    electron41=new createjs.Shape();
    electron41.x=270;
    electron41.y=340;
    electron41.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron41.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron41,{loop:true}).to({x:308},600,createjs.Ease.getPowInOut(2.5)).to({x:270},600,createjs.Ease.getPowInOut(2.5));
    
    electron42=new createjs.Shape();
    electron42.x=338;
    electron42.y=340;
    electron42.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron42.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron42,{loop:true}).to({x:376},600,createjs.Ease.getPowInOut(2.5)).to({x:338},600,createjs.Ease.getPowInOut(2.5));
    
    //sthn fasi6
    electron43=new createjs.Shape();
    electron43.x=75;
    electron43.y=453;
    electron43.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron43.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron43,{loop:true}).to({y:491},600,createjs.Ease.getPowInOut(2.5)).to({y:453},600,createjs.Ease.getPowInOut(2.5));

    electron44=new createjs.Shape();
    electron44.x=75;
    electron44.y=510;
    electron44.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron44.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron44,{loop:true}).to({x:113},600,createjs.Ease.getPowInOut(2.5)).to({x:75},600,createjs.Ease.getPowInOut(2.5));
    
    electron45=new createjs.Shape();
    electron45.x=143;
    electron45.y=510;
    electron45.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron45.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron45,{loop:true}).to({x:181},600,createjs.Ease.getPowInOut(2.5)).to({x:143},600,createjs.Ease.getPowInOut(2.5));
    
    electron46=new createjs.Shape();
    electron46.x=211;
    electron46.y=510;
    electron46.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron46.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron46,{loop:true}).to({x:249},600,createjs.Ease.getPowInOut(2.5)).to({x:211},600,createjs.Ease.getPowInOut(2.5));
    
    electron47=new createjs.Shape();
    electron47.x=279;
    electron47.y=510;
    electron47.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron47.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron47,{loop:true}).to({x:301},300,createjs.Ease.getPowInOut(2.5)).to({y:490},300,createjs.Ease.getPowInOut(2.5)).to({y:510},300,createjs.Ease.getPowInOut(2.5)).to({x:279},300,createjs.Ease.getPowInOut(2.5));
    
    electron48=new createjs.Shape();
    electron48.x=301;
    electron48.y=475;
    electron48.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron48.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron48,{loop:true}).to({y:437},600,createjs.Ease.getPowInOut(2.5)).to({y:475},600,createjs.Ease.getPowInOut(2.5));
    
    electron49=new createjs.Shape();
    electron49.x=301;
    electron49.y=407;
    electron49.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron49.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron49,{loop:true}).to({y:381},350,createjs.Ease.getPowInOut(2.5)).to({x:320},250,createjs.Ease.getPowInOut(2.5)).to({x:301},250,createjs.Ease.getPowInOut(2.5)).to({y:407},350,createjs.Ease.getPowInOut(2.5));
    
    //fasi7
    
    electron50=new createjs.Shape();
    electron50.x=367;
    electron50.y=458;
    electron50.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron50.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron50,{loop:true}).to({y:496},600,createjs.Ease.getPowInOut(2.5)).to({y:458},600,createjs.Ease.getPowInOut(2.5));
    
    electron51=new createjs.Shape();
    electron51.x=377;
    electron51.y=511;
    electron51.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron51.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron51,{loop:true}).to({x:415},600,createjs.Ease.getPowInOut(2.5)).to({x:377},600,createjs.Ease.getPowInOut(2.5));
    
    electron52=new createjs.Shape();
    electron52.x=443;
    electron52.y=511;
    electron52.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron52.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron52,{loop:true}).to({x:481},600,createjs.Ease.getPowInOut(2.5)).to({x:443},600,createjs.Ease.getPowInOut(2.5));

    electron53=new createjs.Shape();
    electron53.x=511;
    electron53.y=511;
    electron53.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron53.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron53,{loop:true}).to({x:549},600,createjs.Ease.getPowInOut(2.5)).to({x:511},600,createjs.Ease.getPowInOut(2.5));

    electron54=new createjs.Shape();
    electron54.x=579;
    electron54.y=511;
    electron54.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron54.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron54,{loop:true}).to({x:617},600,createjs.Ease.getPowInOut(2.5)).to({x:579},600,createjs.Ease.getPowInOut(2.5));

    electron55=new createjs.Shape();
    electron55.x=647;
    electron55.y=511;
    electron55.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron55.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron55,{loop:true}).to({x:681},600,createjs.Ease.getPowInOut(2.5)).to({x:647},600,createjs.Ease.getPowInOut(2.5));
    
    electron56=new createjs.Shape();
    electron56.x=685;
    electron56.y=499;
    electron56.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron56.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron56,{loop:true}).to({y:461},600,createjs.Ease.getPowInOut(2.5)).to({y:499},600,createjs.Ease.getPowInOut(2.5));
    
    //fasi8
    electron57=new createjs.Shape();
    electron57.x=392;
    electron57.y=453;
    electron57.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron57.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron57,{loop:true}).to({y:483},600,createjs.Ease.getPowInOut(2.5)).to({y:453},600,createjs.Ease.getPowInOut(2.5));
    
    electron58=new createjs.Shape();
    electron58.x=416;
    electron58.y=485;
    electron58.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron58.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron58,{loop:true}).to({x:454},600,createjs.Ease.getPowInOut(2.5)).to({x:416},600,createjs.Ease.getPowInOut(2.5));

    electron59=new createjs.Shape();
    electron59.x=484;
    electron59.y=485;
    electron59.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron59.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron59,{loop:true}).to({x:522},600,createjs.Ease.getPowInOut(2.5)).to({x:484},600,createjs.Ease.getPowInOut(2.5));

    electron60=new createjs.Shape();
    electron60.x=552;
    electron60.y=485;
    electron60.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron60.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron60,{loop:true}).to({x:590},600,createjs.Ease.getPowInOut(2.5)).to({x:552},600,createjs.Ease.getPowInOut(2.5));

    electron61=new createjs.Shape();
    electron61.x=620;
    electron61.y=485;
    electron61.graphics.beginFill("#fccf5d").drawCircle(0,0,6);
    electron61.graphics.setStrokeStyle(2).beginStroke("black").moveTo(-3.6,0).lineTo(3.6,0);
    createjs.Tween.get(electron61,{loop:true}).to({x:644},410,createjs.Ease.getPowInOut(2.5)).to({y:465},190,createjs.Ease.getPowInOut(2.5)).to({y:485},190,createjs.Ease.getPowInOut(2.5)).to({x:620},410,createjs.Ease.getPowInOut(2.5));
    //k2 switches...

    

    switchk2_1_l.x = 93.5;
    switchk2_1_l.y = 387;
    switchk2_1_l.graphics.setStrokeStyle(5).beginStroke("#fccf5d").moveTo(0, 0).lineTo(-15, 37.5);
    //switchk2_1_l.cursor = "pointer";
    //switchk2_1_l.on("click", toggle_k2_1);

    switchk2_1_r.x = 93.5;
    switchk2_1_r.y = 387;
    switchk2_1_r.graphics.setStrokeStyle(5).beginStroke("#fccf5d").moveTo(0, 0).lineTo(18, 38);
    //switchk2_1_r.cursor = "pointer";
    //switchk2_1_r.on("click", toggle_k2_1);


   
    //stage.addChild(switchk2_1_clickable_rect);
    //stage.addChild(switchk2_1_l);
    //stage.addChild(switchk2_1_r);
    switchk2_1_r.visible = false;

    //switchk2_2 -START

    switchk2_2_l.x = 664;
    switchk2_2_l.y = 387;
    switchk2_2_l.graphics.setStrokeStyle(5).beginStroke("#fccf5d").moveTo(0, 0).lineTo(-17, 37);
    //switchk2_2_l.cursor = "pointer";
    //switchk2_2_l.on("click", toggle_k2_2);

    switchk2_2_r.x = 664;
    switchk2_2_r.y = 387;
    switchk2_2_r.graphics.setStrokeStyle(5).beginStroke("#fccf5d").moveTo(0, 0).lineTo(18, 38);
    //switchk2_2_r.cursor = "pointer";
    //switchk2_2_r.on("click", toggle_k2_2);


    
    //stage.addChild(switchk2_2_clickable_rect);
    //stage.addChild(switchk2_2_l);
    //stage.addChild(switchk2_2_r);
    switchk2_2_r.visible = true;
    switchk2_2_l.visible = false;

    //switchk1_2 -END



    stage.update();
}






