
    function navDivChanger(activeGrp,gIndex){
        //document.getElementById('6spot_group1').style.display = 'none';
        //document.getElementById('6spot_group2').style.display = 'none';
        //var groupDiv = '6spot_group'+gIndex;

        //document.getElementById('6thmb_group1').style.display = 'none';
        //document.getElementById('6thmb_group2').style.display = 'none';
        //var groupDiv2 = '6thmb_group'+gIndex;
        //alert(activeGrp);
        if(activeGrp=='details'){
            //document.getElementById(groupDiv).style.display = 'block';
        } else if(activeGrp=='extras'){
            //document.getElementById(groupDiv2).style.display = 'block';
        }
    }

    // NAVIGATION ROLLOVERS
    function stayNav(){
    	var currUrl=location.href;
        var aboutBtn=document.getElementById('navbtn_about');
        	var aboutSourceSrc=aboutBtn.getAttribute('src');
        	var aboutSourceSrcRplcBtnOn=aboutSourceSrc.replace('_off','_on');
        var blogBtn=document.getElementById('navbtn_blog');
        	var blogSourceSrc=blogBtn.getAttribute('src');
        	var blogSourceSrcRplcBtnOn=blogSourceSrc.replace('_off','_on');
        var ecardBtn=document.getElementById('navbtn_ecard');
        	var ecardSourceSrc=ecardBtn.getAttribute('src');
        	var ecardSourceSrcRplcBtnOn=ecardSourceSrc.replace('_off','_on');
        var authorBtn=document.getElementById('navbtn_author');
        	var authorSourceSrc=authorBtn.getAttribute('src');
        	var authorSourceSrcRplcBtnOn=authorSourceSrc.replace('_off','_on');
        var locBtn=document.getElementById('navbtn_locations');
        	var locSourceSrc=locBtn.getAttribute('src');
        	var locSourceSrcRplcBtnOn=locSourceSrc.replace('_off','_on');
        
        if(currUrl.indexOf('author')!= -1){
        	authorBtn.setAttribute('src',authorSourceSrcRplcBtnOn);
        }else if(currUrl.indexOf('locations')!= -1){
        	locBtn.setAttribute('src',locSourceSrcRplcBtnOn);
        }else if(currUrl.indexOf('ecard')!= -1){
        	ecardBtn.setAttribute('src',ecardSourceSrcRplcBtnOn);
        }else if(currUrl.indexOf('wishingwall')!= -1){
        	//alert(location.href);
        	blogBtn.setAttribute('src',blogSourceSrcRplcBtnOn);
        }else if(currUrl.indexOf('about')!= -1){
        	aboutBtn.setAttribute('src',aboutSourceSrcRplcBtnOn);        
        }else {
        }
    }
    function swapIt_nav_rollover(){
        stayNav();
        var divMain2=document.getElementById('navbar_bloc');
        var divMainInfo=divMain2.getElementsByTagName('img');
        //alert(divMainInfo.length);
        for (var i=0; i<divMainInfo.length; i++){
            divMainInfo[i].onmouseover=function(){
            showNow(this);
            return false;
            }
            divMainInfo[i].onmouseout=function(){
            showThen(this);
            return false;
            }
        }
    }
    function showNow(whichpic){
        var sourceSrc=whichpic.getAttribute('src');
        var sourceSrcRplc=sourceSrc.replace('_off','_ov');
        var sourceSrcRplcBtnOn=sourceSrc.replace('btn_off','btn_on');
        var sourceSrcRplcBtnOff=sourceSrc.replace('btn_on','btn_off');
        var sourceSrcIdxf=sourceSrc.indexOf('nav');
        var sourceSrcIdxfBtn=sourceSrc.indexOf('buttons');
        var sourceSrcIdxfBtnOn=sourceSrc.indexOf('btn_on');
        var sourceSrcIdxfBtnOff=sourceSrc.indexOf('btn_off');
        if(sourceSrcIdxf!= -1){
            whichpic.setAttribute('src',sourceSrcRplc);
        }
        else if(sourceSrcIdxfBtn!= -1){
            if(sourceSrcIdxfBtnOff!= -1){
                //whichpic.setAttribute('src',sourceSrcRplcBtnOn);
            }
            else if(sourceSrcIdxfBtnOn!= -1){
                //whichpic.setAttribute('src',sourceSrcRplcBtnOff);
            }
        }
    }
    function showThen(whichpic){
        var sourceSrc=whichpic.getAttribute('src');
        var sourceSrcRplc=sourceSrc.replace('_ov','_off');
        var sourceSrcRplcBtnOn=sourceSrc.replace('btn_off','btn_on');
        var sourceSrcRplcBtnOff=sourceSrc.replace('btn_on','btn_off');
        var sourceSrcIdxf=sourceSrc.indexOf('nav');
        var sourceSrcIdxfBtn=sourceSrc.indexOf('buttons');
        var sourceSrcIdxfBtnOn=sourceSrc.indexOf('btn_on');
        var sourceSrcIdxfBtnOff=sourceSrc.indexOf('btn_off');
        if(sourceSrcIdxf!= -1){
            whichpic.setAttribute('src',sourceSrcRplc);
        }
        else if(sourceSrcIdxfBtn!= -1){
            if(sourceSrcIdxfBtnOff!= -1){
                //whichpic.setAttribute('src',sourceSrcRplcBtnOn);
            }
            else if(sourceSrcIdxfBtnOn!= -1){
                //whichpic.setAttribute('src',sourceSrcRplcBtnOff);
            }
        }
    }


    // E CARD PREVIEW
    function getTextCount(what){
        var mytextarea=document.SendMailForm.UserMessage;
        var countField=document.SendMailForm.textcounter;
        var countFieldmax="255";
        if(mytextarea.value.length>countFieldmax){
            mytextarea.value=mytextarea.value.substring(0,countFieldmax);
        }else{
            countField.value=countFieldmax-mytextarea.value.length;
        }
    }

    function openpreview(id){
        document.getElementById(id).style.display="block";
        //alert(id);
        if( document.getElementById("ecard630") ){
            //document.getElementById(id).style.backgroundImage ="url(http://ezines.alloymarketing.com/alloyentertainment/private_novels/ecards/images/ecard1_img3a.jpg)";
            document.getElementById(id).style.background="#ffffff";
            document.getElementById(id).style.color="#000000";
        } else {
            document.getElementById(id).style.background="transparent";
        }
        document.getElementById(id).innerHTML = document.SendMailForm.UserMessage.value;
    }
    function closepreview(id){
        document.getElementById(id).style.display="none";
    }


    // LOADS SCRIPTS
    window.onload=function(){
        swapIt_nav_rollover();
    }


