/****** COMPONENT ******/ if( typeof( $ ) == 'undefined' ) { alert('WARNING - JQuery core library missing!'); } else { $(document).ready(function(){ // Highlighting a menu tab based on current page $(".headerMenuTab").each( function(){ if( pageName == $(this).attr( 'tabName' ) ) { $('img', this).attr( "src", d_HTTP_SITE_MEDIA + '/images/cms/menu_tab_' + $(this).attr( 'tabName' ) + '_on.gif' ); } else { $('img', this).attr( "src", d_HTTP_SITE_MEDIA + '/images/cms/menu_tab_' + $(this).attr( 'tabName' ) + '_off.gif' ); } }); // Hovering over a menu tab $(".headerMenuTab").hover( function() { if( pageName != $(this).attr( 'tabName' ) ) { $('img', this).attr( "src", d_HTTP_SITE_MEDIA + '/images/cms/menu_tab_' + $(this).attr( 'tabName' ) + '_on.gif' ); } }, function() { if( pageName != $(this).attr( 'tabName' ) ) { $('img', this).attr( "src", d_HTTP_SITE_MEDIA + '/images/cms/menu_tab_' + $(this).attr( 'tabName' ) + '_off.gif' ); } } ); $('#site_header_search_go').css('cursor', 'pointer'); $('#site_header_search_go').click(function(){ //$.jqURL.loc( 'http://' + d_SITE_DOMAIN + '/search?ser=' + $("#site_header_search").val() + '&q=' + $("#site_header_search_keys").val() ); window.open( 'http://' + d_SITE_DOMAIN + '/search?ser=' + $("#site_header_search").val() + '&q=' + $("#site_header_search_keys").val(), '_self' ); }); $('#headerTabLogin').click(function(){ $('#site_header_login_panel').fadeIn(300); // setting default login text var defaultHeadEnailText = "Email address..."; if( $("#loginemail").val() == '' ){ $("#loginemail").val( defaultHeadEnailText ); } $("#loginemail").focus(function(){ if( $(this).val() == defaultHeadEnailText ) { $(this).val(""); } }).blur(function(){ if( $(this).val() == "" ) { $(this).val( defaultHeadEnailText ); } }); return false; }); $('.siteHeaderLoginButton').click(function(){ //$('#welcomeLoginButtContainer').hide(); //$('#welcomeLoginAjaxContainer').fadeIn(200); rememberMe = 'yes'; $.ajax({ url: WEB_SERVICE+"/jscript/login.ws.php", type: "POST", cache: false, data: "email="+encodeURIComponent( $('#loginemail').val() )+"&password="+encodeURIComponent( $('#loginpass').val() )+"&remember="+rememberMe+"&redirect="+encodeURIComponent( $('#redirectTo').val() )+"&apikey="+SERVICES_API_KEY+"&authToken="+AUTH_TOKEN+"&reqType=sessionLogin&reqCall=doLogin", success: function( returnData, textStatus ) { // This stops browsers like IE from caching var currentTime = new Date(); $.jqURL.loc( returnData + '?lgToken=' + currentTime.getTime() ); }, error: function( requestOb ) { //$('#welcomeLoginAjaxContainer').hide(); //$('#welcomeLoginButtContainer').fadeIn(200); var msgArr = $("msg", requestOb.responseXML).text().split("::"); $.prompt(msgArr[1], { prefix:'impromptu', buttons: { OK: 'ok' } }); } }); return false; }); }); } /****** COMPONENT ******/ if( typeof( $ ) == 'undefined' ) { alert('WARNING - JQuery core library missing!'); } else { $(document).ready(function(){ // setting default comment text var defaultCommText = "Type your comment..."; if( $("#newNewsArticleComment").val() == '' ){ $("#newNewsArticleComment").val( defaultCommText ); } $("#newNewsArticleComment").focus(function(){ if( $(this).val() == defaultCommText ) { $(this).val(""); } }).blur(function(){ if( $(this).val() == "" ) { $(this).val( defaultCommText ); } }); $("#newsArticlePostButt").click(function(){ var nId = $(this).attr('naId'); var msg = '
Please Wait ...
'; $.blockUI.defaults.css = {}; $("#newsArticlePostContainer").block({ message: msg }); $("#newsArticlePostMessage").hide(); if( $("#newNewsArticleComment").val() == defaultCommText ) { commPostStr = ""; } else { commPostStr = $("#newNewsArticleComment").val(); } $.ajax({ url: WEB_SERVICE+"/jscript/ajax.ws.php", type: "POST", cache: false, data: "nId="+nId+"&comment="+encodeURIComponent( commPostStr )+"&apikey="+SERVICES_API_KEY+"&authToken="+AUTH_TOKEN+"&reqType=siteNews&reqCall=postNewsComment", success: function( returnData, textStatus ) { $("#newsArticlePostContainer").unblock(); $("#newsArticleCommList").append( returnData ); }, error: function( requestOb ) { $("#newsArticlePostContainer").unblock(); msgArr = $("msg", requestOb.responseXML).text().split("::"); if( msgArr[0] == "SESSION_ERROR" ) { $.jqURL.loc( msgArr[1]+'?redirectTo='+escape( $.jqURL.url() ) ); } else { $("#newsArticlePostMessage").fadeIn(200); $("#newsArticlePostMessage").html( msgArr[1] ); } } }); return false; }); $("#newsArticleLikeButt").click(function(){ var nId = $(this).attr('naId'); $("#newsArticleLikeButtContainer").html('You like this!'); $.ajax({ url: WEB_SERVICE+"/jscript/ajax.ws.php", type: "POST", cache: false, data: "nId="+nId+"&apikey="+SERVICES_API_KEY+"&authToken="+AUTH_TOKEN+"&reqType=siteNews&reqCall=rateLikeArticle", success: function( returnData, textStatus ) { // Nothing }, error: function( requestOb ) { $("#newsArticlePostContainer").unblock(); msgArr = $("msg", requestOb.responseXML).text().split("::"); if( msgArr[0] == "SESSION_ERROR" ) { $.jqURL.loc( msgArr[1]+'?redirectTo='+escape( $.jqURL.url() ) ); } else { $("#newsArticlePostMessage").fadeIn(200); $("#newsArticlePostMessage").html( msgArr[1] ); } } }); return false; }); }); } /****** COMPONENT ******/ if( typeof( $ ) == 'undefined' ) { alert('WARNING - JQuery core library missing!'); } else { $(document).ready(function(){ $(".jsDoFollowMeButt").css('cursor', 'pointer'); $(".jsDoFollowMeButt").hover( function(){ if( $(this).attr('followType') == 'start' ) { $('img', this).attr('src', d_HTTP_SITE_MEDIA+'/components/shared_library/follow_me_on.png'); } else { $('img', this).attr('src', d_HTTP_SITE_MEDIA+'/components/shared_library/unfollow_me_on.png'); } }, function(){ if( $(this).attr('followType') == 'start' ) { $('img', this).attr('src', d_HTTP_SITE_MEDIA+'/components/shared_library/follow_me_off.png'); } else { $('img', this).attr('src', d_HTTP_SITE_MEDIA+'/components/shared_library/unfollow_me_off.png'); } } ); $(".jsDoFollowMeButt").click(function(){ var followUserId = $(this).attr('followUserId'); var followType = $(this).attr('followType'); $.ajax({ url: WEB_SERVICE+"/jscript/social.ws.php", type: "POST", cache: false, data: "followUserId="+followUserId+"&followType="+followType+"&apikey="+SERVICES_API_KEY+"&authToken="+AUTH_TOKEN+"&reqType=socialInteraction&reqCall=followPerson", success: function( returnData, textStatus ) { var resultArr = returnData.split("::"); if( resultArr[0] == "FOLLOWING" ) { $("#followMeFollowButtContainer_"+resultArr[1]).hide(); $("#followMeStopFollowButtContainer_"+resultArr[1]).fadeIn(200); } else if( resultArr[0] == "NOT_FOLLOWING" ) { $("#followMeStopFollowButtContainer_"+resultArr[1]).hide(); $("#followMeFollowButtContainer_"+resultArr[1]).fadeIn(200); } }, error: function( requestOb ) { msgArr = $("msg", requestOb.responseXML).text().split("::"); if( msgArr[0] == "SESSION_ERROR" ) { $.jqURL.loc( msgArr[1]+'?redirectTo='+escape( $.jqURL.url() ) ); } else { //alert( msgArr[1] ); } } }); return false; }); }); }