function a() {
//	this.window.focus(); 
	setTimeout("this.window.navigate('#pagetp')", 1);
// setTimeout("a()", 3000);
	this.window.navigate('#pagetp');
}

var cit="";
var country=""; 
var b=this.location.href;
  if (b.indexOf('?') != -1) {
    var cit = b.substring(b.indexOf('?')+1, b.length);
  }
  if (b.indexOf('~') != -1) {
    var country = b.substring(b.indexOf('~')+1, b.lastIndexOf('/'));
  }

// ############ CITY #############
function country() {
alert(b.substring(b.indexOf('~')+1, b.lastIndexOf('/')));
}

// ############ CITY #############
function city() {
  if (cit != "") {
    var pr=cit
    if (cit.indexOf('_') != -1) {
      var pr = cit.substring(0, cit.indexOf('_'))+" "+cit.substring(cit.indexOf('_')+1, cit.length);
    }
    this.document.open();
      this.document.write(pr+", ");
    this.document.close();
  }
 else return true; 
}

// ############ CITY of HOME #############
function cithome() {
  if (cit != "") {
    this.window.location.href = cit+"/"+"index.html"; //to original CITY location CHANGE CASE!!!
  }
 else {
    this.window.location.href = "index.html"; //to RUSSIA page
  }
}

// ############################ it works 
function updated() {
	upd=document.write(this.document.lastModified.substring(0, 10));
	return upd;
}
/*
// ############################ endmonth 
function endmonth() {
now= new Date();
if(now.getDate() > 24) // -------------- CHANGE THE LIMIT DATE ACCORDING TO TRAFIC -- (the last date of normal work)
this.location.href="http://www.russianservice.com/bannerad/showban.asp?action=redir&campaign=477";
}
*/
// ############ GO TO SIZRANTZEV #############
function gowindow() {
	my=window.open("http://members.lycos.co.uk/artfetch/artists_fr.htm", "displayWindow", 
    "width=400,height=300,status=yes,toolbar=yes,menubar=yes,scrollbars=yes,location=yes");
}

//################ STARTING FROM TOP OF THE PAGE
function topstart() {
	var b = document.write;
	document.open();
b('<A NAME=\"pagetp\"></A><BR>');
	document.close();
}

// ############ PAGING for content's files #############
function head() {country(); return true; } // { endmonth(); return true;}
function bodytop() {topstart(); } //{home();}
function bodybot() {a();}
function myload() {return true;}
function myexit() {return true;} // {gowindow();}

// #####################################################
// ###################### SEND #######################
function send() {  

//    var adrs="page010.htm?"+cit; ------- looks good BUT doesn't work 
    var adrs="http://www.russianservice.com/bannerad/showban.asp?action=redir&campaign=477";

  temp_win= open(adrs, "send", "width=656,height=480,status=1,toolbar=1,menubar=1,location=1,directories=0,scrollbars=1,resizable=1,copyhistory=1");
  temp_win.focus();
}
/*
function send() {  // --------------------- instead of 477
  temp_win= open("http://www.russianservice.com/bannerad/showban.asp?action=redir&campaign=479", "send", "width=600,height=480,status=0,toolbar=0,menubar=0,location=0,directories=0,scrollbars=1,resizable=1,copyhistory=1");
  temp_win.focus();
}
*/
function send478() {
  temp_win= open("http://www.russianservice.com/bannerad/showban.asp?action=redir&campaign=478", "send", "width=600,height=480,status=1,toolbar=1,menubar=1,location=1,directories=0,scrollbars=1,resizable=1,copyhistory=1");
parent.window.location.href = "order.htm"+"?"+parent.cit; // try to engage
  temp_win.focus();
}

//############### ORDER
function order() {
	this.window.location.href = "order.htm"+"?"+cit; //
}

