function open_window(link,w,h) //opens new window
{
    var win = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes";
    newWin = window.open(link,'newWin',win);
    newWin.focus();
}

function redirectOutput(myForm,w,h)
{
    var p = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes";
    var w = window.open('about:blank','newWin',p);
    myForm.target = 'newWin';
    return true;
}

function show_hideMenuDiv(sender)
{
    sender=null;
    $div = document.getElementById("menuDiv");
    if ($div.style.display=="none" || $div.style.display=="") $div.style.display="block";
    else $div.style.display="none";
}

function showMenuDiv()
{
    $div = document.getElementById("menuDiv");
    $div.style.display="block";
}

function hideMenuDiv()
{
    document.getElementById("menuDiv").style.display="none";
}

function toPost(url, param, value)
{
    var newF = document.createElement("form");
    newF.action = url;
    newF.method = 'POST';
    var newH = document.createElement("input");
    newH.name = param;
    newH.type = 'hidden';
    newH.value = value;
    newF.appendChild(newH);

    document.getElementsByTagName('body')[0].appendChild(newF);
    newF.submit();
}

function overModColor(obj)
{
    obj.style.backgroundColor="#1078ab";
}

function outModColor(obj)
{
    obj.style.backgroundColor="";
}

function clickModColor(srcPic, ind, price, B_N_P)
{
    if (srcPic)
    {
        var el = document.getElementById("productPicture");
        el.src = srcPic;
    }
    if (ind)
    {
        /*el = document.getElementById("modColorSelector");
        el.selectedIndex=ind;*/
    }
    if (price)
    {
        el = document.getElementById("modPrice");
		el.value=price;
        el.textContent=price;
    }
    if (B_N_P)
    {
        el = document.getElementById("baseID_Name_Price");
		el.value=B_N_P;
        el.textContent=B_N_P;
    }
}

function cat_producers_submitform(element, form_name, input_name)
{
    form = document.getElementById(form_name);
    producer = document.getElementById(input_name);
	if (element.innerHTML=="Βρε") producer.value = ""; else producer.value = element.innerHTML;
    form.submit();
}
