// SEARCH PAGE
if (Ka.Info.PAGE == "search/searchPage.jsp") {

    $j('li.ka_list a span.ka_searchLetterBox').each(function() {
        var newStyle = $j(this).attr('style').replace('160x120', '100x75');
        $j(this).attr('style', newStyle);
        var newStyle = $j(this).attr('style').replace('160X120', '100X75');
        $j(this).attr('style', newStyle);
    });
}

if (Ka.Info.PAGE == "search/searchPage.jsp" && Ka.Util.getLocationParam('mediaType') === 'photo') {
    //$j('.ka_listDesc').after('<li class="readMore"><a href="#">read more &raquo;</a></li>');
    $j('.ka_searchListDetails').before('<div class="leftSideContent"><ul></ul></div>');

    $j('.ka_list').each(function(i) {
        var $this = $j(this);
        var selectedElem = $this.children('div.leftSideContent:first');
        $this.children('a:first').prependTo(selectedElem);
        $this.find('.ka_listViews').appendTo(selectedElem.find('ul'));
        $this.find('.ka_listDate').appendTo(selectedElem.find('ul'));
        //$this.find('.ka_listRating').appendTo(selectedElem.find('ul'));
    });

}

if (Ka.Info.PAGE == "search/searchPage.jsp" && Ka.Util.getLocationParam('mediaType') === 'blog') {
    //$j('.ka_listDesc').after('<li class="readMore"><a href="#">read more &raquo;</a></li>');
    $j('.ka_searchListDetails').before('<div class="leftSideContent"><ul></ul></div>');

    $j('.ka_list').each(function(i) {
        var $this = $j(this);
        var selectedElem = $this.children('div.leftSideContent:first');
        $this.children('a:first').prependTo(selectedElem);
        $this.find('.ka_listViews').appendTo(selectedElem.find('ul'));
        $this.find('.ka_listDate').appendTo(selectedElem.find('ul'));
        //$this.find('.ka_listRating').appendTo(selectedElem.find('ul'));
    });

}

if (Ka.Info.PAGE == "search/searchPage.jsp" && Ka.Util.getLocationParam('mediaType') === 'video') {
    //$j('.ka_listDesc').after('<li class="readMore"><a href="#">read more &raquo;</a></li>');
    $j('.ka_searchListDetails').before('<div class="leftSideContent"><ul></ul></div>');

    $j('.ka_list').each(function(i) {
        var $this = $j(this);
        var selectedElem = $this.children('div.leftSideContent:first');
        $this.children('a:first').prependTo(selectedElem);
        $this.find('.ka_listViews').appendTo(selectedElem.find('ul'));
        $this.find('.ka_listDate').appendTo(selectedElem.find('ul'));
        //$this.find('.ka_listRating').appendTo(selectedElem.find('ul'));
    });

}

if (Ka.Info.PAGE == "login/userLogin.jsp") {
    $j('#ka_rpxlogin').insertAfter('#ka_loginRetrieve');
}

if (Ka.Info.PAGE == "pages/mediaPlayPage.jsp") {
    $j('#ka_relatedWrap').before('<p id="tagContraints">Letters and numbers only. Spaces separate tags, double quotes create multi-word tags (e.g. "my photo").</p>');
    $j('#ka_playPageStats').before('<h3 class="ka_comments">Tools</h3>');
    //remove br
    $j('#ka_statsRate .ka_stats').html($j('#ka_statsRate .ka_stats').html().replace('<br>', '').replace('<br/>', ''));

    $j('#ka_statsRate .ka_stats').html($j('#ka_statsRate .ka_stats').html().replace('<BR>', '').replace('<BR/>', ''));

    if (Ka.Info.USERID === "") {
        $j('.ka_addFav').remove();
    }
}

if (Ka.Info.PAGE == "pages/manageProfileQuestions.jsp") {
    $j('.ka_Help:eq(0)').remove();
}

if (Ka.Info.PAGE == "pages/kickPlaceServerSide.jsp") {
    $j('#ka_profileContainer').before('<h3 id="profileHeader">View My Information</h3>');
    $j('#ka_profileActivityFeed ul li:odd').addClass('activityOdd');

    if (Ka.Info.USERID == Ka.Info.PROFILEID) {
        $j('#ka_profileViewsItem').before('<li id="ka_profileEditThumbnail" class="ka_sprite_misc"><a title="Edit Thumbnail" href="/service/displayManageAccountSettings.kickAction?STATUS=MAIN&as=111503">Edit Thumbnail Image</a></li>');
    }

    $j('#ka_headerSubNav_list').after('<ul id="ka_headerSubNav_list2"><li id="viewMyInfo"><a href="#">View My Information</a></li><li><a href="http://arnoldpalmer.usgamuseum.com/service/displayManageAccountSettings.kickAction?STATUS=MAIN&as=111503">Edit My Information</a></li><li><a href="http://arnoldpalmer.usgamuseum.com/view/displayManageMyMedia.kickAction?as=111503">View My Memories</a></li><li><a href="http://arnoldpalmer.usgamuseum.com/view/displayManageFavorites.kickAction?as=111503">My Favorites</a></li><li id="commentsOn"><a href="http://arnoldpalmer.usgamuseum.com/view/displayCommentDetails.kickAction?as=111503">Comments on My Memories</a></li></ul>');

}

