var DivId;
function LoadContent(locatioPHP, DivId) { var cont = document.getElementById(DivId);var loading = document.getElementById('PreLoading');cont.innerHTML = loading.innerHTML;
var req = window.XMLHttpRequest? 
new XMLHttpRequest() : 
new ActiveXObject("Microsoft.XMLHTTP"); 
req.onreadystatechange = function() { 
if (req.readyState == 4) 
	if (req.status == 200){ 		cont.innerHTML = ""+ req.responseText; 	};}  
req.open("GET", locatioPHP, true); 
req.send(null); 
}
// ------------------------------------------------------------- &reg;
var delay=20;  // function moveit(was, startx, starty, endx, endy, steps, wait) {
function moveit(IdContent, startx, starty, endx, endy, steps, wait) { // IdContent
                             if(wait && wait>0)
                                 setTimeout('moveit("'+IdContent+'",'+startx+','+starty+','+endx+','+endy+','+steps+','+(wait-1)+')', delay);
                             else {
                                 if(document.layers) {
                                     document.layers[IdContent].left=startx;
                                     document.layers[IdContent].top=starty;
                                 } else {
                                     document.all[IdContent].style.left=startx;
                                     document.all[IdContent].style.top=starty;
                                 }
                                 startx+=(endx-startx)/steps;
                                 starty+=(endy-starty)/steps;

								 zoomIn(IdContent);
								 if(steps < 1) { document.getElementById(IdContent).style.zoom = 100+'%'; };
								 //if(steps < 1) { document.getElementById(idimgDoor).style.Width = 200 +'px'; };
								 if(steps>0)
                                     setTimeout('moveit("'+IdContent+'",'+startx+','+starty+','+endx+','+endy+','+(steps-1)+')', delay);
                             }
} // End function moveit
function initMuvi(IdContent, GorNach, VertNach, GorEnd, VertEnd) {
                             if(navigator.appName=="Netscape") {
                                 var w=innerWidth;
                                 var h=innerHeight;
                             } else {
                                 var w=document.body.offsetWidth;
                                 var h=document.body.offsetHeight;
                             }
                             var mw=w/2;
                             var mh=h/2;
                          moveit(IdContent, GorNach, VertNach, GorEnd, VertEnd, 5, 0); 
						  //   moveit(IdContent, 500, 300, 30, 70, 20, 10);    
} //  GorNach VertNach / GorEnd VertEnd  / Spid TimeNach
function zoomIn(IdContent) {  
  newZoom= parseInt(document.getElementById(IdContent).style.zoom) +15; // сколько приб за шаг
	  document.getElementById(IdContent).style.zoom =newZoom +'%';
} 
function FilterIdReload () {   
VievDivColections(JIDCatKolectionIconA , 'DivShovCatKolectionsIconA');
	for (var idSel=0; idSel < ArrayVibranihPoziciy.length; idSel++) {   // arrayLength 
		if (ArrayVibranihPoziciy[idSel] == 'EstSelect_' + idSel) {
			LoadContentParametri(ArrayVibranihmId[idSel], ArrayVibranihIdContent[idSel], ArrayVibranihPozTop[idSel], ArrayVibranihPozLift[idSel] );
		};
	};
}
function LoadDivPozitionOver(idSel){ // изминение текста выбраных позиций овер оут 
//	for (var idSel=0; idSel < ArrayVibranihPoziciy.length; idSel++) {   // arrayLength 
//		if (ArrayVibranihPoziciy[idSel] == 'EstSelect_' + idSel) {
	document.getElementById('IdContentText_'+ idSel).className = 'FontPozitionTextOver'; 
//		};
//	};
}
function LoadDivPozitionTextPreOver(){ // изминение текста выбраных позиций овер оут 
	for (var idSel=0; idSel < ArrayVibranihPoziciy.length; idSel++) {   // arrayLength 
		if (ArrayVibranihPoziciy[idSel] == 'EstSelect_' + idSel) {
	document.getElementById('IdContentText_'+ idSel).className = 'FontPozitionTextPreOver'; 
		};
	};
}
function LoadDivPozitionTextOut(){ // изминение текста выбраных позиций овер оут 
	for (var idSel=0; idSel < ArrayVibranihPoziciy.length; idSel++) { if (ArrayVibranihPoziciy[idSel] == 'EstSelect_' + idSel) {document.getElementById('IdContentText_'+ idSel).className = 'FontPozitionText'; };};};function showObject(obj) {    obj.className = "visible"; };function hideObject(obj) {    obj.className = "hidden";  };function hideObjectHax(obj) { setTimeout(""+obj+".className = 'hidden';", 200); };
function LoadDivPozitionOnklik(idSel){ // изминение текста выбраных позиций овер оут 
	document.getElementById('IdContentText_'+ idSel).className = 'FontPozitionText'; }
