    function show_what_this(id){
            document.getElementById('msg1').style.display="none";
            document.getElementById('msg2').style.display="none";
            document.getElementById('tag_submitted').style.display="none";                                    
            Effect.Appear(id,{duration:0.6});
    }
    
    function hide_what_this(id){
    Effect.Fade(id,{duration:0.1});
    }
    
    function seeker_pagination1(pageno,param1)
    {
        new Ajax.Updater('story_list', '/user_story/more_stories?page='+pageno+'&suggestion_id='+param1, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear('story_list',{duration:0.4});}}); return false;
//        new Ajax.Updater('story_list', '/user_story/more_stories?page='+pageno+'&suggestion_id='+param1, {asynchronous:true, evalScripts:true,onLoading:function(request){new Effect.Fade('story_list',{duration:0.4});},onComplete:function(request){new Effect.SlideDown('story_list',{duration:0.4});}}); return false;
    }
    function seeker_pagination2(pageno,param1)
    {
        new Ajax.Updater('story_list', '/user_story/more_stories?page='+pageno+'&expert_work_id='+param1, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear('story_list',{duration:0.4});}}); return false;
//        new Ajax.Updater('story_list', '/user_story/more_stories?page='+pageno+'&suggestion_id='+param1, {asynchronous:true, evalScripts:true,onLoading:function(request){new Effect.Fade('story_list',{duration:0.4});},onComplete:function(request){new Effect.SlideDown('story_list',{duration:0.4});}}); return false;
    }
    function seeker_pagination3(pageno,param1)
    {
        new Ajax.Updater('story_list', '/user_story/more_stories?page='+pageno+'&expert_book_id='+param1, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear('story_list',{duration:0.4});}}); return false;
