var win=null;
var product='ASPXNEST';


function popwindow(mypage,myname,w,h,scroll,pos){
w = screen.width - 5;
h = screen.height - 74;
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
//settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
settings='width='+w+',height='+h+',top='+0+',left='+0+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no';
win2=window.open(mypage,myname+product,settings);win2.focus();}


function popwindow2(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h-100)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
win=open(mypage,myname+product,settings); win.focus();}


function p(mypage,w,h){
var scroll = 'yes';
var pos = 'center';
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h-100)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no';
win=open(mypage,'popup',settings); win.focus();}


function fullwindow(mypage,myname,w,h,scroll,pos){
w = screen.width - 5;
h = screen.height - 74;
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
//settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
settings='width='+w+',height='+h+',top='+0+',left='+0+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no';
win2=window.open(mypage,myname+product,settings);win2.focus();}


function expandingWindow(website) {
var windowprops='width=100,height=100,scrollbars=yes,status=yes,resizable=no'
var heightspeed = 250; // vertical scrolling speed (higher = slower)
var widthspeed = 250;  // horizontal scrolling speed (higher = slower)
var leftdist = 0;    // distance to left edge of window
var topdist = 0;     // distance to top edge of window

if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = window.screen.availWidth - leftdist;
var winheight = window.screen.availHeight - topdist;
var sizer = window.open("",product,"left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.resizeTo(winwidth, winheight);

sizer.location = website;
sizer.focus();
}
else
window.open(website,'mywindows'+product);
}


function closeWindow() {
var windowprops='width=100,height=100,scrollbars=yes,status=yes,resizable=no'
var heightspeed = 100; // vertical scrolling speed (higher = slower)
var widthspeed = 100;  // horizontal scrolling speed (higher = slower)
var leftdist = 0;    // distance to left edge of window
var topdist = 0;     // distance to top edge of window


if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = window.screen.availWidth - leftdist;
var winheight = window.screen.availHeight - topdist;
for (sizeheight = winheight; sizeheight > 1; sizeheight -= heightspeed)
{
window.resizeTo(winwidth, sizeheight);
window.moveBy(heightspeed,0);
}
for (sizewidth = winwidth; sizewidth > 1; sizewidth -= widthspeed)
{
window.resizeTo(sizewidth, sizeheight);
window.moveBy(0,widthspeed);
}

}
else
{
alert('in the else clause');
}

window.close();
}


function modelesswin(url,mwidth,mheight){
if (document.all&&window.print) //if ie5
eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
else
eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1,scrollbars=1")')
}


