function WindowGlideInit(obj) {
this.glideTo = DoubleYouWindowGlideTo;
this.glideStart = DoubleYouWindowGlideStart;
this.glide = DoubleYouWindowGlide;
this.stretchTo = DoubleYouWindowStretchTo;
this.stretchStart = DoubleYouWindowStretchStart;
this.stretch = DoubleYouWindowStretch;
this.Width = (is.ns)? window.innerWidth : document.body.offsetWidth;
this.Height = (is.ns)? window.innerHeight : document.body.offsetHeight;
this.obj=obj;
}
function DoubleYouWindowGlideTo(initx,inity,endx,endy,angleinc,speed,fn) {
this.glideStart(initx,inity,endx,endy,angleinc,speed,fn);
}
function DoubleYouWindowGlideStart(initx,inity,endx,endy,angleinc,speed,fn) {
var amplitudx=endx-initx;
var amplitudy=endy-inity;
this.glide(initx,inity,amplitudx,amplitudy,0,angleinc,speed,fn);
}
function DoubleYouWindowGlide(initx,inity,amplitudx,amplitudy,angle,angleinc,speed,fn) {
angle+=angleinc;
if (angle<=90) {
var posx=initx+amplitudx*Math.sin(angle*Math.PI/180);
var posy=inity+amplitudy*Math.sin(angle*Math.PI/180);
this.moveTo(posx,posy);
setTimeout(this.obj+'.glide('+initx+','+inity+','+amplitudx+','+amplitudy+','+angle+','+angleinc+','+speed+',\''+fn+'\')',speed);
} else {
eval(fn);
}
}
function DoubleYouWindowStretchTo(endwidth,endheight,angleinc,speed,fn) {
this.stretchStart(endwidth,endheight,angleinc,speed,fn);
}
function DoubleYouWindowStretchStart(endwidth,endheight,angleinc,speed,fn) {
this.Width = (is.ns)? window.innerWidth : document.body.offsetWidth+6;
this.Height = (is.ns)? window.innerHeight : document.body.offsetHeight+25;
if (is.ns) {
var amplitudwidth=endwidth-this.Width;
var amplitudheight=endheight-this.Height;
}
if (is.ie) {
var amplitudwidth=endwidth-this.Width+14;
var amplitudheight=endheight-this.Height+48;
}
this.stretch(this.Width,this.Height,amplitudwidth,amplitudheight,0,angleinc,speed,fn);
}
function DoubleYouWindowStretch(initwidth,initheight,amplitudwidth,amplitudheight,angle,angleinc,speed,fn) {
angle+=angleinc;
if (angle<=90) {
var newWidth=initwidth+amplitudwidth*Math.sin(angle*Math.PI/180);
var newHeight=initheight+amplitudheight*Math.sin(angle*Math.PI/180);
this.resizeTo(newWidth,newHeight);
setTimeout(this.obj+'.stretch('+initwidth+','+initheight+','+amplitudwidth+','+amplitudheight+','+angle+','+angleinc+','+speed+',\''+fn+'\')',speed);
} else {
eval(fn);
}
}