/**
 *
 * @copyright 2004 OpenDesign
 * @link http://www.opendesign.pl/
 * @author Marcin Pietrzak <marcin.pietrzak@opendesign.pl>
 * @version $Revision: 1.6 $
 * @file $RCSfile: default.js,v $
 * @date $Date: 2004/06/05 15:37:01 $
 *
 */

function init() {
	var kw = document.getElementById('kw');

	if (kw) {
		kw.className = 'hkw';
	}
}	 
 
function imgswitch(img, src) {
	img.src = src;
}
 
function chFoCh(i) {
	with (document.cform1) {
		obj = eval("c" + i );
		obj.checked = !obj.checked;
	}
}

function showBig(img) {
	if (top.showBigObj) top.showBigObj.close();
	
	imgObj = document.createElement('img');
	imgObj.setAttribute('src', img);
	
	if (imgObj.height && imgObj.width && imgObj.height < 600 && imgObj.width < 600) {
		top.showBigObj = window.open(img,'view','width=' + (imgObj.width + 40) +',height=' + (imgObj.height + 40) + ',scrollbars=1');
	} else {
		top.showBigObj = window.open(img,'view','width=640,height=640,scrollbars=1');
	}
}

function testSearch(field) {
	with (field) {
		if (value == 'znajdź produkt') value = '';
	}
}

function reverseAllCheckboxByFormName(frm) {
	frm = eval('document.' + frm);
	if (frm) {
		for (i=0; i<frm.length; i++) {
			if (frm[i].type == 'checkbox') frm[i].checked = !frm[i].checked;
		}
	}
}

var popup_width  = 400;
var popup_height = 440;

function openEmailThisWindow(id) {
	window.open(('?dir=polec_produkt&style=sendthis&id=' + id), 'emailthis', 'width=' + popup_width + ',height=' + popup_height + ',resizable=0,dependent=1,menubar=0');
}

