var newWin;

function openpopupImgFullSize(popurl, width, height) {
   if (null != newWin  && !newWin.closed)  closeNewWindow();

   var props = 'width=' +width +',height=' +height +',scrollbars=yes,resizable=yes,top=30,status=no,menubar=no,directories=no,location=no,toolbar=no';
   newWin=window.open(popurl,'',props);
   newWin.focus();
}

function openpopupDealerList(popurl, width, height) {
   if (null != newWin  && !newWin.closed)  closeNewWindow();

   var props = 'width=' +width +',height=' +height +',scrollbars=yes,resizable=yes,top=30,status=no,menubar=no,directories=no,location=no,toolbar=no';
   newWin=window.open(popurl,'',props);
   newWin.focus();
}

function openNewWindowSomeControl(page, width, height) {
    if (null != newWin && !newWin.closed) closeNewWindow();

    var props = 'width=' +width +',height=' +height +',scrollbars=yes,resizable=yes,screenX=50,screenY=50,top=50,left=50,status=no,menubar=no,directories=no,location=no,toolbar=no';
	newWin=window.open(page,'',props);
    newWin.focus();
}

function closeNewWindow() {
   newWin.close();
   this.focus();
}

function openNewWindow(page) {
    if (null != newWin && !newWin.closed) closeNewWindow();
    newWin=window.open(page,'','width=300,height=300,scrollbars=yes,resizable=yes,screenX=0,screenY=0,top=0,left=0,status=yes,menubar=yes,directories=yes,location=yes,toolbar=yes');
    newWin.focus();
}

function openNewWindowFullControl(page,width,height,scrollbars,resizable,screenX,screenY,top,left,status,menubar,directories,location,toolbar) {
    if (null != newWin && !newWin.closed) closeNewWindow();

    var props = 'width=' +width +',height=' +height +',scrollbars=' +scrollbars +',resizable=' +resizable +',screenX=' +screenX +',screenY=' +screenY +',top=' +top +',left=' +left +',status=' +status +',menubar=' +menubar +',directories=' +directories +',location=' +location +'toolbar=' +toolbar;
    newWin=window.open(page,'',props);
    newWin.focus();
}

function NewWindow(mypage, myname, w, h, scroll) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function OpenFullScreen(page) {
    if (null != newWin && !newWin.closed) closeNewWindow();
    newWin=window.open(page,'','fullscreen=yes,scrollbars=yes,resizable=yes,screenX=0,screenY=0,top=0,left=0,status=yes,menubar=yes,directories=yes,location=yes,toolbar=yes');
    newWin.focus();
}