///////////////////////////////
var countStrok=0;
function LoadDivPozitionText(x_text , dID, pozId){ // Надписи Выбранных позиций    //  BlockTopContentOsvobodit("+dID+"); " / &xz="+ Math.random() +"
var loadingss;  //  \"ImagesID_"+pozId+"\"   /    \"IdContent_"+dID+"\"
if (x_text) {  countStrok++;   loadingss = "<table cellpadding='0' cellspacing='0' border='0'><tr>"
	+"<td  style=' cursor:pointer;'  class='FontPozitionTextStat' " // padding:2px 8px 2px 8px; BORDER: 0px none;  //  class='FontPozitionTextStat'
	+" onmouseover=\"this.className='FontPozitionTextOver';   SelectFotoProdukta("+pozId+"); \" "
	+" onmouseout=\" this.className='FontPozitionTextPreOver'; SelectFotoProduktaOut(); \" "
	+" onclick=\"open_window('./?podrobnotov=1&pid="+pozId+"&cat="+dID+"&IdFilter="+IdFilter+"&krs=1',900,650); \" "
	+"title=' "+ x_text +" '>"+ x_text + "   </td>";
	if ((dID !=1) && (dID !=2)) { 
	loadingss += "<td style=' height:16px; width:25; cursor:pointer;' "
	+" onclick=\"javascript: LoadDivPozitionOnklik('"+dID+"'); LoadContentParametri('dr=0','IdContent_"+dID+"', 0, 0); "
	+" ArrayVibranihPoziciy["+dID+"] = '';         BlockTopContentOsvobodit('"+pozId+"');   "
	+" LoadDivPozitionText('' , "+dID+"); OldVibranihPoziciy["+dID+"]=''; \">"
	+"<img src='./images/deny1.gif' border='0' title=' удалить позицию "+ x_text +" '></td>";
	};
	loadingss += "</tr></table>";
} else { loadingss =''; countStrok--; };document.getElementById('IdContentText_' +dID).innerHTML = loadingss; }
var old_topCatdId, old_topCatdId2, thisClsSelect, thisClsSelect2;
function topCatdIdBorder1(cID){  if (old_topCatdId) { 	document.getElementById(old_topCatdId).className = 'DivSilka'; };document.getElementById(cID).className = 'DivSilkaSelect'; thisClsSelect = cID;setTimeout(old_topCatdId = cID , 300);}
function topCatdIdBorder2(cID){ if (old_topCatdId2) { 	document.getElementById(old_topCatdId2).className = 'ImgIconButon';  };document.getElementById(cID).className = 'ImgIconButonSelect';  thisClsSelect2 = cID;setTimeout(old_topCatdId2 = cID , 500);}
function isArayAray(isk, inAray){var _return =0;for (var i =0; i < inAray.length; i++) {if (inAray[i]) { for (var ii =0; ii < inAray[i].length; ii++) {if (isk == inAray[i][ii]) { _return =1; };};} else {  if (isk == inAray[i]) { _return =1; };};}; return _return;}
function isAray(isk, inAray){var _return =0;for (var i =0; i < inAray.length; i++) {if (isk == inAray[i]) { _return =1; };}; return _return;}
function BlockTopContentOsvobodit(cpID) {if (ArrayBlocketPoziciy[cpID] !=null) { for (var i=0; i < (ArrayBlocketPoziciy[cpID]).length; i++) {
	if (ArrayBlocketPoziciy[cpID][i]  == 'TMC_CAT_'+i) { document.getElementById('topCatdId_'+i).className = 'DivSilka'; document.getElementById('topCatdId_'+i).title = '';	
	ArrayBlocketPoziciy[cpID][i]='';};
	if (ArrayBlocketPoziciy[cpID][i]  == 'COLOR_'+i) { document.getElementById('ColorID_'+i).className = 'DivSilka'; document.getElementById('ColorID_'+i).title = '';	
	ArrayBlocketPoziciy[cpID][i]='';};
	if (ArrayBlocketPoziciy[cpID][i]  == 'PRODUKT_'+i) {if (document.getElementById('ImgIconButon_'+i)) { document.getElementById('ImgIconButon_'+i).className = 'ImgIconButon';document.getElementById('ImgIconButon_'+i).title = '';};
	ArrayBlocketPoziciy[cpID][i]='';ArrayBlocketPoziciyTitle[cpID][i] = '';	
	if ((isArayAray('PRODUKT_'+i, ArrayBlocketPoziciy)) && (document.getElementById('ImgIconButon_'+i)) ) {  document.getElementById('ImgIconButon_'+i).className='ContBlock'; } else {};};	};
	ArrayBlocketPoziciy[cpID]=''; };}
function ShovBlocketPoziciyTitle(pid) {	var titl='';if (ArrayBlocketPoziciyTitle) {for (var i =0; i < ArrayBlocketPoziciyTitle.length; i++) {if (ArrayBlocketPoziciyTitle[i]) {for (var ii =0; ii < ArrayBlocketPoziciyTitle[i].length; ii++) {if (ii == pid) {titl += Coment(ArrayBlocketPoziciyTitle[i][pid]) +' \n';};};};};document.getElementById('ImgIconButon_'+pid).title = ''+titl+'';};}
function LoadContentParametri(mId,IdContent, PozTop, PozLift ) { // IdFilter
	LoadContent('./read1.php?' + mId +  "&IdFilter=" + IdFilter +   "&xz=<?=$xz?>" , IdContent); 
	document.getElementById(IdContent).style.top = PozTop;  
	document.getElementById(IdContent).style.left = PozLift;
	//	document.getElementById(IdContent).style.zoom = 10+'%';
	//	initMuvi(IdContent, 600, 150, PozLift, PozTop);
};
function confirmReloadLink($del_soo, $where) { ////////////////////////////////////////////////////////
		temp = window.confirm($del_soo);
		if (temp) { //удалить
			window.location=$where; return true; 
		} else {
	alert("ок ");  return false; };
};
