winsettings = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,';

function colorwin(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Colors', 'info', winsettings + 'width=340,height=400') }

function bgroundwin(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Background', 'info2',  winsettings + 'width=250,height=290') }

function bgroundmsgwin(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Backgroundmsg', 'info12',  winsettings + 'width=520,height=400') }

function bgrlogomsgwin(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Backgrlogomsg', 'info13',  winsettings + 'width=250,height=290') }

function emoticonwin(){                cyber=window.open('modules.php?name=Cards&file=win&Info=Emoticons', 'info4', winsettings + 'width=500,height=400') }

function exturl(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Custom', 'info5', winsettings + 'width=450,height=270') }

function notify(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Notify', 'info6', winsettings + 'width=300,height=200') }

function fontface(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Fonts', 'info7', winsettings + 'width=550,height=270') }

function size(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Size', 'info3', winsettings + 'width=550,height=270') }

function templates(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Templates', 'info14', winsettings + 'width=160,height=270') }

function stampwin(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Stamp', 'info8', winsettings + 'width=220,height=390') }

function mycontacts(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Mycontacts', 'info9', winsettings + 'width=550,height=400') }

function myhelp(){                 cyber=window.open('modules.php?name=Cards&file=help&Info=MyHelp', 'info1', winsettings + 'width=550,height=270') }

function mycalendar(){               cyber=window.open('modules.php?name=Cards&file=win&Info=MyCalendar', 'info11', winsettings + 'width=240,height=210') }

function poemwin(){                 cyber=window.open('modules.php?name=Cards&file=win&Info=Poem', 'info10', winsettings + 'width=400,height=390') }

function playmusic(formObj)

{

        musicName = formObj.PostSound.options[formObj.PostSound.selectedIndex].value;

        if(musicName != "modules/Cards/music/")

           window.location= PostSoundURL + musicName;

        else

           alert(MsgWinMusicNote);

}

function ValidateForm() {
        document.eCardform.sendnow.disabled = true;
        return true;
}
function viewpoem(formObj) {
        PoemID = formObj.card_poem.options[formObj.card_poem.selectedIndex].value;
        if (PoemID != "")
        {
                poemwin=window.open(pagehelp +'?topic=poem&poem_id='+PoemID, 'poem', winprop + 'width=550,height=270');
                poemwin.focus();
        } else {
                alert(msg_alert_choose_option);
        }
}
function smilie(text) {
        //text =' '+text+' ';
        if (document.eCardform.PostMessage.createTextRange && document.eCardform.PostMessage.caretPos)
        {
                var caretPos = document.eCardform.PostMessage.caretPos;
                caretPos.text = caretPos.text.charAt(caretPos.text.length - 100)==' '? text+' ':text;
                document.eCardform.PostMessage.focus();
        } else {
                document.eCardform.PostMessage.value += text;
                document.eCardform.PostMessage.focus();
        }
}
function email(text) {
        //text =' '+text+' ';
        if (document.eMailform.PostMessage.createTextRange && document.eMailform.PostMessage.caretPos)
        {
                var caretPos = document.eMailform.PostMessage.caretPos;
                caretPos.text = caretPos.text.charAt(caretPos.text.length - 100)==' '? text+' ':text;
                document.eMailform.PostMessage.focus();
        } else {
                document.eMailform.PostMessage.value += text;
                document.eMailform.PostMessage.focus();
        }
}
function flags(text) {
        //text =' '+text+' ';
        if (document.eCardform.PostMessage.createTextRange && document.eCardform.PostMessage.caretPos)
        {
                var caretPos = document.eCardform.PostMessage.caretPos;
                caretPos.text = caretPos.text.charAt(caretPos.text.length - 1)==' '? text+' ':text;
                document.eCardform.PostMessage.focus();
        } else {
                document.eCardform.PostMessage.value += text;
                document.eCardform.PostMessage.focus();
        }
}
function addrecp(formObj){
  NumberRecp = formObj.addrecip.options[formObj.addrecip.selectedIndex].value;
  if(NumberRecp != ""){
    window.location="modules.php?name=Cards&file=create&" + query_string + "&addrecip=" + NumberRecp;
  }
function AddAddress(RecpName, RecpEmail) {
        eval('address = addrecp(document.eCardform.' + Field);
        if (address == null)
                return;
        if (RecpEmail.length == 0)
                return;
        if (address.value.length > 0)
                address.value += ', ';
        if (RecpEmail.indexOf(',') != -1 || RecpEmail.indexOf(';') != -1)
                address.value +=  RecpEmail;
        else
        {
                if (Name.length > 0)
                        address.value += '"' + RecpName + '" ';
                address.value +=  '<' + RecpEmail + '>';
        }
        alert('Contact Added!');
  }
var SymRealOnLoad;
var SymRealOnUnload;

function SymOnUnload()
{
  window.open = SymWinOpen;
  if(SymRealOnUnload != null)
     SymRealOnUnload();
}

function SymOnLoad()
{
  if(SymRealOnLoad != null)
     SymRealOnLoad();
  window.open = SymRealWinOpen;
  SymRealOnUnload = window.onunload;
  window.onunload = SymOnUnload;
}

SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
function SymError()
{
  return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
  return (new Object());
}

window.open = SymWinOpen;
function tmt_findObj(n){
        var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
        x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
        }else{x=document.getElementById(n)}return x;
}

function MM_showHideLayers() { //v3.0A Modified by Al Sparber and Massimo Foti for NN6 Compatibility
  var i,p,v,obj,args=MM_showHideLayers.arguments;if(document.getElementById){
   for (i=0; i<(args.length-2); i+=3){ obj=tmt_findObj(args[i]);v=args[i+2];
   v=(v=='show')?'visible':(v='hide')?'hidden':v;
   if(obj)obj.style.visibility=v;}} else{
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }}
}

function BW_centerLayers() { //v4.1.1
        if (document.layers || document.all || document.getElementById){
                var winWidth, winHeight, i, horz, vert, width, height, offsetX, offsetY, negX, negY, group, x, y, args;
                args = BW_centerLayers.arguments;

                onresize = BW_reload;


                winWidth = (document.all)?document.body.clientWidth:window.innerWidth;
                winHeight = (document.all)?document.body.clientHeight:window.innerHeight;

                for (i=0; i<(args.length-9); i+=10) {
                        horz    = args[i+1];
                        vert    = args[i+2];
                        width   = parseInt(args[i+3]);
                        height  = parseInt(args[i+4]);
                        offsetX = parseInt(args[i+5]);
                        offsetY = parseInt(args[i+6]);
                        negX    = args[i+7];
                        negY    = args[i+8];

                        x = ((winWidth - width)/2) + offsetX;
                        y = ((winHeight - height)/2) + offsetY;

                        x = (negX=='false' && (x < 0))?0:x;
                        y = (negY=='false' && (y < 0))?0:y;

                        layerObj = (document.getElementById)?document.getElementById(args[i]):MM_findObj(args[i]);

                        if (layerObj!=null) {
                                layerObj = (layerObj.style)?layerObj.style:layerObj;
                                layerObj.left = (horz=="true")?x:layerObj.left;
                                layerObj.top = (vert=="true")?y:layerObj.top;
                        }
                }
        }
}
function do_highlight(el)
{
        var ref = null;
        if (el.parentNode && el.parentNode.parentNode)
        {
            ref = el.parentNode.parentNode;
        }
        else if (el.parentElement && el.parentElement.parentElement)
        {
            ref = el.parentElement.parentElement;
        }
        if (ref)
        {
            if (ref.className == 'row')
                {
                        ref.className = 'rowhighlight';
            }
            else if (ref.className == 'row1')
                {
                        ref.className = 'row1highlight';
            }
        }
}
function undo_highlight(el)
{
        var ref = null;
        if (el.parentNode && el.parentNode.parentNode)
        {
            ref = el.parentNode.parentNode;
        }
        else if (el.parentElement && el.parentElement.parentElement)
        {
            ref = el.parentElement.parentElement;
        }
        if (ref)
        {
            if (ref.className == 'rowhighlight')
                {
                        ref.className = 'row';
            }
            else if (ref.className == 'row1highlight')
                {
                        ref.className = 'row1';
            }
        }
}
function HL(el)
{
        if (el.checked){
                do_highlight(el);
        }else{
            undo_highlight(el);
        }
}
function openEmailWindow(thePage)
{
        emailWin = window.open(thePage,'email','width=340,height=450');
}
var win_addrbook;
function OpenAddrbook(can_multi)
{
        if (win_addrbook && win_addrbook.open && !win_addrbook.closed)
        {
                win_addrbook.focus();
        } else {
                var tp,lft;
                lft=(screen.availWidth/2)-225;
                tp=(screen.availHeight/2)-187;
                win_addrbook = window.open(pageaddrbook +'?l='+ can_multi +'&scr=pop&action=','win_addrbook',winprop + 'dependent=0,width=420,height=400,screenX=' + lft + ',screenY=' +tp + ',top=' + tp + ',left=' + lft);
        }
}
function closeaddressbook()
{
        if (win_addrbook && win_addrbook.open && !win_addrbook.closed)
        {
                win_addrbook.close();
        }
}
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function BW_reload() {location.reload();}
}
