
function newWind(url){

	window.open(url,"","width=510,height=550,status=1");
	return false;
}

function maxImage(img,LangId){
	if(LangId=="34")	LangId="lt";
	if(LangId=="5")		LangId="en";
	if(LangId=="37682")		LangId="pl";
	if(LangId=="35628")		LangId="lv";

	var Close=new Array()
		Close["lt"]="Uždaryti";
		Close["en"]="Close";
		Close["pl"]="Zamknj";
		Close["lv"]="Close";
	
	var title = document.title;
	var dir = webDir+"photos/originals/";
	var html="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
	html+="<html>\n";
	html+="<head>\n";
	html+="<title>" + title + "</title>\n";
	html+="<meta http-equiv='imagetoolbar' content='no'>\n";
//	html+="<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n";
	html+="</head>\n";
	html+="<body bgcolor='#eff6fe' topmargin=15 leftmargin=15 marginheight=15 marginwidth=15>";
	html+="<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center'>";
	html+="<a onClick='window.close()'><img src='"+dir+img+"' border='0' alt='"+Close[LangId]+"'></a>";
	html+="</td></tr></table>";
	html+="</body>\n";
	html+="</html>\n";

	var Window2=open("","",",scrollbars=yes, resizable=yes, location=no, menubar=no, status=no,");
	Window2.document.open();
	Window2.document.write(html);
	Window2.document.close();
}


function DoAlert(msg){
	var title = document.title;

	var html="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
	html+="<html>\n";
	html+="<head>\n";
	html+="<title>" + title + "</title>\n";
	html+="<meta http-equiv='imagetoolbar' content='no'>\n";
//	html+="<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n";
	html+="</head>\n";
	html+="<body bgcolor='#eff6fe' topmargin=15 leftmargin=15 marginheight=15 marginwidth=15>";
	html+="<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center'>";
	html+="<a onClick='window.close()'>" + msg + "</a>";
	html+="</td></tr></table>";
	html+="</body>\n";
	html+="</html>\n";

	var Window2=open("","","height=300,width=300,left=300,top=300,scrollbars=yes, resizable=yes, location=no, menubar=no, status=no,");
	Window2.document.open();
	Window2.document.write(html);
	Window2.document.close();
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
		}
	}
} 

function startticker(){
 if (!document.getElementById('ticker')) {
			return;
		}
 if(document.getElementById('ticker')) {
   var tick = '<div style="position:relative;z-index:-1;width:'+tWidth+';height:'+tHeight+';overflow:hidden;background-color:'+tcolour+'"';
   if (moStop) tick += ' onmouseover="cps=0" onmouseout="cps=tSpeed"'; tick +='><div id="mq" style="position:absolute;left:0px;top:5px;font-family:'+fontfamily+';font-size:'+fsz+';white-space:nowrap;"></div></div>';
    document.getElementById('ticker').innerHTML = tick;
    mq = document.getElementById("mq");
    mq.style.left=(parseInt(tWidth)+10)+"px"; 
    mq.innerHTML='<span id="tx">'+content+'</span>'; 
    aw = document.getElementById("tx").offsetWidth;
    lefttime=setInterval("scrollticker()",50);
  }
} 
function scrollticker() {
  mq.style.left = (parseInt(mq.style.left)>(-10 - aw)) ?parseInt(mq.style.left)-cps+"px" : parseInt(tWidth)+10+"px";
}

function ChangeImage(item, parent) {
	//alert('photo'+item);
	//alert('photo'+parent);
	var image = document.getElementById('photo'+item);
	var image2 = document.getElementById('photo'+parent);
	if (image && image2) {
		
		document.getElementById('photo'+parent).src=image.src;
		document.getElementById('photo'+parent).height=70;
		document.getElementById('photo'+parent).width=100;
	}
}

function ResetImage(parent) {
	var image = document.getElementById('photo'+parent);
	var ParentImage = document.getElementById('photo'+parent+'p');
	if (image && ParentImage) {
		document.getElementById('photo'+parent).src=document.getElementById('photo'+parent+'p').src;
		document.getElementById('photo'+parent).height=70;
		document.getElementById('photo'+parent).width=100;
	}
}

function ShowProdBlock(drop) {
	if (drop.options[drop.selectedIndex].value == "35736")
		document.getElementById('ProdGroupDiv').style.display="block";
	else 
		document.getElementById('ProdGroupDiv').style.display="none";
}


//window.onload=set_pos_new;
window.onresize=set_pos_new;

function set_pos_new(){
  setTimeout("do_bott()",500);
}

function do_bott(){
  var minusas=547;//508;
  var minusasx=547;
  /*var minusas=490;//386;
  var minusasx=530;*/
 
    var agt = navigator.userAgent.toLowerCase();
    if(document.all){            
      if(typeof((document.body.offsetHeight)=='undefined' || (agt.indexOf("msie")==-1) && agt.indexOf("gecko")!=-1) || (agt.indexOf("msie 7.0")>0) || (agt.indexOf("opera")>0)){
        hh=document.body.scrollHeight;
        if ((agt.indexOf("msie 7.0")>0)||(agt.indexOf("msie 6.0")>0)) {
          hh = (((document.documentElement.scrollHeight)>(document.documentElement.clientHeight)) ? (document.documentElement.scrollHeight):(document.documentElement.clientHeight));
        }
      }
      else {
        hh=document.body.offsetHeight+((agt.indexOf("msie") != -1 && (agt.indexOf("opera") == -1))?(-4):0);
      }
    }
    else {
		
      if (agt.indexOf("mozilla")>=0) {//mozilai
	  
        hh = window.innerHeight + window.scrollMaxY;
      }
      else
        hh=document.body.scrollHeight;
    }
    
	if(document.images && document.images.scr_h){
		document.images.scr_h.height=1;
		document.images.scr_h.height=(((hh-minusas)>0) ? (hh-minusas):1);
	}
	
	if(document.images && document.images.scr_hx){
	    document.images.scr_hx.height=1;
	    document.images.scr_hx.height=(((hh-minusasx)>0) ? (hh-minusasx):1);
	}
}



