function focusInput(input)
{
	input.style.border='1px solid #dadada';	
	input.style.height='15px';
  input.style.color='#777777';	
	input.style.size='10px';	
}

function blurInput(input)
{
	input.style.border='1px solid #dadada';	
}

function submitForm(id)
{
	form = document.getElementById(id);
	form.submit();
}

function resetForm(id)
{
	form = document.getElementById(id);
	form.reset();
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=350,left = 465,top = 337');");
}

function popupImage(urlPopup, width, height)
{	
  var y=(screen.height/2)-(height/2);
  var x=(screen.width/2)-(width/2);
	var myWindow;
	myWindow = window.open(urlPopup,'','width='+width+',height='+height+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top='+y+',left='+x);		
	myWindow.focus();
	void(0);
}

http_request = false;

function addToOffer(urlAddToOffer)
{
	if (urlAddToOffer && urlAddToOffer.length)
	{ 
		if (!http_request.readyState || (http_request.readyState == 4 || http_request.readyState==0))
		{ 
			if (window.XMLHttpRequest) 
			{ 
				http_request = new XMLHttpRequest();
			} 
			else if (window.ActiveXObject) 
			{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			http_request.onreadystatechange = fillContentForSeesionOfferCount;
			http_request.open('GET', urlAddToOffer, true);
			http_request.send(null);
		}
	}
}


function fillContentForSeesionOfferCount()
{
   if (http_request.readyState == 4) 
   {
		 if (http_request.status == 200) 
		 {
			offerCount = 0;
			if (http_request.responseText && http_request.responseText.length)
			{ 
				offerCount = parseInt(http_request.responseText);
			}
			if (offerCount<0)
				offerCount = 0;
			span = document.getElementById('noProductInOffer');
			span.innerHTML = offerCount;
			p= document.getElementById('cere');
			p.innerHTML ='<img src="' + urlImg + '">';
			
		 } 
		 else 
		 {    
			alert('There was a problem with the request.');
		 }
   }
}

function setValue(idProduct)
{
 inputHidden = document.getElementById('deleteOffer');
 inputHidden.value = idProduct;
 form = document.getElementById('formOfferSubmit');
 form.submit();
 return true;
}

function resetValue(idProduct)
{
 inputField = document.getElementById(idProduct);
 inputField.value = ' ';

}
