function tpk_LanguageChange(newlang) {
document.language_form.lang.value=newlang; document.language_form.submit();
}

function tpk_imgOpen(img_tit,img_src){
  rand_id='image'+(Math.round(Math.random()*1000));
  outf="<html>"
   +"<head>"
   +"<title>"+img_tit+"</title>"
   +"<style>body{margin:0px}</style>"
   +"</head>"
   +"<body leftmargin=0 topmargin=0>"
   +"<img src=\""+img_src+"\">";

  iopen="iwin=self.open('"+img_src+"', '"+rand_id+"', 'width='+(img1.width)+',height='+(img1.height)+',top=0,left=0');"
   +"iwin.document.write('"+outf+"');"
   +"iwin.focus();";

  img1=new Image();
  img1.src=img_src;

if(img1.width!=0) eval(iopen);

else{
iwin = self.open('about:blank', 'f'+rand_id, 'width=100,height=100,top=0,left=0');
iwin.document.write("<html>"
+"<body>Загрузка...<br>"
 +"<"+"script>"
  +"function imo(img1){"+iopen
  +"self.close();"
 +"}<"+"/script>"
 +"<img src='"+img_src+"' onload='imo(this);'>");
 }
}

function tpk_SureDelete(lang,id) {
	var act="Confirm removing";
	if(lang=="rus") act="Подтвердите удаление";
	if(confirm(act)) location.replace('news_delete.php?newsID='+id)
}

function tpk_SureDeleteOblect(lang,id) {
	var act="Confirm removing";
	if(lang=="rus") act="Подтвердите удаление";
	if(confirm(act)) location.replace('objects_delete.php?objectID='+id)
}

function tpk_SureDeleteSection(lang,id) {
	var act="Attention! All goods of this section will be removed. Enter word 'delete' to confirm removing";
	if(lang=="rus") act="Внимание! Все товары данного раздела будут удалены. Для подтверждения удаления введите слово 'delete'. ";
	if(prompt(act,"")=="delete") location.replace('section_delete.php?sectionID='+id)
}

function tpk_SureDeleteProduct(lang,id) {
	var act="Confirm removing";
	if(lang=="rus") act="Подтвердите удаление";
	if(confirm(act)) location.replace('product_delete.php?productID='+id)
}

function tpk_CheckPicLoad() {
	if(document.change.PicMustChange.checked) {
		document.change.picture.disabled=false;
		document.change.PicBIGMustChange.disabled=false;
	}
	else {
		document.change.picture.disabled=true;
		document.change.PicBIGMustChange.checked=false;
		tpk_CheckBigPicLoad();
		document.change.PicBIGMustChange.disabled=true;
	}
}
function tpk_CheckBigPicLoad() {
	if(document.change.PicBIGMustChange.checked) document.change.pictureBIG.disabled=false;
	else document.change.pictureBIG.disabled=true;
}
