/******************************************************************************
 *                                                                            *
 * Jelen programkód felhasználása a tulajdonos írásos engedélye nélkül        *
 * SZIGORUAN TILOS!                                                           *
 *                                                                            *
 * Copyright 2005 (C) FotoMarket Kft.                                         *
 *                                                                            *
 ******************************************************************************/
var nav='';
var ua=navigator.userAgent;
if(navigator.userAgent.indexOf('Opera') != -1) nav='OPR'; else
if(navigator.userAgent.indexOf('MSIE') != -1) nav='MIE'; else
if(navigator.userAgent.indexOf('Firefox') != -1) nav='FOX'; else
if(navigator.userAgent.indexOf('Mozilla/4.') != -1) nav='NS4'; else
if(navigator.userAgent.indexOf('Mozilla/5.') != -1) nav='NS6';

function newWindow(url,frame){
	ablak=window.open(url,frame,'width=440,height=440,scrollbars=yes');
	ablak.focus();
}

function openPage(url,target){
    window.open(url,target);
}

function megnyit(url) {
	window.open(url,'_self');
}

function wizard(url,width,height){
	if((nav=='NS4')||(nav=='OPR')){
		alert('Az Ön böngészője nem alkalmas a varázsló futtatására!\nKérjük használja az alábbi programok valamelyikét:\n\nInternet Explorer 4.0 - vagy újabb\nNetscape 7.0 - vagy újabb\nMozilla 1.0 - vagy újabb');
	} else {
		var top=Math.floor((screen.height-height)/2);
		var left=Math.floor((screen.width-width)/2);
		if (nav=='OPR') height+=20;
		var date = new Date();
		popwin=window.open(url+'&timestamp='+date.getTime(),'picture','top='+top+',left='+left+',width='+width+',height='+height+',resizable=no');
		popwin.focus();
	}
}

function meretek() {
	darab=document.regform.numsizes.value;
	var text='';

	text='<table width="170px" cellspacing="0" cellpadding="1" border="0">';
	text+='<tr><td>Név</td><td>Fogy. ár.</td><td>Viszont. ár.</td><td colspan="3" align="center">Optimális felbontás</td><td colspan="3" align="center">Minimális felbontás</td><td>Engedélyezve</td></tr>';
	for (i=0;i<darab;i++) {
		var sizename=0;
		var shopprice=0;
		var resellerprice=0;
		var optx=0;
		var opty=0;
		var miny=0;
		var minx=0;
		var	priceenabled=0;

		if (eval('document.regform.sizename'+i))      sizename=eval('document.regform.sizename'+i+'.value');
		if (eval('document.regform.shopprice'+i))     shopprice=eval('document.regform.shopprice'+i+'.value');
		if (eval('document.regform.resellerprice'+i)) resellerprice=eval('document.regform.resellerprice'+i+'.value');
		if (eval('document.regform.optx'+i))          optx=eval('document.regform.optx'+i+'.value');
		if (eval('document.regform.opty'+i))          opty=eval('document.regform.opty'+i+'.value');
		if (eval('document.regform.minx'+i))          minx=eval('document.regform.minx'+i+'.value');
		if (eval('document.regform.miny'+i))          miny=eval('document.regform.miny'+i+'.value');
		if (eval('document.regform.priceenabled'+i))  priceenabled=eval('document.regform.priceenabled'+i+'.value');

		text+='<tr><td><input class="input" type="text" name="sizename'+i+'" size="12" ';
		if (sizename!="0") text+='value="'+sizename+'"';
		text+=' /></td>';

		text+='<td><input type="text" class="input" style="text-align: right" name="shopprice'+i+'" size="5" ';
		if (shopprice!="0") text+='value="'+shopprice+'"';
		text+=' /></td>';

		text+='<td><input type="text" class="input" style="text-align: right" name="resellerprice'+i+'" size="5" ';
		if (resellerprice!="0") text+='value="'+resellerprice+'"';
		text+=' /></td>';

		text+='<td><input type="text" class="input" style="text-align: right" name="opty'+i+'" size="4" ';
		if (opty!="0") text+='value="'+opty+'"';
		text+=' /></td><td>X</td>';

		text+='<td><input type="text" class="input" style="text-align: right" name="optx'+i+'" size="4" ';
		if (optx!="0") text+='value="'+optx+'"';
		text+=' /></td>';

		text+='<td><input type="text" class="input" style="text-align: right" name="miny'+i+'" size="4" ';
		if (miny!="0") text+='value='+miny;
		text+=' /></td><td>X</td>'; 

		text+='<td><input type="text" class="input" style="text-align: right" name="minx'+i+'" size="4" ';
		if (minx!="0") text+='value="'+minx+'"';
		text+=' /></td>';

		text+='<td><input type="checkbox" name="priceenabled'+i+'" ';
		if (priceenabled!="0") text+='value="'+priceenabled+'" checked';
		text+=' /></td></tr>';
	} // end for
	text+='</table>';

	document.getElementById('meret').innerHTML=text;
}
