﻿// Author Michael Barnard
var large_image_src;
large_image_src = new Image;

var prg_width = 200;

function progress() {
    
    var node;
    node = document.getElementById("progress");
    var w = node.style.width.match(/\d+/);
    if (w == prg_width) {
        w = 0;
    }

    node.style.width = parseInt(w) + 5 + 'px';
} 

function roll_image(fi, a_layer) {
    var obj;
    var obj2;
    obj = document.getElementById("Repeater1_ctl01_Img1");
    obj2 = document.getElementById(a_layer);
    large_image_src.src = obj.src;
    obj2.style.opacity = 30;
    obj2.style.filter = 'alpha(opacity=30';
    obj.src = fi;
}

function roll_off_image(a_layer) {
    var obj;
    var obj2;
    obj = document.getElementById("Repeater1_ctl01_Img1");
    obj2 = document.getElementById(a_layer);
    obj.src = large_image_src.src;
    obj2.style.opacity = 100;
    obj2.style.filter = 'alpha(opacity=100';
}


function del_alert(){
    var x = confirm("Are you sure you want to delete this record.");
    if (x){
    return true;
    }
    else{
    alert("Delete canceled.");
    return false;
    }
}

function show_progress(){

    var x;
    var vis = "visible";
    if(!document.all && document.getElementById){
        document.getElementById("progress1").style.visibility = vis;
        
    }
    if(document.all){
        x = document.all["progress1"];
        x.style.visibility = vis;
    }
    return true;
}

function accept_alert(){
    var x = confirm("Do you want to activate this advert and email the client access details.");
    if (x){
    
    return show_progress();
    }
    else{
    alert("Update canceled.");
    return false;
    }
}

function menu_element_color(th){
    th.style.background = '#ffe479'; //#ffffff
}

function menu_element_uncolor(th){
    th.style.background = '#ffcc00'; //#efefef ffccoo light = ffe479
}
function menu_element_colorA(th){
    th.style.background = '#90ef95'; //#ffffff
}

function menu_element_uncolorA(th){
    th.style.background = '#64de6a'; //#efefef ffccoo light = ffe479
}

function show_menu(vis){
    var x;
    if(!document.all && document.getElementById){
        document.getElementById("Accmenu1_acmenu").style.visibility = vis;
    }
    
    if(document.all){
        x = document.all["Accmenu1_acmenu"];
        x.style.visibility = vis;
    }
    
}