if (Ka.Info.PAGE == "pages/kickPlaceServerSide.jsp") {

    if (Ka.Info.USERID !== '') {
        $j('#viewMyInfo a').attr('href', 'http://arnoldpalmer.usgamuseum.com/service/displayKickPlace.kickAction?as=111503&u=' + Ka.Info.USERID);
    } else {
        $j('#viewMyInfo a').attr('href', 'http://arnoldpalmer.usgamuseum.com/user/displayUserLoginPage.kickAction');
    }

}
if (Ka.Info.USERID !== '') {
    $j('#navInfo a').attr('href', 'http://arnoldpalmer.usgamuseum.com/service/displayKickPlace.kickAction?as=111503&u=' + Ka.Info.USERID);
} else {
    $j('#navInfo a').attr('href', 'http://arnoldpalmer.usgamuseum.com/user/displayUserLoginPage.kickAction');
}

if (Ka.Info.PAGE == "pages/myPlace.jsp") {
    document.location.href = "http://arnoldpalmer.usgamuseum.com/service/displayKickPlace.kickAction?as=111503&u=" + Ka.Info.USERID;
}

if (Ka.Info.PAGE == "pages/addBlog.jsp" || Ka.Info.PAGE == "pages/newVideoUpload.jsp" || Ka.Info.PAGE == "pages/newPhotoUpload.jsp") {

    $j('#ka_manageContent h3').after('<div id="submissionGuidelines"><a target="_blank" href="http://arnoldpalmer.usgamuseum.com/service/displayGettingStarted.kickAction?as=111503&WHOAMI=User">Submission Guidelines</a></div>');

    $j('#ka_blogSubmit').append('<p id="moderateMessage">Submitted memories will be moderated and appear on site only after approval.');

}
if (Ka.Info.PAGE == "pages/addBlog.jsp") {
    $j('#screenShotfileField').insertBefore('#ka_descRequired');
    $j('#ka_chooseFormat li:eq(1)').remove();
    $j('#ka_chooseFormat li:eq(2)').remove();

}

//Adding in Terms of Service
if (Ka.Info.PAGE == "login/registerUser.jsp") {
    KickAppsBizComponent.getUserEUA(Ka.Info.AFFILIATESITEID,
    function(eua) {
        var element = document.createElement('li');
        element.id = 'policy';
        element.innerHTML = eua;
        document.getElementById('ka_joinImage').parentNode.insertBefore(element, document.getElementById('ka_joinImage').nextSibling);
        $a = $j('#ka_joinTOS > a').hide();
        text = $j('<span>' + $a.text() + '</span>').insertAfter($a);
    });
}

if (Ka.Info.PAGE == "pages/myPlaceGettingStarted.jsp") {
    $j('#ka_contentContainer').append('<div id="disclaimer"><p>We encourage all users to share their personal memories of Arnold Palmer.</p><p>Please consider the following guidelines when creating your personal memory:</p><ol><li>Memories can take the form of words, images, and videos. Please share what you have.</li><li>Be creative and thoughtful. Generic birthday greetings to Mr. Palmer are certainly welcome, but we encourage you to personalize your memory. We\'re looking for stories that capture Arnold\'s unique character. Please have a look at the &quot;Featured Contributions&quot; section for select examples.</li><li>Please keep in mind that the spirit of this site is to honor Arnold Palmer. Memories should not be seen as opportunities to speak negatively about other individuals or entities. Submissions that violate this spirit may be edited or removed at the sole discretion of the site webmaster.</li><li>We encourage you to keep your posts to 1,500 words or less.</li><li>Acceptable image formats include JPEG, PNG, or GIF format (no progressive JPGs or animated GIFs);</li><li>Acceptable video formats include .flv, .wmv, .asf, .avi, .mov, .3gp, .mpg, .mpeg, or .mp4 format; file sizes should not exceed 100 MB.  Please remember that the very best submissions will be collected into a bound volume that will be presented to Mr. Palmer as an 80th birthday present.</li></ol><p>All submissions will be permanently archived at the USGA Museum.</p><p>And thank you for your contributions!</p></div>');
}

if (Ka.Info.PAGE == "search/searchPage.jsp") {
	$j('#ka_subMostComment').after('<li id="ie6Photo" class="ie6Right"><a href="http://arnoldpalmer.usgamuseum.com/service/searchEverything.kickAction?as=111503&mediaType=photo&sortType=recent&tab=yes&includePhoto=on&d-7095067-p=1">Photo Memories</a></li><li class="ie6Right"><a href="http://arnoldpalmer.usgamuseum.com/service/searchEverything.kickAction?as=111503&mediaType=video&sortType=recent&tab=yes&includeVideo=on&d-7095067-p=1">Video Memories</a></li><li id="ie6Blog" class="ie6Right"><a href="http://arnoldpalmer.usgamuseum.com/service/searchEverything.kickAction?as=111503&mediaType=blog&sortType=recent&includeBlog=on&d-7095067-p=1">Text Memories</a></li>');
}

if (Ka.Info.PAGE == "common/userTermsOfService.jsp") {
	$j('#ka_mainContainer').prepend('<div id="contactPage"><h3>Contact Us</h3><p>Your comments and requests for additional information are always welcome.</p><p>To contact the USGA Museum by email, please direct correspondence to <a href="mailto:museum@usga.org">museum@usga.org</a>.</p><p>You may also reach us by telephone during regular office hours at 908-234-2300, or by fax at 908-470-5013.</p><p>Mail should be directed to the following address:</p><p id="contactAddress">USGA Museum<br />PO Box 708<br />77 Liberty Corner Road<br />Far Hills, NJ 07931<br />USA </div>');
}

