function replaceImage(imID, imSRC) {
	var d = document.all[imID];
	if (typeof(d) == 'object') {
		d.src = imSRC;
	}
}
NewWindow=null;
function ViewImage(src, title, w, h ){
	if (NewWindow) { NewWindow.close(); }
	if (typeof(w)=="undefined" || w=="") w = img.width>0 ? img.width : 600;
	if (typeof(h)=="undefined" || h=="") h = img.height>0 ? img.height : 400;
	w = w-1+21;
	h = h-1+21;
	if (NewWindow==null || NewWindow.closed) {
		if (typeof(title)=="undefined" || title=="") title="Gallery";
		settings=
		 "left="+(screen.width-w)/2+","
		 +"top="+(screen.height-h)/2+","
		 +"width="+w+","
		 +"height="+h+","
		 +"toolbar=no,"
		 +"location=no,"
		 +"directories=no,"
		 +"status=no,"
		 +"menubar=no,"
		 +"scrollbars=no,"
		 +"resizable=no"
		 NewWindow = window.open("",'Gallery',settings);
	}
	NewWindow.document.open();
	NewWindow.document.clear();
	NewWindow.document.write(
 	 "<html><head><title>"+ title +"</title>"
	+"</head>\n"
	+"<body topmargin=0 leftmargin=0 bgcolor=#FFFFFF onclick=\"window.close();\">\n"
	+"<table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=0><tr><td align=\"center\" valign=\"middle\"><img src=" + src + " border=0 alt=\""+title+"\"></td></tr></table>\n"
	+"</body>\n"
	+"</html>"
	);
	NewWindow.document.close();
	NewWindow.focus();
}

function FormTransfer(bool1,bool2) {
	if (bool1 || bool2) {
		document.all.transferDIV.style.display = "";
	}
	else document.all.transferDIV.style.display = "none";
}

function goNextField(field,value) {
	if (value.length == 4) {
		document.all[field].focus();
	}
}

NewWindow2 = null;
function ShowWin(adreska, w, h){
if(NewWindow2){NewWindow2.close();}
if(NewWindow2==null || NewWindow2.closed){
 settings=
 "left=20,"
 +"top=20,"
 +"width=" + w + ","
 +"height=" + h + ","
 +"toolbar=no,"
 +"location=no,"
 +"directories=no,"
 +"status=no,"
 +"menubar=no,"
 +"scrollbars=yes,"
 +"resizable=yes"
 NewWindow2 = window.open(adreska,'okno',settings);
}
NewWindow2.focus();
}

function blik_proc(element,color1,color2) {
	var d = document.all[element];
	if (typeof(d) == 'object') {
		if (d.style.color == color1) {
			d.style.color = color2;
		}
		else {
			d.style.color = color1;
		}
	}
}
function blik(element,color1,color2,interval) {
	window.setInterval("blik_proc('"+element+"','"+color1+"','"+color2+"')",interval);
}

/* cookies pro wishlist */

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {

	createCookie(name,"",-1);

}
function close(what) {

     var c = document.getElementById(what);
     if(c) {
      c.style.display="none";
     }
}
function clona(url){
    
     var c = document.getElementById('clona');
     var w = document.getElementById('win');  
     var top = document.documentElement.scrollTop; 
     
     if(c) {
      c.style.display="";
      c.style.top="0px";
      c.style.height=document.body.clientHeight+'px';
      c.style.width=document.body.clientWidth+'px';

      w.style.display="";
      w.style.top=top+200+"px";
      imgsize = w.clientWidth;
       
       output = '<a class="close_clona" href="javascript:close(\'clona\'); close(\'win\')" >CLOSE</a><br />'+
                '<a href="javascript:close(\'clona\'); close(\'win\')"><img src='+url+' alt="" /></a>';
      
      w.innerHTML = output;


      /*PRO INTERNET EXPLOZER*/
      v = document.body.clientWidth-imgsize;
      w.style.left=v/2+"px";
      
  }
}
      
