function previewWindow(relationId)
{
	url = 'previewGiftCard.jsp?relationId='+relationId;
	width = 600;
	height = 600;
	scrollbars = 'false';
	resizable = 'false';
	var win = window.open(url,"popUp","width="+width+",height="+height+",top=100,left=50,scrollbars="+scrollbars+",resizable="+resizable);
	win.focus();
}

function previewGiftMessageViaURL(url)
{
	width = 878;
	height = 500;
	scrollbars = 'false';
	resizable = 'false';
	var win = window.open(url,"popUp","width="+width+",height="+height+",top=100,left=50,scrollbars="+scrollbars+",resizable="+resizable);
	win.focus();
}

function printAccessCode(relationId, serverName, webDirectory, cordaServer)
{
	url = 'http://'+cordaServer+'/?@_DOC_LOADhttps://'+serverName+"/"+webDirectory+'/printAccessCode.jsp?relationId='+relationId+'@_PDF';
	//url = 'http://adlapp1:2001/?@_DOC_LOADhttp://adlatg2/printAccessCode.jsp?relationId='+relationId+'@_PDF'
	width = 825;
	height = 700;
	scrollbars = 'true';
	resizable = 'true';
	var win = window.open(url,"popUp","width="+width+",height="+height+",top=0,left=0,scrollbars="+scrollbars+",resizable="+resizable);
	win.focus();
}


//Used to set the commerce id for the edit link on checkout1.jsp
function setCommerceItemId(id){
	document.cartForm.commerceItemId.value = id
}

function setSuccessUrl(value)
{
	document.cartForm.successURL.value = value;
}
/*

// var spellCheckURL="http://localhost/jspell_proxy.asp"; // change to point to the JSpell Spell Check Servlet
// var styleSheetURL="http://localhost/jspell.css";
// var imagePath="http://localhost/images"; // relative URL to JSpell button images directory
var spellCheckURL="/jspellhtml/JSpell.jsp"; // change to point to the JSpell Spell Check Servlet
var styleSheetURL="/jspellhtml/jspell.css";
var imagePath="/jspellhtml/images"; // relative URL to JSpell button images directory

var blankURL="about:blank"; // used for preview panels, if you are using SSL you'll need an
//var blankURL="/jspellhtml/blank.html"; // actual HTML file to be the 'blank' panel, in which case uncomment this line

var ww;	// holds reference to popup
var disableLearn=true; // set to true, to remove the Learn words capability
var forceUpperCase=false; // force suggestions and spell checker to use upper case
var ignoreIrregularCaps=false;	// ignore lower case sentence beginnings, etc.
var ignoreFirstCaps=false;	// ignore if first character in a field is lowercase
var ignoreNumbers=false; // ignore words with embedded numbers
var ignoreUpper=false; // ignore words in upper case
var ignoreDouble=false; // ignore repeated words
var confirmAfterLearn=false; // show warning before user 'learns' a word
var confirmAfterReplace=true; // show warning when replacing using a word not in the suggestions list.
var supplementalDictionary=""; // optional supplemental word list kept at server.
var hidePreviewPanel=false; // You can use this to hide the preview panel when running in directEdit mode in IE
var directmode=false; // is highlighting done in original text control or is there a preview panel (IE Windows only)

function getSpellCheckItem(jspell_n)
{
    var fieldsToCheck=getSpellCheckArray();
    return fieldsToCheck[jspell_n];
}

function spellcheck()
{
    var width=520; var height=200;
    if (navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.toLowerCase().indexOf("opera")==-1 && hidePreviewPanel==false) {
        directmode=true; width=290;
    }

    if(hidePreviewPanel==true)
        width=290;

    var w = 1024, h = 768;
    if (document.all || document.layers)
    {
        w=eval("scre"+"en.availWidth"); h=eval("scre"+"en.availHeight");
    }

    var leftPos = (w/2-width/2), topPos = (h/2-height/2);

    // need to check if window is already open.
    ww=window.open("/jspellhtml/jspellpopup.html", "checker", "width="+width+",height="+height+",top="+topPos+",left="+leftPos+",toolbar=no,status=no,menubar=no,directories=no,resizable=yes");
    ww.focus();
}
function updateForm(jspell_m,newvalue) { eval(getSpellCheckItemValue(jspell_m)+"=newvalue"); }
function getSpellCheckItemValue(jspell_j) { return getSpellCheckItem(jspell_j)+".value"; }
function getSpellCheckItemValueValue(jspell_k) { return eval(getSpellCheckItemValue(jspell_k)); }
*/

var fieldsToCheck;
//This method assumes that the form name is cartForm and that all of the message text areas to spell check are in the form 'message_index_index'
function updateArray(numberOfMessages)
{
    fieldsToCheck=new Array();
	for(i = 0; i < numberOfMessages; i++)
	{
	    fieldsToCheck[i]='document.cartForm.message_'+i;
	}
}

function getSpellCheckArray()
{
    return fieldsToCheck;
}


