﻿// JScript File

var popUp;

//-----------------------------------------------------------------------------
// Create the PopUp Email
function openemailwindow(postBack)
{
	//fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width=800,height=620,left=200,top=250
	popUp = window.open('EmailMessage.aspx?formname=' + document.forms[0].name + 
		'&postBack=' + postBack,
		'', 
		'resizable=yes,width=585,height=650,left=100,top=0,status=yes');
}

function closeemailwindow(postBack)
{
	popUp.close();
	if (postBack)
		__doPostBack();
}

function openmembersignupwindow(postBack)
{
	//fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width=800,height=620,left=200,top=250
	popUp = window.open('MembershipSignup.aspx?postBack=' + postBack,
		'', 
		'resizable=yes,width=585,height=440,left=100,top=50,status=yes');
}

function closemembersignupwindow(postBack)
{
	popUp.close();
	if (postBack)
		__doPostBack();
}

function CloseWindow()
{
	self.close();
}

function OpenFreeTextBox(frm, idname, postBack) 
{
    popUp = window.open('../Modules/PopupFTB.aspx?formname=' + frm.name + 
    '&id=' + idname + '&selected=' + escape(frm.elements[idname].value) + '&postBack=' + postBack, 
    'popupcal', 'width=600,height=575,left=150,top=40');
    
}

function SetFreeTextBox(formName, id, newHtml, postBack) // Function for freetextbox 'Pages/FTB/PopupFTB.aspx'
{
    eval('var theform = document.' + formName + ';');
    popUp.close();
    theform.elements[id].value = unescape(newHtml);
    if (postBack)
        __doPostBack(id,'');
}

function SetHiddenTextBox(ftb) {
    var html = ftb.GetHtml();
    var o = document.getElementById('textwritten');
    o.value = ftb.GetHtml();
}

function CharCount(ftb) {
    var html = ftb.GetHtml();
    var o = document.getElementById('txtHiddenFTB');
    o.value = html.length;
    window.status = html.length;
}
