// Copyright (C) 2005-2008 Ilya S. Lyubinskiy. All rights reserved.
// Technical support: http://www.php-development.ru/
//
// YOU MAY NOT
// (1) Remove or modify this copyright notice.
// (2) Re-distribute this code or any part of it.
//     Instead, you may link to the homepage of this code:
//     http://www.php-development.ru/javascripts/dropdown.php
//
// YOU MAY
// (1) Use this code on your website.
// (2) Use this code as part of another product.
//
// NO WARRANTY
// This code is provided "as is" without warranty of any kind.
// You expressly acknowledge and agree that use of this code is at your own risk.


// ***** Popup Control *********************************************************

// ***** at_show_aux *****

      function getHTTPObject(){

      if (window.ActiveXObject) 

      return new ActiveXObject("Microsoft.XMLHTTP");

      else if (window.XMLHttpRequest) 

      return new XMLHttpRequest();

      else {

      alert("Your browser does not support AJAX.");

      return null;

      }
      }
      

      // Implement business logic

   	  
      // Implement business logic

      function doWorkV(val,val2){
		//alert("ID: "+val+"  Name: "+val2);
		val3 = document.getElementById('zlight').href = 'images/'+ val2;
		document.getElementById('zlight').href = 'images/'+ val2;
		document.getElementById('content').style.visibility='hidden';
		document.getElementById('content').style.display='none';
		//document.getElementById('stamp_container').style.display='none';
		//document.getElementById('stamp_container').style.visibility='hidden';
		document.getElementById('loaderi').style.display='block';
		document.getElementById('loaderi').style.visibility='visible';
	   httpObject = getHTTPObject();

      if (httpObject != null) {

      httpObject.open("GET", "pic.php?products_id="+val+"&vid="+val2, true);

      httpObject.send(null);

      httpObject.onreadystatechange = setOutputV;

     }
      }
	  
      // Change the value of the outputText field
      function setOutputV(){

      if(httpObject.readyState == 4){
		
		//document.getElementById('stamp_container').style.display='block';
		//document.getElementById('stamp_container').style.visibility='visible';
		
		document.getElementById('content').style.visibility='visible';
		document.getElementById('content').style.display='block';
		document.getElementById('loaderi').style.display='none';
		document.getElementById('loaderi').style.visibility='hidden';
		//return false;
		document.getElementById('content').innerHTML = httpObject.responseText;
		$(function() {
      		$('a#zhrf').lightBox();
			$('a#zhrf_plus').lightBox();
    	});
      }
      }
