function faqDisplay_Load(res)
{var answer=res.value.A;var sendto="dis_faq_"+res.value.ID;document.getElementById(sendto).innerHTML=answer;}
function faqDisplay(page)
{var sendto="dis_faq_"+page;if(document.getElementById(sendto).style.display=="none")
{document.getElementById(sendto).style.display="block";}
else
{document.getElementById(sendto).style.display="none";}}
function closeFaq(page)
{join.CloseFaq(page,faqDisplay_Load)}
function showGoseeAdd()
{document.getElementById("dis_add_GOSEE").style.display='block';}
function showGoseeAdd_load(res)
{document.getElementById("dis_add_GOSEE").style.display='block';}
function hideGoseeAdd(ID)
{document.getElementById("dis_add_GOSEE").style.display='none';}
function editNotes(goseeID)
{var editbox="note_edit_"+goseeID;var previewbox="note_show_"+goseeID;document.getElementById(editbox).style.display='block';document.getElementById(previewbox).style.display='none';}
function updateNotes(goseeID)
{var editbox="note_edit_form_"+goseeID;_default.addGoseeNotes(goseeID,document.getElementById(editbox).value,updateNotes_Load);}
function updateNotes_Load(res)
{var previewbox="note_show_"+res.value;var editbox="note_edit_"+res.value;var editinput="note_edit_form_"+res.value;document.getElementById(previewbox).style.display='block';document.getElementById(previewbox).innerHTML=document.getElementById(editinput).value;document.getElementById(editbox).style.display='none';}
function addGosee(listingID,accountID)
{var notes=Form1.ListingMenu1_GoseesAdd1_tAddNotes.value;ProfileListing.addGosee(listingID,notes,accountID,addGosee_Load);}
function addGosee_Load(res)
{document.getElementById("ListingMenu1_GoseesAdd1_response").innerHTML=res.value;}

function callback_populateTypes(res)
{var html="<option value='0'>Select a Type.....</option>";
var i;
for(i=document.getElementById("Searchform2_slAccTypes").options.length-1;i>=0;i--)
{
    document.getElementById("Searchform2_slAccTypes").remove(i);
}
addOption(document.getElementById("Searchform2_slAccTypes"),"Select a Type...","0");
for(var i=0;i<res.value.Rows.length;i++)
{var name=res.value.Rows[i].name+' ('+res.value.Rows[i].counter+')';if(res.value.Rows[i].counter!="0")
{addOption(document.getElementById("Searchform2_slAccTypes"),name,res.value.Rows[i].ID);}}}

function populatetypes()
{document.getElementById("Searchform2_slAccTypes").disabled=false;SearchForm.PopulateAccommodationTypes(document.getElementById("Searchform2_slRegions").value,document.getElementById("Searchform2_dCountry").value,document.getElementById("Searchform2_currentType").value,callback_populateTypes);}

function addOption(selectbox,text,value)
{var optn=document.createElement("OPTION");optn.text=text;optn.value=value;selectbox.options.add(optn);}

function callback_populateregions(res)
{var html="<option value='0'>Select a Region.....</option>";dropstatus("Searchform2_dCountry","black");dropstatus("Searchform2_slRegions","black");dropstatus("Searchform2_slAccTypes","black");var i;for(i=document.getElementById("Searchform2_slRegions").options.length-1;i>=0;i--)
{document.getElementById("Searchform2_slRegions").remove(i);}
addOption(document.getElementById("Searchform2_slRegions"), "Select a Region...", "0");
for (var i = 0; i < res.value.Rows.length; i++)
    
    addOption(document.getElementById("Searchform2_slRegions"), res.value.Rows[i].Name, res.value.Rows[i].ID);
    document.getElementById("Searchform2_slRegions").disabled = false;

}


function dropstatus(formx,color)
{document.getElementById(formx).style.color=color;}

function populateregions()
{dropstatus("Searchform2_dCountry","silver");dropstatus("Searchform2_slRegions","silver");dropstatus("Searchform2_slAccTypes","silver");SearchForm.PopulateRegions(document.getElementById("Searchform2_dCountry").value,document.getElementById("Searchform2_currentType").value,callback_populateregions);populatetypes();}


function exhibit(image, caption, imgno, total, id) { document.getElementById("exhibiImage").innerHTML = "<img src='" + image + "' width='420'>"; document.getElementById("exhibitcaption").innerHTML = caption; document.getElementById("spanNumber").innerHTML = "Picture " + imgno + " of " + total; }

function openURL(sURL) {
    opener.document.location = sURL;
} 

function openCustomWindow(URL, WinWidth, WinHeight, PositionType, XPosition, YPosition) {

    /* REQUIRED PARAMETERS
    !!! ALL PARAMETERS HAVE TO BE SPECIFIED IN THIS ORDER !!!
    URL - name of the template that is to be processed
    WinWidth - width of thew custom window
    WinHeight - height of thew custom window
    PositionType: 	
    * 'center' - center the window on the screen
    * 'xyPosition' - specify the X and Y coordinates
    * 'fullscreen' - open window in fullscreen (IE4+ only)
    * 'boo' - ;)
    XPosition - X coordinate of the top left corner
    YPosition - Y coordinate of the top left corner
    */
    var DefaultParams = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,";
    if (URL == '') {
        alert("You have not specified the 'Template' variable!");
    } else {
        //open centered window
        if (PositionType == 'center') {
            var XPosition = (screen.width - WinWidth) / 2;
            var YPosition = (screen.height - WinHeight) / 2;
            CustWin = window.open(URL, "CustWin", DefaultParams + "width=" + WinWidth + ",height=" + WinHeight + ",Top=" + YPosition + ",Left=" + XPosition);
            CustWin.focus();
            //open window at a specified X and Y coordinates
        } else if (PositionType == 'xyPosition') {
            CustWin = window.open(URL, "CustWin", DefaultParams + "width=" + WinWidth + ",height=" + WinHeight + ",Top=" + YPosition + ",Left=" + XPosition);
            CustWin.focus();
            //open window in fullscreen
        } else if (PositionType == 'fullscreen') {
            CustWin = window.open(URL, "CustWin", "fullscreen=yes, scrollbars=auto");
            CustWin.focus();
            //shake window
        } else if (PositionType == 'boo') {
            var n = 1;
            if (window.top) {
                for (i = 10; i > 0; i--) {
                    for (j = n; j > 0; j--) {
                        window.top.moveBy(0, i);
                        window.top.moveBy(i, 0);
                        window.top.moveBy(0, -i);
                        window.top.moveBy(-i, 0);
                    }
                }
            }
        } else {
            alert("You have specified an invalid value for the 'PositionType' variable!");
        }
    }
}