// ###################### E-MAIL-D #######################
function maild() {
  temp_win= open("", "maild", "width=500,height=40,status=0,toolbar=0,menubar=0,location=0,directories=0,scrollbars=0,resizable=0,");
  var a = temp_win.document.write;
  var ad = "ndraw";
  var ad3 = "ndraw";
  var ad4 = "yandex.ru";

    if (cit != "") {var d=cit;} 
    else {var d=country;}

  temp_win.document.open();
  
  a("<html><head><title>E-MAIL</title>");
  a("<META name=\"robors\" CONTENT=\"noindex\">\n");
  a("<META name=\"distribution\" CONTENT=\"iu\">\n");
  a("<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n");
  a("<META HTTP-EQUIV=\"Window-target\" CONTENT=\"_blank\">\n");
  a("<BASE target=\"_blank\">\n");
  a("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"../posy.css\">\n");
  a("<script language=\"JavaScript\"> <!-- \n function a() {\n this.window.focus(); \n } \n // --> </script>\n</HEAD>\n");
  a("<BODY BACKGROUND=\"../backht12.gif\">\n");
  a("<script language=\"JavaScript\"> <!-- \n a(); // --> </script>\n");
  a("<center><BR>");
  a("<TABLE WIDTH=\"89%\" ALIGN=\"center\" BORDER=0 CELLSPACING=2 CELLPADDING=0> <TR><TD CLASS=\"BUTTON\">");
  a("<A href=\"mailto:"+ad+"@yahoo.com?subject=interPOSY'S artfetch in "+d+"&bcc="+ad3+"@"+ad4+"\" TITLE=\"E-mail the designer \">E-MAIL @ TO WEBMASTER</a></TD></TR></TABLE>");
  a("&#9658;MAKE SURE THE WORD &quot;<B>artfetch</B>&quot; IS IN THE SUBJECT&#9668;");
  a("</center>");
  a("</body></html>");

  temp_win.document.close();  
}

//################ FOOTER 
function footer() {
	var a = document.write;

	document.open();
	a("<CENTER><DIV ALIGN=\"center\"><SMALL>");
	a("<P>This site was established on the 1st of September in 2000 and is maintained by <A HREF=\"javascript:maild()\" onClick=\"maild(); return false;\" TITLE=\"E-mail the webmaster\"> nDraw<SUP>&#174;</SUP> </a><BR>");
	
	a("<A HREF=\"http://ndraw.tripod.com/fr_set.htm\" TARGET=\"_blank\" TITLE=\"Visit the webmaster's page\">Copyright<SUP>&#169;</SUP> </A>1998 by the HTML Writers and Programmers from RUSSIA, <A HREF=\"http://ndraw.tripod.com/fr_set.htm\" TARGET=\"_blank\" TITLE=\"Do you want to have your own website like this one?\">nDraw<SUP>&#174;</SUP> Inc. </A></DIV><BR>");
	
	a("<P>This page is last time updated ");
	a("<script language=\"JavaScript\"> <!-- \n updated(); // --> </script></SMALL><BR>");

	document.close();
}


//################ FOOTER  BANNER FROM flamingo (on weblink.htm)  // onload, onreadystatechange - working events
function banner() {
	var a = document.write;

	document.open();
	a("<DIV ALIGN=\"center\">");

a("<IFRAME src=\"weblink.htm\" WIDTH=\"468\" HEIGHT=\"60\" SCROLLING=\"no\" FRAMEBORDER=\"0\" MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\" NAME=\"service\" onload=\"a()\"></IFRAME></DIV><BR>");  // onload=\"a()\"

	document.close();
}



//############### GARLAND
var nDots = 7;
var Xpos = 0;
var Ypos = 0;
var DELTAT = .01;
var SEGLEN = 10;
var SPRINGK = 10;
var MASS = 1;
var GRAVITY = 50;
var RESISTANCE = 10;
var STOPVEL = 0.1;
var STOPACC = 0.1;
var DOTSIZE = 11;
var BOUNCE = 0.75;
var isNetscape = navigator.appName=="Netscape";
var followmouse = true;
var dots = new Array();

