function setupDemos() { Shadowbox.setup("a.swf", { gallery: "swf", continuous: true }); } function SelectedDay(d, inst) { $(".events_notes").html("loading ..."); req_path = SitePath + "/events/" + d.replace(/\//ig, "_") ; $(".events_notes").hide(300, function(){ $.get( req_path, function (res) { $(".events_notes").html(res); $(".events_notes").show(200); socializer( '.socializer' ); }) ; }) } function loadBooks(){ $.get(SitePath + "/_get_books_data.php", function (res) { if(res){ $('#for_books_list').html(res); $('#for_books_list').selecter("refresh") } }); } function loadEvents() { $.ajax({ url: SitePath + "/event_date.php?s=" + ($("#event_search").length > 0 ? $("#event_search").val() : ''), data: "action=showdates", dataType: "json", success: function(calendarEvents){ $(".for_cal").datepicker("destroy"); $(".for_cal").datepicker({ onSelect: SelectedDay, // [rows, columns] if you want to display multiple calendars. numberOfMonths: [1, 1], showCurrentAtPos: 0, beforeShowDay: function (date){ var result = ""; date.setTime( date.getTime() /* + date.getTimezoneOffset()*60*1000 */ ); for (i = 0; i < calendarEvents.length; i++) { if (date.getMonth() == calendarEvents[i][0] - 1 && date.getDate() == calendarEvents[i][1] && date.getFullYear() == calendarEvents[i][2]) { //[disable/enable, class for styling appearance, tool tip] return [true,"ui-state-highlight myClass",calendarEvents[i][3]]; } } return [false, ""];//enable all other days } }); }, }); } $(document).ready ( function () { $("#nav_menu ul li").click (function (){ $("#nav_menu ul li") .removeClass("selected"); $(this).addClass("selected") ; }); $(".delete_post_group").click(function(e) { selected = ""; for (i=0; i < $(".remove_group").length; i++ ){ cur_one = $(".remove_group:eq("+i+")"); if ( cur_one.is(':checked') ) { selected = cur_one.val() + "," + selected ; } } if (selected != "") alert(''); location.href = "/_the_admin/posts_management.php?pid="+selected+"&action=delete"; }); $(".delete_members_group").click(function(e) { selected = ""; for (i=0; i < $(".remove_group").length; i++ ){ cur_one = $(".remove_group:eq("+i+")"); if ( cur_one.is(':checked') ) { selected = cur_one.val() + "," + selected ; } } if (selected != "") { location.href = "/_the_admin/members_management.php?memid="+selected+"&act=remove"; } }); $(".delete_events_group").click(function(e) { selected = ""; for (i=0; i < $(".remove_group").length; i++ ){ cur_one = $(".remove_group:eq("+i+")"); if ( cur_one.is(':checked') ) { selected = cur_one.val() + "," + selected ; } } if (selected != "") { location.href = "/_the_admin/events_management.php?eid="+selected+"&action=delete"; } }); $(".sort_by").each(function(i) { $(this).click( function(e){ e.preventDefault(); $("#main_recent").fadeOut(200); $.get(SitePath + "/get_ordered_group/" + $(this).attr("rel") + "/", function(res){ $("#main_recent").html(res); $("#main_recent").fadeIn(200); } ) } ); }); $(".sort_by_featured").each(function(i) { $(this).click( function(e){ e.preventDefault(); $("#main_featured").fadeOut(200); $.get(SitePath + "/get_ordered_group_featured/" + $(this).attr("rel") + "/", function(res){ $("#main_featured").html(res); $("#main_featured").fadeIn(200); } ) } ); }); $(".sort_by_tag").each(function(i) { $(this).click( function(e){ e.preventDefault(); $("#main_featured").fadeOut(200); $.get(SitePath + "/get_ordered_group_tag/"+$(this).attr("rel")+"/" + $("#TagMemberId").val()+ "/", function(res){ $("#main_featured").html(res); $("#main_featured").fadeIn(200); } ) } ); }); $(".sort_by_favorites").each(function(i) { $(this).click( function(e){ e.preventDefault(); $("#main_favorites").fadeOut(200); $.get(SitePath + "/get_ordered_group_favorites/" + $(this).attr("rel") + "/", function(res){ $("#main_favorites").html(res); $("#main_favorites").fadeIn(200); } ) } ); }); $(".sort_by_profile_favorites").each(function(i) { $(this).click( function(e){ e.preventDefault(); $("#main_recent").fadeOut(200); $.get(SitePath + "/get_ordered_group_profile_favorites/" + $(this).attr("rel") + "/", function(res){ $("#main_recent").html(res); $("#main_recent").fadeIn(200); } ) } ); }); $(".sort_by_profile_posts").each(function(i) { $(this).click( function(e){ e.preventDefault(); $("#main_recent").fadeOut(200); $.get(SitePath + "/get_ordered_group_profile_posts/" + $(this).attr("rel") + "/", function(res){ $("#main_recent").html(res); $("#main_recent").fadeIn(200); } ) } ); }) $(".sort_by_album").each(function(i) { $(this).click( function(e){ e.preventDefault(); $("#main").fadeOut(200); $.get(SitePath + "/get_ordered_group_album/" + $(this).attr("rel") + "/", function(res){ $("#main").html(res); $("#main").fadeIn(200); } ) } ); }); $(".sort_by_search").each(function(i) { $(this).click( function(e){ e.preventDefault(); $("#main").fadeOut(200); $.get(SitePath + "/get_ordered_group.php?group=search&the_cat="+document.search_form.the_cat.value+"&search_input="+escape(document.search_form.search_input.value)+"&order_by=" + $(this).attr("rel"), function(res){ $("#main").html(res); $("#main").fadeIn(200); } ) } ); }); $(".like_link").click(function(e) { e.preventDefault(); //alert (SitePath + "/like_it/" + $(this).attr("rel") + "/" + $(".the_post_id").html() + "/") ; $.get(SitePath + "/like_it/" + $(this).attr("rel") + "/" + $(".the_post_id").html() + "/", function(){ location.href = location.href; }); }); loadEvents(); function moveCloseLink(){ var cb=document.getElementById('sb-nav-close'); var tb=document.getElementById('sb-title'); if(tb) tb.appendChild(cb); } Shadowbox.init( { overlayColor: "#491d3c", overlayOpacity: 0.8, autoplayMovies: true, width:700, height:400, onOpen: moveCloseLink }, setupDemos); $("#search_input").focus(function(){ $(this).val(""); }); $("#search_input").blur(function(){ if ($(this).val() == "") $(this).val($(this).attr("title")); }) $(".input_field").focus(function(){ $(this).val(""); }); if ( $("#forgot_my_pass").length ) { $("#forgot_my_pass").validate(); var options = { target: '#adding_comment_res' ,url: SitePath + "/forget_my_pass/" ,success: HashSent }; $('#forgot_my_pass').ajaxForm(options); } if ( $("#provide_hash_code").length ) { $("#provide_hash_code").validate(); var options = { target: '#adding_comment_res' ,url: SitePath + "/forget_my_pass/" ,success: HashEntered }; $('#provide_hash_code').ajaxForm(options); } $(".input_field").blur(function(){ if ($(this).val() == "") $(this).val($(this).attr("title")); }) $("ul.navigation li").each(function(){ $(this).mouseenter(function(){ if ($(this).find("ul.sub_menu").length) { my_width = $(this).width() ; $(this).css("background", "url(img/menu_item_hover_bg.png)"); $(this).find("ul.sub_menu li").each(function(){ $(this).css("minWidth", my_width) ; }) $(this).find("ul.sub_menu").show(); } }); $(this).mouseleave(function(){ if ($(this).find("ul.sub_menu").length) { $(this).css("background", "url(img/upper_menu_item_bg.png)"); $(this).find("ul.sub_menu").hide(); } }); }); /* if ($("#member_registration_form").length) { $("#member_registration_form").validate({rules:{member_pass2: {equalTo: "#member_pass"}}}); var options = { target: '#register_res' ,url: SitePath + "/confirm/" //beforeSubmit: showRequest, ,success: showResponse }; $('#member_registration_form').ajaxForm(options); }*/ if ($("#login_form").length) { //$("#member_registration_form").validate({rules:{member_pass2: {equalTo: "#member_pass"}}}); var options = { target: '#login_box' ,url: SitePath + "/member_log_in.php" ,success: LoginSuccess }; $('#login_form').ajaxForm(options); } if ($("#add_comment_form").length) { // $("#add_comment_form").validate(); var options = { target: '#adding_comment_res' ,url: SitePath + "/adding_comment.php" ,success: AddCommentRes }; $('#add_comment_form').ajaxForm(options); } $(".events_notes").html("Event loading ..."); var event_get_path = SitePath + "/events/01_01_1800"; $(".events_notes").hide(300, function(){ $.get( event_get_path, function (res) { $(".events_notes").html(res); $(".events_notes").show(200); socializer( '.socializer' ); }) ; }); $(".banner_sidebar").html("Loading..."); var banner_get_path = SitePath + "/get_banner.php"; $(".banner_sidebar").hide(300, function(){ $.get( banner_get_path, function (res) { $(".banner_sidebar").html(res); $(".banner_sidebar").show(200); }) ; }); }); function nav() { $('.navigation li:first-child').addClass('first'); $('.navigation li:last-child').addClass('last'); } function showRequest(formData, jqForm, options) { var queryString = $.param(formData); return true; } // post-submit callback function showResponse(responseText, statusText, xhr, $form) { if (/thank/ig.test(responseText)) { $("#member_registration_form").hide(1200); } } function LoginSuccess(responseText, statusText, xhr, $form) { location.href = SitePath ; } function HashSent(responseText, statusText, xhr, $form) { $(".add_comment_form").hide(1200); } function HashEntered(responseText, statusText, xhr, $form) { if (/Step/ig.test(responseText)) { $("#provide_hash_code").hide(400); } } function AddCommentRes(responseText, statusText, xhr, $form) { post_id = $form.find("#post_id").val() ; member_id = $form.find("#member_id").val() ; if (/thank/ig.test(responseText) > -1) { mymatch = /\d+/.exec(responseText); if (mymatch.length) { rec_id = (mymatch[0]); $.get(SitePath+"/adding_comment.php?rec_id=" + rec_id , function(res) { CommentBox = $("