var PriceUtils = new Object();
var std_op = 'scrollbars=yes,menubar=yes,height=600,width=800,resizable=yes,toolbar=yes,location=yes,status=yes';

PriceUtils.expandSearchRefineScrollDiv = function (prefix){
	var tagT = document.getElementById(prefix + '_T');
	var tagC = document.getElementById(prefix + '_C');
	var tagH = document.getElementById(prefix + '_H');
	var tagM = document.getElementById(prefix + '_M');

	if (tagC && (tagC.style.height == '' ||	tagC.style.height == undefined))
		tagC.style.height = (tagC.offsetHeight-4) + 'px';

	if (tagT) tagT.className = 'advSRScrollTitle_HL';
	if (tagC) tagC.className = 'advSRScrollContainer_HL';
	if (tagH) tagH.className = 'advSRScrollHidden_HL';
	if (tagM) tagM.className = 'advSRScrollMore_HL';
};
PriceUtils.collapseSearchRefineScrollDiv = function (prefix){
	var tagT = document.getElementById(prefix + '_T');
	var tagC = document.getElementById(prefix + '_C');
	var tagH = document.getElementById(prefix + '_H');
	var tagM = document.getElementById(prefix + '_M');
	if (tagT) tagT.className = 'advSRScrollTitle';
	if (tagC) tagC.className = 'advSRScrollContainer';
	if (tagH) tagH.className = 'advSRScrollHidden';
	if (tagM) tagM.className = 'advSRScrollMore';
};
function modal (url) {
  window.showModalDialog("/dialog.php?"+url, "", "dialogTop:200px; dialogLeft:200px; dialogWidth:500px; dialogHeight:401px; center:yes"); 
}
function sort_preturi (prod_id, asc) {
  location.href = '/index.php?action=product_prices&prod_id='+prod_id+'&asc='+asc;
}
function product (store_id, prod_id, pret_id) {
  var adi = window.open('dialog_product.php?prod_id='+prod_id+'&store_id='+store_id+'&pret_id='+pret_id,'','scrollbars=yes,menubar=no,height=600,width=500,resizable=yes,toolbar=no,location=no,status=no');
}
function referal (store_id, prod_id, pret_id) {
  var store = window.open('dialog_referal.php?store_id='+store_id+'&prod_id='+prod_id+'&pret_id='+pret_id,'','scrollbars=yes,menubar=yes,height=600,width=630,resizable=yes,toolbar=no,location=yes,status=no');
}
function referal_orange () {
  var store = window.open('/preturi/orange_referal.php','','scrollbars=yes,menubar=yes,height=900,width=930,resizable=yes,toolbar=yes,location=yes,status=yes');
}
function referal_ext_campaign (type, zone_id) {
  store = window.open('/preturi/referal_ext_campaign.php?type='+type+'&zone_id='+zone_id,
             '','scrollbars=yes,menubar=yes,height=900,width=930,resizable=yes,toolbar=yes,location=yes,status=yes');
}
function prod_referal (store_id, prod_id, pret_id) {
  window.open('/preturi/referal_product.php?store_id='+store_id+'&prod_id='+prod_id+'&pret_id='+pret_id,'',std_op);
}
function click (type, owner_id, obj_id, zone_id) {
  window.open('/preturi/click.php?type='+type+'&owner_id='+owner_id+'&obj_id'+obj_id+'&zone_id='+zone_id,'',std_op);
}
function store_prod_referal (prod_id) {
  window.open('/preturi/click_on_store_prod.php?prod_id='+prod_id,'',std_op);
}
function store_url_referal (store_id,url,id) {
  window.open('/preturi/click_on_store_url.php?store_id='+store_id+'&url='+url+'&id='+id,'',std_op);
}
function special_offer (store_id, prod_id, pret_id, zone_id) {
  window.open('/preturi/click_on_special_offer.php?store_id='+store_id+'&prod_id='+prod_id+'&pret_id='+pret_id+'&zone_id='+zone_id,'',std_op);
}
function campaign_referal (campaign_id) {
  window.open('/preturi/campaign_click.php?campaign_id='+campaign_id,'',std_op);
}
function store (store_id, prod_id, pret_id) {
  window.open('dialog_store.php?store_id='+store_id+'&prod_id='+prod_id+'&pret_id='+pret_id,'',std_op);
}
function recommend (model, prod_id) {
  subject = model + " de la price.ro";
  s1 = "Salut! %0A %0AIti recomand urmatorul produs de la price.ro: %0A %0A";
  s2 = model+"%0A"+"http://www.price.ro/preturi_"+prod_id+".htm %0A %0A";
  signature = "--------------------------------------%0Aprice.ro - your shopping expert%0Ahttp://www.price.ro%0Aemail:info@price.ro";
  document.location = "mailto:?subject="+subject+"&body="+s1+s2+signature;
}
function feedback ( prod_id) {
  window.open('dialog_feedback.php?prod_id='+prod_id,'','scrollbars=yes,menubar=no,height=500,width=520,resizable=yes,toolbar=no,location=no,status=no');
}
function dialog (params) {
  var store = window.open('dialog.php?'+params,'','scrollbars=yes,menubar=no,height=500,width=600,resizable=yes,toolbar=no,location=no,status=no');
}
function overcolor(i){
  document.getElementById("tr1_"+i).style.background="#d4e7a7";
  return;
}
function outcolor(i,cul){
  document.getElementById("tr1_"+i).style.background=cul;
  return;
}
function myovercolor(i,cul){
  document.getElementById(i).style.background=cul;
  return;
}
function myoutcolor(i,cul){
  document.getElementById(i).style.background=cul;
  return;
}
function do_hide(i){
 document.getElementById("tr1_"+i).style.display = 'none';
 return;
}
