function confirm_delete() {
	return (window.confirm('Вы действительно хотите удалить этот товар?'));
	}


//скрипт изменения цвета
/*
var ccol=1;

function ch_col() {
	
	obj=document.getElementById('corp_cl');
	
	if (obj) {
		if (ccol) {
			obj.style.color='#FFFFFF';
			ccol=0;
			setTimeout("ch_col()", 500);
		}
		else {
			obj.style.color='#790000';
			ccol=1;
			setTimeout("ch_col()", 200);
		}
	}
	

}

*/

function show_contact_window() {
	myWin= open("", "displayWindow", 
	"width=500,height=230,status=no,toolbar=no,menubar=no");
	
	myWin.document.open();
	
	myWin.document.write("<html><head><title>Не можете дозвониться?");
	myWin.document.write('</title><link href="http://www.ufl.ua/style.css" rel="stylesheet" type="text/css" /></head>');
	myWin.document.write('<body style="color:#555555; font-family:Tahoma,Verdana,Arial,sans-serif; font-size:12px;">');
	myWin.document.write("Все заказы принимаются через вебсайт.<br />Воспользуйтесь альтернативными контактам:<br /><br />(044) 561 80 50<br />(093) 827 73 27<br /><br />");
	myWin.document.write('<!-- BEGIN ProvideSupport.com Graphics Chat Button Code --><div id="ciBvBh" style="z-index:100;position:absolute"></div><div id="scBvBh" style="display:inline"></div><div id="sdBvBh" style="display:none"></div><script type="text/javascript">var seBvBh=document.createElement("script");seBvBh.type="text/javascript";seBvBh.defer=true;seBvBh.src=(location.protocol.indexOf("https")==0?"https://secure.providesupport.com/image":"http://image.providesupport.com")+"/js/uaflowers/safe-standard.js?ps_h=BvBh\u0026ps_t="+new Date().getTime();document.getElementById("sdBvBh").appendChild(seBvBh)</script><noscript><div style="display:inline"><a href="http://www.providesupport.com?messenger=uaflowers">Live Support</a></div></noscript><!-- END ProvideSupport.com Graphics Chat Button Code --><br /><br />');
	myWin.document.write('<a href="http://web.icq.com/whitepages/message_me/1,,,00.icq?uin=135355135&action=message"><img src="http://www.ufl.ua/images_new/icq_ico.gif" alt="" height="15" width="15" /></a> 135-355-135<br /><br />');
	myWin.document.write('<a href="skype:ufl.ua?call" title="Позвонить" style="text-decoration: none"><img vspace=2 src="http://www.ufl.ua/images_new/skype_ico.gif" alt="" height="16" width="16" /></a> ufl.ua<br /><br />');
	myWin.document.write("");
	myWin.document.write("</body></html>");

	myWin.document.close();  

}

function showMess (text) {
	
	document.getElementById('mess_block').innerHTML=text;
	
	setOpacity();
}

var value = 0;
var posed = 0;
var messVisible=false;

function watchScroll() {
	if (messVisible) {
		var wdiv=document.getElementById('warning');
		
		var top=window.scrollY+(window.innerHeight/2)-30;
		top=parseInt(top);
		wdiv.style.top=top+'px';
		
		setTimeout("watchScroll()", 200);
	}
}

