﻿function get_popup_html(caption, inner_html) {
    var str = "";
    str += '<div class="flright"><a href="./" onclick="hide_popup_box();return false;" class="speclink" title="close">close [x]</a></div>';
    str += inner_html;
    return str;
}

function get_alert_box(msg) {
    var str = "";
    str += '<div class="textcenter"><br /><br />' + msg + '<br /><br /><br /><a href="./" onclick="hide_popup_box();return false;"><img src="/img/btn-cancel.gif" /></a></div>';
    return get_popup_html("Warning!", str);
}

function get_incomplete_box() {
    var str = "";
    str += '<br /><br />Some form elements have not been completed.<br /><br /><a href="./?moveout">Click hire</a> if you want to move out from this page.<br /><br />Or <a href="./" onclick="hide_popup_box();return false;">click here</a> to continue filling the details.<br /><br /><br />';
    return get_popup_html("Warning!", str);
}

function get_confirm_box(msg, url_yes, url_no) {
    var str = "";
    str += '<div class="textcenter"><br /><br />' + msg + '<br /><br />'
    str += '<div class="textcenter"><a href="' + url_yes + '"><img src="/img/btnsh-yes.gif" alt="Yes" title="Yes" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + url_no + '"><img src="/img/btnsh-no.gif" alt="No" title="No" /></a></div></div>';
    return get_popup_html("Warning!", str);
}

function get_new_move_invitation_box(fname) {
    var str = "";
    str += '<br /><br />Hi - welcome back ' + fname + '!  It\'s been a few months since you last logged on, is this because you\'re moving house?  If you are, <a href="/account/movedetails/">click here</a> to start a new move.  We\'ll use your current address as your default moving from address, and we\'ve already copied across the organisations you selected last time. Please also check your personal details and update them if necessary.';
    return get_popup_html("iammoving.com", str);
}

function get_continue_box(msg, url, alt_url) {
    var str = "";
    str += '<div class="textcenter"><br /><br />' + msg + '<br /><br />'
    str += '<div class="textcenter"><a href="' + url + '"><img src="/img/btn-continue.gif" alt="Continue" title="Continue" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + alt_url + '"><img src="/img/btn-cancel.gif" alt="Cancel" title="Cancel" /></a></div></div>';
    return get_popup_html("iammoving.com", str);
}

function get_msg_box(msg) {
    var str = "";
    str += '<br />' + msg + '<br /><br />';
    return get_popup_html("iammoving.com", str);
}

function get_wait_box() {
    var str = "";
    //str += '<div class="textcenter"><br /><br /><br /><br /><b>Processing... Please Wait.</b><br /><br /><br /><br /><br /><br /><a href="./" onclick="hide_popup_box();return false;"><img src="/img/btn-cancel.gif" /></a></div>';
    str += '<strong>Processing... Please Wait.</strong><div class="space-height-20"></div><div class="space-height-20"></div><div><a href="./" onclick="hide_popup_box();return false;">[cancel]</a></div>';
    return str;
}

function get_wait_box_timer() {
    var str = "";
    //str += '<div class="textcenter"><br /><br /><br /><br /><b>Processing... Please Wait.</b><br /><br /><br /><br /><br /><br /><a href="./" onclick="hide_popup_box();return false;"><img src="/img/btn-cancel.gif" /></a></div>';
    str += '<strong>Processing... Please Wait.</strong></div>';
    return str;
}


function get_notsaved_box(url) {
    var str = "";
    str += '<br /><br />Your organisations will no be saved unless you create an account - do you want to do that now?"<br /><br /><a href=\"./\" onclick=\"if(submit_form(\'service_info_form\', \'add_other_info\')){return false;}\">Click here to do that now.</a><br /><br /><a href="' + url + '">Click here to do it later.</a><br /><br />';
    return get_popup_html("Warning!", str);
}

function get_ok_box(msg) {
    var str = "";
    str += '<div class="textcenter"><br /><br />' + msg + '<br /><br /><br /><input type="button" value="OK" class="btn-main" onclick="hide_popup_box();return false;"></div>';
    return get_popup_html("iammoving.com", str);
}
