function ChangeField(field,event)
{
              
}

function ChangeToPale(pic,img1,img2)
{

        if(pic.src!=img2.src)
            pic.src=img2.src;
        else
            pic.src=img1.src;
}



function PrintOffer(id)
{
    var window_width = 800;
	var window_height = 600;
	var window_top = 20;
	var window_left = 20;


	var zrodlo="print.php?id="+id;
    window.open(zrodlo,'print','titlebar=no,scrollbars=yes,resizable=no,status=no,width='+window_width+',height='+window_height+',top='+window_top+',left='+window_left);
		

}

function SearchAdvanced()
{

	var page=document.getElementById("page");
	page.value="_offers_adv_";

	forma=document.forma;
    forma.method="get";
	forma.submit();
}

function SearchSimple()
{

	var page=document.getElementById("page");
	page.value="_offers_";

	forma=document.forma;
	forma=document.forma;
	forma.submit();
}



function form_update(sms_text,sms_chars,max,text)
{
        var charleft=max;
		str = sms_text.value;
		strlength = str.length;

		if (strlength > max )
        {
			//alert(text);
			sms_text.value = str.substring(0,max);
            return(false);
        }
		else
        {
			charleft = max - strlength;
        }

		sms_chars.value = charleft;
        return(true);
}


function ShowPicturePopup(id_picture,x,y)
{

	var window_width = x;
	var window_height = y;
	var window_top = 50;
	var window_left = 50;


	
	var zrodlo="picture.php?id_picture="+id_picture;
	//try
	{
		//var wynik=showModalDialog(zrodlo,null,"dialogWidth:"+window_width+"px;dialogHeight:"+window_height+"px;dialogTop:"+window_top+";dialogLeft:"+window_left+";edge: Raised; center: Yes; help: No; resizable: Yes; status: No;");
	}
	//catch(e)
	{
		var img=window.open(zrodlo,'','titlebar=no,scrollbars=auto,resizable=yes,status=no,width='+window_width+',height='+window_height+',top='+window_top+',left='+window_left);
		img.focus
	}


}

function Menu(text)
{
	menu(text);
}

function menu(text)
{
	switch(text)
	{
		default:
		top.window.location="index.php?page="+text;
		break;
	}
}



