﻿// This Code Free To Use - Providing This Notice Remains
// JavaScript Code Effect Found At: Development Resource & JavaScript Code & Generator Public Archive Center
// Located: http://www.DesignerWiz.com
// Though This Material May Have Been In A Public Depository, Certain Author Copyright Restrictions May Apply

// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com
//
// For Netscape NS6up , Modified by Roberto de Jesus Asyn Diaz
//        Web Site:  http://usuarios.lycos.es/asynco/ 
//        email   :  rasyn@lycos.es                    
//
var wind_status = "off";
var timeoutID = null;
var background = "http://www.kupidonas.lt/images/fonas.gif";
var speed = 0;

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

function moveback(movert,movedn,hPos,vPos) {
 
  if (arguments[4])
    document.body.style.backgroundImage = "url(\"" + arguments[4] + "\")";
 
  if (arguments[5])
    document.body.style.backgroundRepeat = arguments[5]
 
  if (!isNaN(hPos)) {
    if ((movert!=0) && (hPos>0)) hPos=-100000
    hPos += movert
  } 
  if (!isNaN(vPos)) {
    if ((movedn!=0) && (vPos>0)) vPos=-100000
    vPos+= movedn
  }
 
  document.body.style.backgroundPosition= hPos + " " + vPos
  if (isNaN(hPos))  hPos = "\"" + hPos + "\""
  if (isNaN(vPos)) vPos = "\"" + vPos + "\""
  timeoutID = setTimeout("moveback("+movert+","+movedn+","+hPos+","+vPos+")",speed)
}

function wind() {
  if (wind_status == "off") {
    wind_status = "on";
    moveback(1,0,0,0, background);    
  } else {
    wind_status = "off";
    clearTimeout(timeoutID);
  }
}

/*
This is the URL of the background image you wish to animate. 
It is IMPERATIVE that you declare the URL of the image twice.
This is the speed at which the background moves.
This is the direction in which the background moves. 
The first "1" is the horizontal direction.
A "1" moves the background right, a "-1" moves it left, and a "0" keeps it put. 
The second "1" is the vertical direction.
A "1" moves the background down, a "-1" moves it up, and a "0" keeps it put.
*/
