<!--
var args = 0;
var q='';

function returnRefresh(rV) 
{	q=rV[1];

	switch (rV[0])
	{	case 1:		
		if (!q || !q.length) {document.searchForm.package_type.checked=0;}
        	document.searchForm.upak.value = q;
		document.searchForm.product_type.checked=0; 
		document.searchForm.product.value='';
		if(document.searchForm.package_type.checked) document.searchForm.submit();  
		break;		
		case 2:		
		break;
	}	
}

function seup(com,checked)
{
if(com==1) document.searchForm.package_type.checked=1;
if(com==2) document.searchForm.product_type.checked=1;

if(!checked) return false;
    width = 350;
    height = 500;
    switch (com)
	{   case 1:    
		//q = window.showModalDialog(url+com, args, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:yes;status:no");		
		showPopWin(url+com+'&z='+Math.round(Math.random()*100), 500,650,returnRefresh);
        break;
		
        case 2:
        func_newwindow('http://'+location.host+'/pmh/samples2.php?pkg=&z='+Math.round(Math.random()*100),650,0,'yes','yes');
		/*
		q = window.showModalDialog(url+com, args, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:yes;status:no");
        if (!q || !q.length) {document.searchForm.product_type.checked=0;}
        document.searchForm.product.value = q;
		document.searchForm.package_type.checked=0; 
	    document.searchForm.upak.value='';		
		if(document.searchForm.product_type.checked) document.searchForm.submit();            
		*/
        break;

        case 3:
        if(document.searchForm.product.value || document.searchForm.upak.value) document.searchForm.submit();
        break;

        default: return false;
    }
}




function returnRefreshMain(rV) 
{   var go=0;

	q=rV[1];
	
	switch (rV[0])
	{
		case 1:
		
		if (!q || !q.length) return false;
        	document.searchForm.upak.value = q;
		document.searchForm.product.value = '';
		go=1;
		
		break;

	}
	
	if(go){loadBar(1);document.searchForm.submit();}
	
	
}
			
			
			
function seupmain(com)
{	var go=0;
    switch (com) {
        case 1:
		
		if(document.searchForm.upak.value && document.searchForm.upak.value.length)
		{document.searchForm.submit();}
		else
		{	//q = window.showModalDialog(url+com+'&z='+Math.round(Math.random()*100), args, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:yes;status:no");
			showPopWin(url+com+'&z='+Math.round(Math.random()*100), 500,650,returnRefreshMain);
		}
        break;

        case 2:		
		func_newwindow('http://'+location.host+'/samples2.php?z='+Math.round(Math.random()*100),650,0,'yes','yes');

		/*
		if(document.searchForm.product.value && document.searchForm.product.value.length)
		{document.searchForm.submit();}
		else
		{	q = window.showModalDialog(url+com, args, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:yes;status:no");
            	if (!q || !q.length) return false;
            	document.searchForm.product.value = q;
			document.searchForm.upak.value = '';
			//document.searchForm.submit();
			go=1;
		}*/
        break;

        default: return false;
    }

//alert(go);
if(go){loadBar(1);document.searchForm.submit();}
}


function selectFoodCompanies()
{
	func_newwindow('http://'+location.host+'/allobor.html',650,600,'yes','yes');
}

function func_newwindow (str_url, int_h, int_w, int_scroll,resize)
{
	
	var z=Math.round(Math.random()*100);
	var int_leftpos = (screen.width / 2) - (int_h / 2);
	var int_toppos = (screen.height / 2) - (int_w / 2);
	
	if(int_w==0) {	int_w=screen.height-150;
				int_toppos=(screen.height-100)/2-int_w/2;
			}

	var w1 = window.open(str_url,'new_window'+z,'resizable='+resize+',menubar=no,status=yes,scrollbars='+int_scroll+',width='+int_h+',height='+int_w+',top='+int_toppos+',left='+int_leftpos);
	w1.focus();
}


/*function seup(com,main) {
//alert('seup'+document.searchForm.product_type.checked);
    width = 350;
    height = 500;
    //url=com;
    switch (com) {
        case 1:
	    height = 550;
            q = window.showModalDialog(url+com, args, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:yes;status:no");
            if (!q || !q.length) {document.searchForm.package_type.checked=0; return false;}
            document.searchForm.upak.value = q;
	    if(!main) 
		{	document.searchForm.product_type.checked=0; 
			document.searchForm.product.value='';
		}
            //document["ok"].src = "<?=TEMPLATE?>images/button4.gif";
        break;

        case 2:
            q = window.showModalDialog(url+com, args, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:yes;status:no");
            if (!q || !q.length) {document.searchForm.product_type.checked=0; return false;}
            document.searchForm.product.value = q;
	    if(!main)
		{	document.searchForm.package_type.checked=0; 
	    		document.searchForm.upak.value='';
		}
            //document["ok"].src = "<?=TEMPLATE?>images/button4.gif";
        break;

        case 3:
            if (document.searchForm.product.value || document.searchForm.upak.value) 
		{  document.searchForm.submit();  }
        break;

        default: return false;
    }
}
*/

//-->