function setOpacity() {

	document.getElementById('message_block').style.display = "block";
	
	if (!posed) {
		var wdiv=document.getElementById("message_block");
		
		var pos_left=document.body.clientWidth/2;

		pos_left =pos_left - 250;

		pos_left=parseInt(pos_left);
		
		pos_left=pos_left+'px';
		wdiv.style.left=pos_left;

		var busyLayer = document.getElementById("shadow");

		if (window.innerHeight && window.scrollMaxY) {
			yScroll = window.innerHeight + window.scrollMaxY;
			var deff = document.documentElement;
			var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;
			yScroll -= (window.innerHeight - hff);
		} else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){
			yScroll = document.body.scrollHeight;
		} else {
			yScroll = document.body.offsetHeight;
		}

		if (busyLayer != null) {
			busyLayer.style.visibility = "visible";
			busyLayer.style.height = yScroll+'px';
		}
		alert(document.body.scrollHeight);
		var top=window.scrollY+(document.body.clientHeight/2)-30;
		top=parseInt(top);
		alert (top);
		wdiv.style.top=top+'px';

		posed=1;
		messVisible=true;
	}

	value += 1;
	var testObj = document.getElementById('shadow');

	testObj.style.width = "100%";
	//testObj.style.height = "100%";
	testObj.style.display = "block";
	testObj.style.opacity = value/10;
	testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
	myTimeout = setTimeout("setOpacity()", 50);

	if (value >= 5) {
		clearTimeout(myTimeout);
	}
	
	
	watchScroll();
}

function removeOpacity() {
	value -= 1;
	var testObj = document.getElementById('shadow');

	myTimeout2 = setTimeout("removeOpacity()", 50);
	testObj.style.opacity = value/10;
	testObj.style.filter = 'alpha(opacity=' + value*10 + ')';

	if ((value/10) <= 0) {
		testObj.style.display = "none";
		clearTimeout(myTimeout2);
	}
	document.getElementById('message_block').style.display = "none";
	
	posed=0;
	messVisible=false;
}

function get_cities(country_id, city_id, selected_city, lang) {
	
	
    JsHttpRequest.query(
        'http://www.ufl.ua/ajax.php', // backend
        {
            'country_id': document.getElementById(country_id).value,
            'func' : 'get_cities',
            'lang' : lang
        },
        // Function is called when an answer arrives. 
        function(result, errors) {
            // Write the answer.
            
            if (result) {
            	
				var cities=result["cities"];
				
				var city_field_obj=document.getElementById(city_id);
				
				for (i = city_field_obj.options.length; i >= 0; i--) {
					city_field_obj.options[i] = null; 
				}
				
				var i=0;
				
				for (key in cities) {
					if (selected_city==cities[key]['id']) city_field_obj.options[i] = new Option(cities[key]['name'], cities[key]['id'], true, true);
					else city_field_obj.options[i] = new Option(cities[key]['name'], cities[key]['id']);
					i++;
				}
            }
        },
        false  // do not disable caching
    );
}

function bottomGetAllCities(country_id, country_nick, act_city, lang, domain) {
    JsHttpRequest.query(
        'http://www.ufl.ua/ajax.php', // backend
        {
            'country_id': country_id,
            'func' : 'get_cities',
            'only_main' : '1',
            'lang' : lang
        },
        // Function is called when an answer arrives. 
        function(result, errors) {
            // Write the answer.
            
            if (result) {
            	
				var cities=result["cities"];
				
				var cities_div=document.getElementById('bottom_cities');
				var cont='';
				
				for (key in cities) {
					if (act_city==cities[key]['nick']) cont=cont+'<font color="Red">'+cities[key]['name']+'</font> | ';
					else cont=cont+'<a href="'+domain+lang+'/flowers-'+country_nick+'/'+cities[key]['nick']+'" title="'+cities[key]['name']+'">'+cities[key]['name']+'</a> | ';
				}
				
				if (lang=='ru') cont=cont+'<br /><a href="'+domain+lang+'/delivery" style="color:red;"><b>Показать все города доставки...</b></a>';
				if (lang=='ua') cont=cont+'<br /><a href="'+domain+lang+'/delivery" style="color:red;"><b>Показати усі міста доставки...</b></a>';
				if (lang=='en') cont=cont+'<br /><a href="'+domain+lang+'/delivery" style="color:red;"><b>Show all delivery cities...</b></a>';
				
				cities_div.innerHTML=cont;
            }
        },
        false  // do not disable caching
    );
}
