/**
  * prida 
  */
function ShowArticleBigPicture(jmeno, sirka, vyska, popis) {
  wokno=window.open("", "_blank", "resizeable=yes,toolbar=no,status=no,menubar=no,scrollbars=no,directories=no,location=no,resize=yes,width="+sirka+",height="+vyska);
  wokno.document.write("<html><head><title>"+popis+"</title></head><body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
  wokno.document.write("<img src=\""+jmeno+"\" width="+sirka+" height="+vyska+" border=0 alt=\""+popis+"\" onClick=\"window.close();\">");
  wokno.document.write("</body></html>");
}

/**
  * otevre okno se stavy skladu pro dany produkt
  */
function ShowStoreStates(adress) {
	var width = 400;
	var height = 370;
  	window.open(adress, "_blank", "resizeable=yes,toolbar=no,status=no,menubar=no,scrollbars=no,directories=no,location=no,resize=yes,width="+ width +",height="+ height);
}

/**
  * otevre okno se stavy skladu pro dany produkt
  */
function ShowAuctionHistory(adress) {
	var width = 750;
	var height = 400;
  	window.open(adress, "_blank", "resizeable=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,directories=no,location=no,resize=yes,width="+ width +",height="+ height);
}

/**
  * prida 
  */
function ShowOperatorsMobilesServiceInfo(title, info) {
  wokno=window.open("", "_blank", "resizeable=yes,toolbar=no,status=no,menubar=no,scrollbars=no,directories=no,location=no,resize=yes,width=250,height=200");
  wokno.document.write("<html><head><title>"+title+"</title></head><body onClick=\"window.close();\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
  wokno.document.write("<div style=\"margin:20px 10px\"><strong>"+info+"</strong></div>");
  wokno.document.write("</body></html>");
}

function ShowMpPlusPriceInfo(title, info, linkDesc) {
  wokno=window.open("", "_blank", "resizeable=yes,toolbar=no,status=no,menubar=no,scrollbars=no,directories=no,location=no,resize=yes,width=250,height=200");
  wokno.document.write("<html><head><title>"+title+"</title></head><body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
  wokno.document.write("<div style=\"margin:20px 10px\">"+info+" <a target=\"_blank\" href=\"http://www.mp-plus.cz/Faq.do\">"+ linkDesc +"</a>.</div>");
  wokno.document.write("</body></html>");
}

/**
  * prekoduje toFind text aby se v nem daly pouzivat ceske znaky a zmeni metodu na get
  */
function recodeSearchForm(form) {	
	var arr =  document.getElementsByName("toFind");
	for(i=0; i < arr.length; i++) {
		if(arr[i].form == form) {
			var toFindText = arr[i];
			break;
		}
	}
	
	arr = document.getElementsByName("escaped");
	for(i=0; i < arr.length; i++) {
		if(arr[i].form == form) { // nastavujie informace o uzite metode
			var escaped = arr[i];
			break;
		}
	}
	
	// escapuje hodnotu formulare
	escaped.value = encodeURI(toFindText.value);
	
	// prenastavuje metodu
	form.method = "get";
//	alert(toFindText[0].value);
}

/**
  * prednacte obrazky pro ztmaveni pozadi
  */
function preloadImages(count) {
//  document.backgroundImages = new Array(count);
//  for(i=0; i < count; i++) {
//    document.backgroundImages[i] = new Image();
 //   document.backgroundImages[i].src = 'images/category-menu-background'+ (i+1) +'.png';
//  }
}

/**
  * pocet milisekund mezi zmenami barvy pozadi
  */
var BLANKING_INTERVAL = 400

var wasBlanked = 0;

function doBlanking(imgCount) {
//  if(wasBlanked == 0) {
// 	for(i=0; i < imgCount; i++) {
//    	setTimeout('document.getElementById("category-submenu").style.backgroundImage="url(\'../images/category-menu-background'+ (i+1) +'.png\')"', i * BLANKING_INTERVAL);
//  	}
//  	wasBlanked = 1;
// }
}

function techParamTabMouseOver(cell) {
	var id = cell.id.replace("val-", "").replace("desc-", "");
	var element = document.getElementById("val-"+ id);
	element.style.backgroundColor = "#f0f3f4";
	element = document.getElementById("desc-"+ id);
	element.style.backgroundColor = "#f0f3f4";
}

function techParamTabMouseOut(cell) {
	var id = cell.id.replace("val-", "").replace("desc-", "");
	var element = document.getElementById("val-"+ id);
	if(element.className == "not-set-value") {
		element.style.backgroundColor = "#fbfbf9";
	} else {
		element.style.backgroundColor = "white";
	}
	element = document.getElementById("desc-"+ id);
	if(element.className == "not-set-description") {
		element.style.backgroundColor = "#fbfbf9";
	} else {
		element.style.backgroundColor = "white";
	}
}
