        function redirectPage(id)
        {
               window.location = "../stories/view/" + id;
        }
	
	function redirectAnswer(id)
        {
               window.location = "./answers/add/" + id;
        }
	
	//Redirect to URL including www
	function fixurl(extendedUrl)
        {
              window.location = "http://www.lifeyoumentary.com/" + extendedUrl;
        }
        
        //Update MCE Box with Links
        
       function updateMCE(title,url){
              if (document.forms.CommentAddForm.CommentName.value == ""){
                     document.forms.CommentAddForm.CommentName.value = "Recommendation:";
              }
              tinyMCE.execCommand('mceInsertContent',false,'<br/><a href="http://www.lifeyoumentary.com/answers/add/'+url+'">'+title+'</a>');
              return false;
        }

        //Toggle data containing div during ajax load
        function hideData(){
              //Keep existing div height when applying loading image for smoother transition
              if (jQuery("#suggestDiv").height() > 70){
                     padding = ((jQuery("#suggestDiv").height() - 70)/2);
                     jQuery("#loadingDiv").height(jQuery("#suggestDiv").height()-padding);
                     jQuery("#loadingDiv").css({paddingTop: padding });
              } else{
                     jQuery("#loadingDiv").height(167);
                     jQuery("#loadingDiv").css({paddingTop: "50px" });
              }
              
              jQuery("#suggestDiv").css({display: "none"});
        }
        
        function showData(){
              jQuery("#suggestDiv").css({display: "block"});
              //Question Suggestions Hover
              
        }
        
        
        
        
        jQuery(document).ready(function(){

            
            //Left Menu Mouse Overs
            jQuery(".subOptionBox").hover(function () {
                jQuery(this).css({ backgroundColor:"#e5e5e5"});
                //jQuery(this).find(":nth-child(1)").css({ color:"#FFFFFF"});
            }, function () {
                jQuery(this).css({ backgroundColor:"#FFFFFF", color:"#063791" });
                jQuery(this).find(":nth-child(1)").css({ color:"#063791"});
            });
            
            //Left Menu Mouse Overs
            jQuery("#suggestToggle").hover(function () {
                jQuery(this).css({ color:"#dcd0b9",cursor:"pointer"});
                //jQuery(this).find(":nth-child(1)").css({ color:"#FFFFFF"});
            }, function () {
                jQuery(this).css({ color:"#063791" });
            });
            
            
            //Adjustment to float footer to bottom always
            if (jQuery("body").height() < window.innerHeight){
                     fixHeight = jQuery(".mainBox").height() + (window.innerHeight - jQuery("body").height());
                     jQuery(".mainBox").height(fixHeight);
            }
            
            //Top Questions Answer Show
            jQuery(".rTResultOwner").hover(function () {
                jQuery(this).css({color: "#0066FF"});
            }, function () {
		jQuery(this).css({color: "#000"});
            });
            
            //Ajax Question Results
            jQuery(".questionResults").hover(function(){
                     jQuery(this).css({ color:"#0066FF",cursor:"pointer"});
            },function(){
                     jQuery(this).css({ color:"#000" });
            });
            
            jQuery(".rTResult").hover(function () {
                jQuery(this).css({color: "#0066FF"});
                
            }, function () {
		jQuery(this).css({color: "#000"});
            });
            
            jQuery(".questionSearch").hover(function () {
                jQuery(this).find(":nth-child(1)").css({ display: "block"});
                jQuery(this).css({color:"#0066FF"});
            }, function () {
                jQuery(this).find(":nth-child(1)").css({ display: "none"});
                jQuery(this).css({color:"#000"});
            });
            
            
            
            
            //Suggestions Toggle
            jQuery("#suggestToggle").click(function () {
                     jQuery("#suggest").toggle();
                });
            
            
            //Questions Hover link color fix
            
            jQuery(".answersTableOddTR").hover(function () {
		jQuery(this).css({backgroundColor: "#063791",color: "#FFF"});
                jQuery(this).find(":nth-child(2)").find(":nth-child(1)").css({ color: "#FFF"});
                jQuery(this).find(":nth-child(2)").find(":nth-child(2)").css({ color: "#FFF"});
            }, function () {
		jQuery(this).css({backgroundColor: "#dfe3f8",color: "#000"});
                jQuery(this).find(":nth-child(2)").find(":nth-child(1)").css({ color: "#000"});
                jQuery(this).find(":nth-child(2)").find(":nth-child(2)").css({ color: "#000"});
            });
            
            
            jQuery(".answersTableEvenTR").hover(function () {
		jQuery(this).css({backgroundColor: "#063791",color: "#FFF"});
                jQuery(this).find(":nth-child(2)").find(":nth-child(1)").css({ color: "#FFF"});
                jQuery(this).find(":nth-child(2)").find(":nth-child(2)").css({ color: "#FFF"});
            }, function () {
		jQuery(this).css({backgroundColor: "#FFF",color: "#000"});
                jQuery(this).find(":nth-child(2)").find(":nth-child(1)").css({ color: "#000"});
                jQuery(this).find(":nth-child(2)").find(":nth-child(2)").css({ color: "#000"});
            });
            
            
            //Edit/Delete Answers hover link color fix
            jQuery(".answersTableOddTR").hover(function () {
                jQuery(this).find(":nth-child(4)").find(":nth-child(1)").css({ color: "#FFF"});
                jQuery(this).find(":nth-child(4)").find(":nth-child(2)").css({ color: "#FFF"});
            }, function () {
                jQuery(this).find(":nth-child(4)").find(":nth-child(1)").css({ color: "#000"});
                jQuery(this).find(":nth-child(4)").find(":nth-child(2)").css({ color: "#000"});
            });
            
            
            jQuery(".answersTableEvenTR").hover(function () {
                jQuery(this).find(":nth-child(4)").find(":nth-child(1)").css({ color: "#FFF"});
                jQuery(this).find(":nth-child(4)").find(":nth-child(2)").css({ color: "#FFF"});
            }, function () {
                jQuery(this).find(":nth-child(4)").find(":nth-child(1)").css({ color: "#000"});
                jQuery(this).find(":nth-child(4)").find(":nth-child(2)").css({ color: "#000"});
            });
            
            jQuery(".answerActions").hover(function(){
                jQuery(this).css({color: "#0066FF"});
            }, function(){
                jQuery(this).css({color: "#FFF"});
            });
            
            
        });