//        new Ajax.Updater('story_list', '/user_story/more_stories?page='+pageno+'&suggestion_id='+param1, {asynchronous:true, evalScripts:true,onLoading:function(request){new Effect.Fade('story_list',{duration:0.4});},onComplete:function(request){new Effect.SlideDown('story_list',{duration:0.4});}}); return false;
    }

    /*
    * This function just changes the moue pointer into a hand.
    */
    function change_pointer(id_name)
    {
        document.getElementById(id_name).style.cursor = "hand";
        document.getElementById(id_name).style.cursor = "pointer";
    }

    /*
        
    */
        
    /*
    *   This method just gets the popup of the story in detail and put it on the page.
    *   function get_this_story(story_id,updating_id,row_number)
    */
    function get_this_story(story_id,updating_id,page_no,suggestion_id)
    {
//        to_be_updated_in_this_div = updating_id+row_number;
        new Ajax.Updater(updating_id,'/user_story/get_story_details?story_id='+story_id+'&updating_id='+updating_id+'&page='+page_no+'&suggestion_id='+suggestion_id, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear(updating_id,{duration:1.4});}}); return false;
    }
    
        function get_this_story_work(story_id,updating_id,page_no,expert_work_id)
    {
//        to_be_updated_in_this_div = updating_id+row_number;
        new Ajax.Updater(updating_id,'/user_story/get_story_details?story_id='+story_id+'&updating_id='+updating_id+'&page='+page_no+'&expert_work_id='+expert_work_id, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear(updating_id,{duration:1.4});}}); return false;
    }
    
        function get_this_story_book(story_id,updating_id,page_no,expert_book_id)
    {
//        to_be_updated_in_this_div = updating_id+row_number;
        new Ajax.Updater(updating_id,'/user_story/get_story_details?story_id='+story_id+'&updating_id='+updating_id+'&page='+page_no+'&expert_book_id='+expert_book_id, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear(updating_id,{duration:1.4});}}); return false;
    }
    
    
    function check()
    {
        alert("Completed......");
    }
    
    /*
    *  This function just closes the ajax popup for Stories.
    */
    function close_this_popup(slide_up_this_popup)
    
    {
   
        Effect.Fade(slide_up_this_popup);
    }
    
    function first_url()
    {
        url = document.location.href;
       url=url.replace(/\&/g,"%26")
        return url;
    }    
    
    function url2()
    {
       url = document.location.href;
        return url;
    }

    function add_your_tag()
    {

            document.getElementById('msg1').style.display="none";
            document.getElementById('msg2').style.display="none";
            document.getElementById('tag_submitted').style.display="none";                        
            document.getElementById('tags').value='';
            document.getElementById('tag_errors2').style.display="none";
            document.getElementById('tag_errors').style.display="none";
            document.getElementById('tag_errors3').style.display="none";                        

           
            Effect.Appear('tag_form',{duration:0.2});

    }
    
    function your_tags()
    {

    new Ajax.Updater('form_results1', '/user_story/add_your_tags', {asynchronous:true, evalScripts:true,onLoading:function(request){},onComplete:function(request){Effect.SlideUp('tag_form');Effect.Appear('msg3');}}); return false;
    }
    
    /*
    * This function gets the next Story of that particular Suggestion
    */
    function story_pagination(pageno)
    {

    
        new Ajax.Updater('ar_pop', '/user_story/show_articles?page='+pageno, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear('ar_pop',{duration:0.4});}}); return false;

    }
    
    function sug_tag_pagination(pageno,cat_id)
    {
     new Ajax.Updater('tags_sug', '/suggestion/show_tagged_suggestions?page='+pageno+'&category='+cat_id, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear('tags_sug',{duration:0.4});}}); return false;
    }
    
    function sug_works_pagination(pageno,cat_id)
    {
     new Ajax.Updater('tags_sug', '/suggestion/show_tagged_works?page='+pageno+'&category='+cat_id, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear('tags_sug',{duration:0.4});}}); return false;
    }
    
    function tag_pagination(pageno,param1)
    {

        new Ajax.Updater('fill_tag', '/suggestion/suggestion_tag?page='+pageno+'&category_id='+param1, {asynchronous:true, evalScripts:true,onComplete:function(request){new Effect.Appear('story_list',{duration:0.4});}}); return false;
//        new Ajax.Updater('story_list', '/user_story/more_stories?page='+pageno+'&suggestion_id='+param1, {asynchronous:true, evalScripts:true,onLoading:function(request){new Effect.Fade('story_list',{duration:0.4});},onComplete:function(request){new Effect.SlideDown('story_list',{duration:0.4});}}); return false;
    }



    /*
    *  This is a function to show the message that the story is already submitted by this user.
    */
    function show_story_submitted_message()
    {
        document.getElementById('form_results').innerHTML='';document.getElementById('tags_box').value='';document.getElementById('stry_cont').value='';document.getElementById('story_title').value='';
        if(document.getElementById('check_story_submission').value==false)
        {
             Effect.Appear('story_form_here');
        }
        else
        {
            Effect.Appear('msg2', {duration:0.2});
            if (document.getElementById('msg2'))
    		Effect.Fade('msg2',{duration:20});	
        }
    }
    
    
    /*
    *  Thisfunction is just to disable the Share button for Story submision
    */
    //A variable for saving the onclick of the Share Button
    var on_click_for_sharing = "";
    
    function disable_this_button(id_name_of_button)
    {
        var onclickattributes_share = document.getElementById(id_name_of_button).attributes;
        on_click_for_sharing = onclickattributes_share.getNamedItem("onclick").value;

        onclickattributes_share.getNamedItem("onclick").value = "";
        
        //This reassigns the value of the attribute after some time.
    	setTimeout("assign_onclick_variable_for_share('"+id_name_of_button+"')",4000); 
        
    }
    
    function assign_onclick_variable_for_share(reassign_this_div)
    {
        if(navigator.appName == "Microsoft Internet Explorer")
        {
            document.getElementById(reassign_this_div).onclick = function(){show_story_submitted_message(); getId(this.id);disable_this_button(this.id);};
        }
        else
        {
            var onclickattributes_of_share = document.getElementById(reassign_this_div).attributes;
            onclickattributes_of_share.getNamedItem("onclick").value = on_click_for_sharing;
        }
    }
    
    
    function change_src(){
   
    document.getElementById('sub_btn').style.display="none";
    document.getElementById('sub_btn_ovr').style.display="block";
    }
    
    function change_back_src(){
    document.getElementById('sub_btn').style.display="block";
    document.getElementById('sub_btn_ovr').style.display="none";
    }
    
    function change_src_cancel(){
     document.getElementById('can_btn').style.display="none";
    document.getElementById('can_btn_over').style.display="block";
    }
    
     function change_back_src_cancel(){
    document.getElementById('can_btn').style.display="block";
    document.getElementById('can_btn_over').style.display="none";
    }
    
    function escapeVal(textarea,replaceWith){
    var abc;
//textarea is reference to that object, replaceWith is string that will replace the encoded return
abc = escape(textarea.value) 
//encode textarea string's carriage returns

for(i=0; i<abc.length; i++){
//loop through string, replacing carriage return encoding with HTML break tag

if(abc.indexOf("%0D%0A") > -1){
//Windows encodes returns as \r\n hex
abc=abc.replace("%0D%0A",replaceWith)
}
else if(abc.indexOf("%0A") > -1){
//Unix encodes returns as \n hex
abc=abc.replace("%0A",replaceWith)
}
else if(abc.indexOf("%0D") > -1){
//Macintosh encodes returns as \r hex
abc=abc.replace("%0D",replaceWith)
}

}
abc=unescape(abc)
document.getElementById('hidtextarea').value=abc;
}
   
function show_article(id){

arlength=document.getElementsByClassName('myart_popup');

for(i=0;i<arlength.length;i++){
if(document.getElementById(arlength[i].id))
 Effect.Fade(arlength[i].id,{duration:0.0});
 }
 Effect.Appear('articles_popup'+id);

}

function movepic(img_name,img_src) {
document.getElementById(img_name).src = img_src;
}