
//alert('pages/compare_price.js');

function buy(shop_id,productId){
				var icecat_url = "http://icecat.biz/index.cgi?statistic="+productId+";shop="+shop_id;
		    new_window = window.open();
				new_window.focus();
				new_window.document.write('<body><form method=get name=my action="'+icecat_url+'">');
				new_window.document.write('<input type=hidden name=statistic value='+productId+'>');
				new_window.document.write('<input type=hidden name=shop value='+shop_id+'>');
				new_window.document.write('</form><scri'+'pt>'+'document.my.submit();</'+'script></body>');
}

function rest_offers_m(action){

	if(action == 'show'){
		document.getElementById('current_offers').style.display='none';
		document.getElementById('all_offers').style.display='block';
	}else{
			document.getElementById('current_offers').style.display='block';
			document.getElementById('all_offers').style.display='none';
	}
}

function setLocation(what){

	var domain = '';
	var params = what.split('==');
	domain = params[0];
	what = params[1];

	var url = "http://"+domain+document.getElementById('urlPath').value;

	if (url.match(/\?/g)) {
		url += '&prefere='+what;
	} else {
		url += '?prefere='+what;
	}
	
	location.href=url;

}

function setCookie (name, value, expires, path, domain, secure) {
      document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}



