function modelUpdater()
{
	var id = $F('brands');
	new Ajax.Updater('models', '/admin/brand/models.aspx?id=' + id, {asynchronous:true, method:'post', evalScripts:true})
}

function sizeTypeUpdater(id)
{
	var sizeType = $F('sizeType');
	new Ajax.Updater('sizes', '/admin/article/displaySize.aspx?article.Id=' + id + '&sizeType=' + sizeType, {asynchronous:true, method:'post', evalScripts:true})
}

function specUpdater()
{
    var id = $F('cbxArticle');
	new Ajax.Updater('specsTd', '/admin/special/Specs.aspx?article.Id=' + id, {asynchronous:true, method:'post', evalScripts:true})
}

function weekUpdater()
{
	var weeknr = $F('weekNr');
	new Ajax.Updater('overzicht', '/admin/customer/birthdays.aspx?weekNr=' + weeknr, {asynchronous:true, method:'post', evalScripts:true})
}

function changeSupplier()
{
	var id = $F('supplier');
	new Ajax.Updater('overzicht', '/admin/supplier/list.aspx?supplier.Id=' + id, {asynchronous:true, method:'post', evalScripts:true});
}

function LoadShops()
{  
    var article_id = $F('article.Id');
    new Ajax.Updater('shops', '/admin/special/getshops.aspx?id=' + article_id, {asynchronous:true, method:'post', evalScripts:true});
}

function articlesUpdater()
{
	var shop_id= $F('actionCode.Shop.Id');
	new Ajax.Updater('articles', '/admin/freearticle/loadshop.aspx?id=' + shop_id, {asynchronous:true, method:'get', evalScripts:true});
}

function articlesActionCodeUpdater()
{
    var shop_id= $F('actionCode.Shop.Id');
    var action = $F('action');
    var actionCode = $F('actionCode.Id');
    
	new Ajax.Updater('actionpanel', '/admin/actioncode/list.aspx?shopId=' + shop_id + '&action=' + action + '&actionCodeId=' + actionCode, {asynchronous:true, method:'get', evalScripts:true});
}

function freeArticleUpdater(freeArticleId)
{
	new Ajax.Updater('details', '/freearticle/Detail.aspx?id=' + freeArticleId, {asynchronous:true, method:'get', evalScripts:true});
}

function addOrderlineModelsUpdater()
{
	var shop_id= $F('order_Shop_Id');
	var brand_id= $F('brand_Id');	
	new Ajax.Updater('models', '/admin/order/LoadModels.aspx?shopId=' + shop_id + '&brandId=' + brand_id, {asynchronous:true, method:'get', evalScripts:true});
}

function addSpecialModelsUpdater()
{
	var brand_id= $F('brand_Id');	
	new Ajax.Updater('models', '/admin/special/LoadModels.aspx?brandId=' + brand_id, {asynchronous:true, method:'get', evalScripts:true});
}

function inputOrderNumber(orderId)
{
    var value = prompt("Factuurnummer:", "");
	new Ajax.Updater('null', '/admin/order/UpdateFaktuurNummer.aspx?orderId=' + orderId + '&value=' + value, {asynchronous:true, method:'get', evalScripts:true});
}

function flagClicked( elementId )
{
    var rows = getElementsByClassName("descriptionEditor", document.getElementsByTagName("body")[0]);
    for(var i = 0;i < rows.length ;i++)
    {
        rows[i].style.display = 'none';
    }
    document.getElementById(elementId).style.display = '';
 
}
function getElementsByClassName(classname, node)  {
    if(!node) node = document.getElementsByTagName("body")[0];
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    
    for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
       
    return a;
}