function init()
{
    var i = 0;
    for (i = 0; i < nDots; i++) {
        dots[i] = new dot(i);
    }
    if (!isNetscape) {
    }
    for (i = 0; i < nDots; i++) {
        dots[i].obj.left = dots[i].X;
        dots[i].obj.top = dots[i].Y;
    }
    if (isNetscape) {
        startanimate();
    } else {
        setTimeout("startanimate()", 3000);
    }
}
function dot(i) 
{
    this.X = Xpos;
    this.Y = Ypos;
    this.dx = 0;
    this.dy = 0;
    if (isNetscape) {	
        this.obj = eval("document.dot" + i);
    } else {
        this.obj = eval("dot" + i + ".style");
    }
}
function startanimate() {	
    setInterval("animate()", 20);
}
function setInitPositions(dots)
{
    var startloc = document.all.tags("LI");
    var i = 0;
    for (i = 0; i < startloc.length && i < (nDots - 1); i++) {
        dots[i+1].X = startloc[i].offsetLeft
            startloc[i].offsetParent.offsetLeft - DOTSIZE;
        dots[i+1].Y = startloc[i].offsetTop +
            startloc[i].offsetParent.offsetTop + 2*DOTSIZE;
    }
    dots[0].X = dots[1].X;
    dots[0].Y = dots[1].Y - SEGLEN;
}
function MoveHandler(e)
{
    Xpos = e.pageX;
    Ypos = e.pageY;	  
    return true;
}

function vec(X, Y)
{
    this.X = X;
    this.Y = Y;
}
function springForce(i, j, spring)
{
    var dx = (dots[i].X - dots[j].X);
    var dy = (dots[i].Y - dots[j].Y);
    var len = Math.sqrt(dx*dx + dy*dy);
    if (len > SEGLEN) {
        var springF = SPRINGK * (len - SEGLEN);
        spring.X += (dx / len) * springF;
        spring.Y += (dy / len) * springF;
    }
}
function animate() {	
    var start = 0;
    if (followmouse) {
        dots[0].X = Xpos;
        dots[0].Y = Ypos;	
        start = 1;
    }
    for (i = start ; i < nDots; i++ ) {
        var spring = new vec(0, 0);
        if (i > 0) {
            springForce(i-1, i, spring);
        }
        if (i < (nDots - 1)) {
            springForce(i+1, i, spring);
        }
        var resist = new vec(-dots[i].dx * RESISTANCE,
            -dots[i].dy * RESISTANCE);
        var accel = new vec((spring.X + resist.X)/ MASS,
            (spring.Y + resist.Y)/ MASS + GRAVITY);
        dots[i].dx += (DELTAT * accel.X);
        dots[i].dy += (DELTAT * accel.Y);
        if (Math.abs(dots[i].dx) < STOPVEL &&
            Math.abs(dots[i].dy) < STOPVEL &&
            Math.abs(accel.X) < STOPACC &&
            Math.abs(accel.Y) < STOPACC) {
            dots[i].dx = 0;
            dots[i].dy = 0;
        }
        dots[i].X += dots[i].dx;
        dots[i].Y += dots[i].dy;
        var height, width;
        if (isNetscape) {
            height = window.innerHeight + document.scrollTop;
            width = window.innerWidth + document.scrollLeft;
        } else {	
            height = document.body.clientHeight + document.body.scrollTop;
            width = document.body.clientWidth + document.body.scrollLeft;
        }
        if (dots[i].Y >=  height - DOTSIZE - 1) {
            if (dots[i].dy > 0) {
                dots[i].dy = BOUNCE * -dots[i].dy;
            }
            dots[i].Y = height - DOTSIZE - 1;
        }
        if (dots[i].X >= width - DOTSIZE) {
            if (dots[i].dx > 0) {
                dots[i].dx = BOUNCE * -dots[i].dx;
            }
            dots[i].X = width - DOTSIZE - 1;
        }
        if (dots[i].X < 0) {
            if (dots[i].dx < 0) {
                dots[i].dx = BOUNCE * -dots[i].dx;
            }
            dots[i].X = 0;
        }
        dots[i].obj.left = dots[i].X;			
        dots[i].obj.top =  dots[i].Y;		
    }
}




