function showFullSize(picUrl)
{
  	var Win1 = window.open("", "", "width=600,height=600,scrollbars=yes,resizable=yes");
	Win1.document.open();
  	Win1.document.write("<html><head><title>Galéria</title></head><body style=\"padding:0;margin:0\">");
  	Win1.document.write('<img src="/write/gallery/'+picUrl+'">');
  	Win1.document.write("</body></html>");
  	Win1.document.close();
	return false;	
}


function showMidSize(picUrl, pwidth, pheight)
{
  pwidth += 20;
  pheight += 20;
  var param = "width="+pwidth+",height="+pheight+",resizable=yes,scrollbars=1";
  var Win1 = window.open("", "", param);
  var pos = picUrl.search("/medium/");
  var bigPic = picUrl.substring(0,pos) + "/" + picUrl.substring((pos+8));
  
  Win1.document.open();
  Win1.document.write('<html><head><title>Galéria</title>');
//  Win1.document.write('<script text="text/javascript" src="/misc/kpluszr.js"></script>');
  Win1.document.write('</head><body style=\"padding:0;margin:0\">');
  Win1.document.write('<a href="#" onClick="javascript:document.location.href=\'/write/gallery/'+bigPic+'\';return false"  title="Teljes méret"><img src="/write/gallery/'+picUrl+'" width="'+pwidth+'" height="'+pheight+'" border="0" alt="Teljes méret"></a>');
  Win1.document.write("</body></html>");
 
  Win1.document.close();
  return false;	
}

function showZoomPic(picUrl, pwidth, pheight)
{
  pwidth += 20;
  pheight += 20;
  var param = "width="+pwidth+",height="+pheight+",resizable=yes,scrollbars=1";
  var Win1 = window.open("", "", param);
  
  Win1.document.open();
  Win1.document.write('<html><head><title>SUNG-GARD Hungary</title>');
//  Win1.document.write('<script text="text/javascript" src="/misc/kpluszr.js"></script>');
  Win1.document.write('</head><body style=\"padding:0;margin:0\">');
  Win1.document.write('<img src="'+picUrl+'" width="'+pwidth+'" height="'+pheight+'" border="0">');
  Win1.document.write("</body></html>");
 
  Win1.document.close();
  return false;	
}



/* FOLIAKONFIGURÁTOR: ADATOK ÚJRATÖLTÉSE */

function loaderTipus(tipus) {

  var req = new XMLHttpRequest();
  if (req) {
    req.onreadystatechange = function() {
      if (req.readyState == 4 && (req.status == 200 || req.status == 304)) {
        eval(req.responseText);
      }
    };
    req.open('POST', '/index/loadcartype');

    req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
    req.send('autotipus=' + tipus + '&cmd=loadCarType');
  }
}

function loaderSzin(tipus,szin) {
  var req = new XMLHttpRequest();
  if (req) {
    req.onreadystatechange = function() {
      if (req.readyState == 4 && (req.status == 200 || req.status == 304)) {
        eval(req.responseText);
      }
    };
    req.open('POST', '/index/loadcolor');

    req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');

    req.send('autotipus=' + tipus + '&autoszin=' + szin + '&cmd=loadColor');
  }
}
/* FOLIAKONFIGURATOR: ADATOK UJRATOLTESE VEGE */

function kepcsere(url) {
	document.getElementById('nagykep').src = "/misc/images/konfigurator/" + url;
}

function csekk(kep) {
	if (document.getElementById('autotipus').value == '0') {
		alert('Előbb válasszon autó típust!');
	} else {
		kepcsere(document.foliakonfigurator.autotipus.value + '/' + document.foliakonfigurator.autoszin.value + '_' + kep + '.jpg');
	}
}
