/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function getmetaDetails(nid, tabname, tid, type) {
    var metadetails = new Array;
    var title_value;
    $.ajax({
        type: "POST",
        url: baseurl + "ajaxmetadetails",
        data: "nid=" + nid + "&tabname=" + tabname.toString().toUpperCase() + "&tid=" + tid + "&type=" + type,
        success: function (txt) {
         
            metadetails = txt.toString().split('@@@');
            title_value = metadetails[0];
            title_value = title_value.replace(/&reg;/g,'®');
            title_value = title_value.replace(/&trade;/g,'™');
            title_value = title_value.replace(/&#8211;/g,'–');
            //Change the title of the page
			document.title=title_value;
	   /*
       * Get All the Meta tags in the page
       */
            $('meta').each(function () {
                if ($(this).attr("name") == "keywords") {
                    //Change the content of the meta tag
                    $(this).attr('content', metadetails[1]);
                }
                if ($(this).attr("name") == "Description") {
                    //Change the content of the meta tag
                    $(this).attr('content', metadetails[2]);
                }

            });
        }

    });
}
