﻿var state = 'none';
ypos = 0;
xpos = 0;

function NaghdiBuyPrn(aa) {
    //var userInput = document.getElementById('txtName').value;
    var xx = document.getElementById('txtName');
    mywindow = window.open('NaghdiBuyPrn.aspx', 'mywindow', 'width=630,height=700,resizable=1');

    mywindow.document.title = xx.Value;
}

function Parvaz() {
    R = 0; x1 = .1; y1 = .05; x2 = .25; y2 = .24; x3 = 1.6; y3 = .24; x4 = 300; y4 = 200; x5 = 300; y5 = 200;

    DI = document.images;
    DIL = DI.length;
    function A() {
        for (i = 0; i < DIL; i++) {
            DIS = DI[i].style;
            DIS.position = 'absolute';
            DIS.left = Math.sin(R * x1 + i * x2 + x3) * x4 + x5;
            DIS.top = Math.cos(R * y1 + i * y2 + y3) * y4 + y5
        }
        R++
    }
    setInterval('A()', 5);
    void (0)
}

function ali(x) {
    k = document.body.style.backgroundColor;
    document.body.style.backgroundColor = 24;
    document.title = "سید حسین موسوی";
    //var wd = document.getElementById("b2").getAttribute("width");

    alert(wd);

    //x.style.backgroundColor = 'red';
}




var wdmax = 120;          //set maximum width of square image (px)

var wdmin = 0;            //set minimum thickness of edge-on image (px)

var inc = 5;              //set step change in px (wdmax-wdmin must be a multiple) )These two variables

var rate = 50;          //pause between steps (in millisec)                      )determine flip-flop speed

var pause = 1000;       //pause between flip and flop (in millisec)

var ff = "flip";          //initialise whether movement starts with a "flip" (sideways) or "flop" (vertical) change.



function flipflop() {

    if (ff == "flip") {

        var wd = document.getElementById("b2").getAttribute("width");

        wd = wd - inc;

        document.getElementById("b2").setAttribute("width", wd);

        if (wd == wdmin) {

            //document.getElementById("bartarkala").setAttribute("src", "pic2.gif"); //substitute name of your second picture

            inc = -inc;

        }

        if (wd == wdmax) {

            ff = "flop";

            inc = -inc;

            setTimeout("flipflop()", pause);

        }

        else {

            setTimeout("flipflop()", rate);

        }

    }

    else {

        var ht = document.getElementById("b2").getAttribute("height");

        ht = ht - inc;

        document.getElementById("b2").setAttribute("height", ht);

        if (ht == wdmin) {

            //document.getElementById("bartarkala").setAttribute("src", "pic1.gif"); //substitute name of your first picture

            inc = -inc;

        }

        if (ht == wdmax) {

            ff = "flip";

            inc = -inc;

            setTimeout("flipflop()", pause);

        }

        else {

            setTimeout("flipflop()", rate);

        }

    }

}