function topicLocked( topic_id, is_locked ) {
    new Ajax.Updater( 'topic_status_' + topic_id, '/wishingwall/topicLocked.htm', {
        parameters: { topicId: topic_id, locked: is_locked }
    });
}
function topicMessageApprove( topic_message_id, is_approved ) {
    new Ajax.Updater( 'topic_message_status_' + topic_message_id, '/wishingwall/topicMessageApproval.htm', {
        parameters: { topicMessageId: topic_message_id, approved: is_approved }
    });
}
function topicMessageDelete( topic_message_id ) {
    var answer = confirm( "Are you sure you want to delete this message?" );
    if( answer ){
        new Ajax.Updater( 'topic_message_box_' + topic_message_id, '/wishingwall/topicMessageDelete.htm', {
            parameters: { topicMessageId: topic_message_id }
        });
    }
}



//////////////////////////////////////////////////////////////////////////////////
// ajax form validation
function combineDob()
{   var dobMonth = $F('dobMonth');
    var dobDay = $F('dobDay');
    var dobYear = $F('dobYear');
    if( ( dobMonth != null && dobMonth != "" ) &&
        ( dobDay != null && dobDay != "" ) &&
        ( dobYear != null && dobYear != "" ) )
    {   $('birthDate').value = dobMonth + "/" + dobDay + "/" + dobYear;
    }
}
function combinePhone()
{   var areaCode = $F('areaCode');
    var first3Digits = $F('first3Digits');
    var last4Digits = $F('last4Digits');
    if( ( areaCode != null && areaCode != "" ) &&
        ( first3Digits != null && first3Digits != "" ) &&
        ( last4Digits != null && last4Digits != "" ) )
    {   $('phoneNumber').value = areaCode + "-" + first3Digits + last4Digits;
    }
}
function setUsernameAsEmail()
{   $('username').value = $F('email');
}
function ajaxValidate( theForm )
{   combineDob();
    combinePhone();
    setUsernameAsEmail();
    var elements = Form.getElements( theForm );
    for( i = 0; i < elements.length; i++ )
    {   if( elements[i].name != "" )
        {   if( $( elements[i].name + "Error" ) )
            {   $( elements[i].name + "Error" ).innerHTML = "";
            }
        }
    }
    $( 'ajaxForm' ).value = "true";
    formString = Form.serialize( theForm );
    Form.disable( theForm );
    var myAjax = new Ajax.Updater(
        { success: 'validationHolder' },
        theForm.action,
        { method: 'post',
        parameters: formString,
        onFailure: reportError,
        evalScripts: true
        }
    );
}


var myGlobalHandlers = {
    onCreate: function(){
        Element.show( 'systemWorking' );
    },
    onComplete: function() {
        if( Ajax.activeRequestCount == 0 ){
            Element.hide( 'systemWorking' );
        }
    }
};
Ajax.Responders.register( myGlobalHandlers );

function showResponse( request )
{   //put returned XML in the textarea
    if( request.readyState == 4 )
    {   if( request.status == 200 )
        {   eval( request.responseText );
        }
        else
        {   alert( "There was a problem validating this form:\n" + request.statusText );
        }
    }
    //$('validationHolder').value = request.responseText;
}

function reportError( request )
{   alert( "ERROR: There was a problem validating this form:\n" + request.statusText );
}

function reportFilterError( request )
{   alert( "ERROR: There was a problem filtering:\n" + request.statusText );
}

function reportRateError( request )
{   alert( "ERROR: There was a problem rating this group:\n" + request.statusText );
}


function swapImage( imageId, newSrc )
{   $( imageId ).src = newSrc;
}
//////////////////////////////////////////////////////////////////////////////////


/////////////////////////Random Ord for Ad Tags//////////////////////////////////////////////////////	

var ord = Math.floor(Math.random()*10000000000000000);

//////////////////////////////////////////////////////////////////////////////////	

