// this function is for the popup window


var win=null;
function open_Window(mypage,myname,w,h,scroll,pos,statbar){
win = null;
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=="top"){
LeftPosition=0;
TopPosition=0;
}
else if(pos=="top1"){
LeftPosition=100;
TopPosition=30;
}
else if((pos!="center" && pos!="random") || pos==null){
LeftPosition=0;
TopPosition=20;
}
if((statbar!="yes" && statbar!="no") || statbar==null){
statbar="no"
}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status='+statbar+',menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
}


function close_Window(){
	if (win != null){
		if (win.closed){ 	
			win = null;
			return;
		}
		else {
			win.close();
			win = null;
			return;
		}
	}
	else { 
		return;
	}
}

