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 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 copyRegData(){
if(document.getElementById('name1') && document.getElementById('name2') && document.getElementById('trnfullname')){
	 document.getElementById('trnfullname').value=document.getElementById('name1').value+' '+document.getElementById('name2').value;
}
if(document.getElementById('tel') && document.getElementById('trntel')){
	 document.getElementById('trntel').value=document.getElementById('tel').value;
}
if(document.getElementById('address') && document.getElementById('trnaddress')){
	 document.getElementById('trnaddress').value=document.getElementById('address').value;
}
if(document.getElementById('zip') && document.getElementById('trnzipcode')){
	 document.getElementById('trnzipcode').value=document.getElementById('zip').value;
}
if(document.getElementById('city') && document.getElementById('trncity')){
	 document.getElementById('trncity').value=document.getElementById('city').value;
}

}





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);
