var win = null;

function CenterWindow(mypage,w,h,myname){
    var bgcolor="#FFFFFF";
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    var settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition;
    win = window.open('photo.php?id='+mypage+'&w='+w+'&h='+h, null, settings);

/*    win = window.open("picture.htm","newWindow","width="+w+",height="+h+",left="+LeftPosition+",top="+TopPosition);
    win.document.open();
    win.document.write('<html><title>'+myname+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');  
    win.document.write('<table width='+w+' border="0" cellspacing="0" cellpadding="0" align="center" height='+h+'><tr><td>');
    win.document.write('<img src="http://213.35.214.54'+mypage+'" width='+w+' height='+h+'>'); 
    win.document.write('</td></tr></table></body></html>');
    win.document.close();
    win.focus();*/
}

function CenterWindow2(mypage,w,h,mtype){
    var bgcolor="#FFFFFF";
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    var settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+'location=no,menubar=no,scrollbars=no,status=no,titlebar=no,toolbar=no';
    win = window.open('imgfull.php?id='+mypage+'&mtype='+mtype, null, settings);
}


function addone(kogus){
    if (!isNaN(kogus.value)) kogus.value++;	
    else kogus.value=1; 
    kogus.select();
/*    return false;*/
}

function minusone(kogus){
    if (!isNaN(kogus.value) && kogus.value>1) kogus.value--;
    else kogus.value='0'; 
    kogus.select();
    return false;
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

