$(document).ready(function(){
    ownerActive();
  });

var d = document;

function ge(objID) {
    return d.getElementById(objID);
}

function sbVideoSelect(obj,ftype,fwidth,fheight,fsrc,fbgcolor,fflashVars,fbase,fname,fseamlesstabbing,fallowFullScreen,fswLiveConnect,fallowScriptAccess,fpluginspage){
	if(ge('ui-tabs-nav')){
		var ul = ge('ui-tabs-nav');
		var i=0;
		var objColl = ul.getElementsByTagName('li');
		for (var i = 0, j = objColl.length; i < j; i++) {
    		var arrObjClass = objColl[i].className='off';
    	}
    var onObj = ge(obj);
	onObj.className = 'ui-tabs-selected';
	
	var cont = ge('fragment-show');
	cont.innerHTML="";
	var tabChar=obj.charAt(3);
	
	var emb = document.createElement("embed");
	emb.setAttribute("type",ftype);
	emb.setAttribute("width",fwidth);
	emb.setAttribute("height",fheight);
	emb.setAttribute("src",fsrc);
	emb.setAttribute("bgcolor",fbgcolor);
	emb.setAttribute("flashVars",fflashVars);
	emb.setAttribute("base",fbase);
	emb.setAttribute("name",fname);
	emb.setAttribute("seamlesstabbing",fseamlesstabbing);
	emb.setAttribute("allowFullScreen",fallowFullScreen);
	emb.setAttribute("swLiveConnect",fswLiveConnect);
	emb.setAttribute("allowScriptAccess",fallowScriptAccess);
	emb.setAttribute("pluginspage",fpluginspage);
	cont.appendChild(emb);
	}
}



var ayqTitle = "Ask Your Question : not selected";
function ayqSelect(obj,ex){
	if(ge('ayqNav')){
		var ul = ge('ayqNav');
		var i=0;
		var objColl = ul.getElementsByTagName('li');
		for (var i = 0, j = objColl.length; i < j; i++) {
    		var arrObjClass = objColl[i].className='off';
    	}
    var onObj = ge(obj);
	onObj.parentNode.className = 'on';
	var cont = ge('ayq');
	cont.className = 'notEx';
	if(ex=='1'){
		cont.className = 'ex';
	}
	var name = ge('ayqName');
	var nameVal = obj.substr(3);
	name.innerHTML = nameVal;
	
	ayqTitle = 'Ask Your Question :'+nameVal;
	}
}

function ayqSubmit() {
	var textBox = ge('question');
	var iTitle = ge('ayqTitle');
       iTitle.value=ayqTitle;
	
	var qQuestion = textBox.value;
	var qEmail = ge('email').value;

	var sendMailURL = '/sendmail.jsp?title='+ayqTitle+'&question='+qQuestion+'&email='+qEmail;
	AJAXmakeReq(sendMailURL, STANDARD_callback, 'srchMoreId');
	
	textBox.value = 'MESSAGE SENT \r\rClick Here To Ask Another Question';
}

var STANDARD_callback = function(response, outputHere){
 	var responsetxt = response.responseText;
	//var outputDiv = ge(outputHere);
	//outputDiv.innerHTML = responsetxt;
}

function updateDimAllPage() {
   var center = document.getElementById('centerCol').offsetHeight;
   var left= document.getElementById('leftCol').offsetHeight;
   var large;
   if(center > left)
      large = parseInt(center); 
   else
      large = parseInt(left); 
   document.getElementById('leftCol').style.height=large+"px";
   document.getElementById('centerCol').style.height=large+"px";
}
function ownerActive(){
  var url = document.location.href;
  var indx = url.indexOf('profile');
  if(indx != -1){
    indx = indx+8;
    var ownernam = url.substring(indx);
    var prev = "head-"+ownernam;
    document.getElementById(prev).style.display="none";
    document.getElementById(ownernam).style.display="block";
    document.getElementById(ownernam).parentNode.onmouseout=null;
  }
}
function searchTarget(url, newWindow, newTarget) {
    // Set the target for the form
    document.bb_topform.action = url;
    if (newWindow) {
        document.bb_topform.target = '_blank';
    } else {
        document.bb_topform.target = '';
    }

    // Update the tabs classes to allow highlighting of the selected
    var tabList = ["searchTabLocal","searchTabWeb","searchTabImages","searchTabVideo"]
    for(var i=0;i<tabList.length;i++){
    document.getElementById(tabList[i]).className = '';
    }
    document.getElementById(newTarget).className = 'srchCatBg';

    return false;
}

function searchFooterTarget(url, newWindow, newTarget) {
    // Set the target for the form
    document.bb_topform1.action = url;
    if (newWindow) {
        document.bb_topform1.target = '_blank';
    } else {
        document.bb_topform1.target = '';
    }

    // Update the tabs classes to allow highlighting of the selected
    var tabList = ["searchFootTabLocal","searchFootTabWeb","searchFootTabImages","searchFootTabVideo"]
    for(var i=0;i<tabList.length;i++){
    document.getElementById(tabList[i]).className = '';
    }
    document.getElementById(newTarget).className = 'srchCatBg';

    return false;
}

function changeImg(obj,id){
  document.getElementById(obj).style.display="none";
  document.getElementById(id).style.display="block";
  }

function changeProfile(pg){
location.href="/start-up/profile/"+pg;
}

// TRRI JS Starts

var initialCommentBoxText = "";
var TRRI_SLIDE_SPEED = "5000"; //"slow";
var TRRI_CONTEXT_PATH = "";

var serverName = function()
{ 
    var name = location.protocol +"//"+ location.host + TRRI_CONTEXT_PATH; 
    return name; 
}

var getRating = function(score)
{
    var appID = escape(document.getElementById("vote_appID").value);
    var category = escape(document.getElementById("vote_category").value);
    var assetType = escape(document.getElementById("vote_assetType").value);
    var objectURI = escape(document.getElementById("vote_uri").value);

    document.getElementById('trriAddVoteError').innerHTML = '';

    var urlStr = serverName() + "/ajax/trri/addVote.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&score=" + score;
    startXhrRequest(urlStr, handleVoteResp, "text/plain");    
}

var handleVoteResp = function()
{
    if(xmlHttp.readyState == 4)
    {
        if(xmlHttp.status == 200)
        {
            document.getElementById("share_vote").innerHTML = xmlHttp.responseText;
        }
    }
}

var createXMLHttpRequest = function()
{
    if (window.ActiveXObject)
    {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest)
    {
        xmlHttp = new XMLHttpRequest();
    }
}
    
var startXhrRequest = function(urlStr, handler, type)
{
    createXMLHttpRequest();
    xmlHttp.onreadystatechange = handler;
    xmlHttp.open("GET", urlStr, true);
    xmlHttp.setRequestHeader("Accept", type); 
    xmlHttp.send(null);
}

var handleReportResp = function()
{
    //do nothing;
}

var readTRRICookie = function(name)
{
    //need implementation
}

var writeTRRICookie = function(name, value)
{
    //need implementation
}

var cmtStars =  new Array();
var storeRating = function(id)
{	
    var name = id.substring(0, id.length - 1);
    for(s=0;s<5;s++)
    {
        var a= name + s;
        cmtStars[s] = document.getElementById(a).className;
    }
}

var unrateCmt = function(obj)
{
    var id = obj.id;
    var name = id.substring(0, id.length - 1);
    var index = id.substring(id.length - 1,id.length);
    for(i=0;i<=index;i++)
    {
        var a= name + i;
        var img_obj = document.getElementById(a);
        img_obj.className=cmtStars[i];
    }
}

var hideComments = function(startCount, bool, sortType)
{
    var appID = escape(document.getElementById("cmmt_appID").value);
    var category = escape(document.getElementById("cmmt_category").value);
    var assetType = escape(document.getElementById("cmmt_assetType").value);
    var objectURI = escape(document.getElementById("cmmt_uri").value);

    if(true == bool)
    {
        document.getElementById("cmntOnOff").className="cmntOn";
    }
    else
    {
        document.getElementById("cmntOnOff").className="cmntOff";        
    }
    var hide = (true == bool) ? "1" : "0";
    var urlStr = serverName() + "/ajax/trri/hideComments.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&hideComments=" + hide + "&startCount=" + startCount + "&sortType=" + sortType;
    startXhrRequest(urlStr, handleCommentsResp, "text/plain");
}

var showComment = function(collapsID, arwID, reviewIndex)
{
    var cmntOpen = document.getElementById(arwID).className;  

    if (cmntOpen == "closecollapsed"){ 
        document.getElementById(collapsID).style.display = "block";  //show comment
        document.getElementById(arwID).className = "opencollapsed";
        document.images[arwID].src="http://www.aolcdn.com/ch_news/collapsearrow2.gif"; //update path to cdn
        document.getElementById("collapsHdrWarning_" + reviewIndex).style.display = "none";
    }
    else 
    {
        document.getElementById(collapsID).style.display = "none";
        document.getElementById(arwID).className = "closecollapsed";
        document.images[arwID].src="http://www.aolcdn.com/ch_news/collapsearrow1.gif";  //update path to cdn
        //alert ("closed " + showCommentFlag);
        document.getElementById("collapsHdrWarning_" + reviewIndex).style.display = "inline";
    }
}
    
var sortComments = function(obj)
{
    var appID = escape(document.getElementById("cmmt_appID").value);
    var category = escape(document.getElementById("cmmt_category").value);
    var assetType = escape(document.getElementById("cmmt_assetType").value);
    var objectURI = escape(document.getElementById("cmmt_uri").value);

    var sortType = obj.value;
    var urlStr = serverName() + "/ajax/trri/sortComments.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&sortType=" + sortType;
    startXhrRequest(urlStr, handleCommentsResp, "text/plain");
}

var mouseoverup = function()
{
    document.getElementById("rateup").className="rateup_on";
}

var mouseoutup = function()
{
    document.getElementById("rateup").className="rateup";
} 

var mouseoverdown = function()
{
    document.getElementById("ratedwn").className="ratedwn_on";
}

var mouseoutdown = function()
{
    document.getElementById("ratedwn").className="ratedwn";
}

var rptFont = 0;
var setfontColor = function(id)
{
    var colorTimer = 100;
    var fontShades =  new Array('#000000', '#333333', '#666666', '#999999');
    var element = document.getElementById(id);
    if(rptFont<4)
    {
	element.style.color = fontShades[rptFont];
	setTimeout("setfontColor('"+id+"');", colorTimer);
	element.style.textDecoration = "none";
	rptFont++;
    }
    else
	rptFont = 0;
    
}

var addCommentHvr = function()
{
    document.getElementById("cmtAdd").className="cmntAddHvr";
}

var cmntOffHvr = function()
{
  if(document.getElementById("cmntOnOff").className == "cmntOff")
       document.getElementById("cmntOnOff").className="cmntOffHvr";
}

var addCommentOut = function()
{
    document.getElementById("cmtAdd").className="cmntAdd";
}

var cmntOffOut = function()
{
    if(document.getElementById("cmntOnOff").className == "cmntOffHvr")
	document.getElementById("cmntOnOff").className="cmntOff";
}

var postBtnHvr = function()
{
    document.getElementById("AddCmmtButton").className="postBtnHvr";
}

var postBtnOut = function()
{
    document.getElementById("AddCmmtButton").className="postBtn";
}

var cancelBtnHvr = function()
{
    document.getElementById("cancelBtn").className="cancelBtnHvr";
}

var cancelBtnOut = function()
{
    document.getElementById("cancelBtn").className="cancelBtn";
}

var commentBoxClick = function(obj, lu)
{
    if(obj.value == 'Type your own comment here')
    {
        obj.value = '';
        obj.className =  'clickcmmntTxtArea';
    }

    if(_sns_isLoggedIn == 1)
    {
        //do nothing
    }
    else
    {
        if(is_IE)
		toggleLayer('anchorImg', 'loginLayer', obj.offsetParent.offsetLeft+obj.offsetLeft, obj.offsetParent.offsetTop+obj.offsetTop+234, lu);	
	else
		toggleLayer('anchorImg', 'loginLayer', obj.offsetLeft, obj.offsetTop, lu);
    }
}

var addComment = function(obj, captchaReference, lu)
{
    if(_sns_isLoggedIn == 1)
    {
        var appID = escape(document.getElementById("cmmt_appID").value);
        var category = escape(document.getElementById("cmmt_category").value);
        var assetType = escape(document.getElementById("cmmt_assetType").value);
        var objectURI = escape(document.getElementById("cmmt_uri").value);

        var captchaCode = document.getElementById("capchaCodeArea").value;
        var text = escape(document.getElementById("addCommentHere").value);
        var urlStr = serverName() + "/ajax/trri/addComment.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&startCount=0&text=" + text + "&captchaReference=" + captchaReference + "&captchaCode=" + captchaCode;        
        try
        {
            $("#capchaCode").slideUp(TRRI_SLIDE_SPEED);
        }
        catch(e) {} //do nothing                            
        startXhrRequest(urlStr, handleAddCommentResp, "text/plain");
    }
    else
    {
        toggleLayer('anchorImg', 'loginLayer', obj.offsetLeft, obj.offsetTop, lu);
    }
    return false;    
}

var reportComment = function(obj, commentID, lu)
{
    if(_sns_isLoggedIn == 1)
    {    
        var appID = escape(document.getElementById("cmmt_appID").value);
        var category = escape(document.getElementById("cmmt_category").value);
        var assetType = escape(document.getElementById("cmmt_assetType").value);
        var objectURI = escape(document.getElementById("cmmt_uri").value);
        var commentID = escape(commentID);

        obj.innerHTML = "REPORTED!";
        obj.href = "";
        obj.style.cursor = "default";
        obj.onclick = null;
        setfontColor(obj.id);
        var urlStr = serverName() + "/ajax/trri/reportComment.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&commentID=" + commentID;
        startXhrRequest(urlStr, handleReportResp, "text/plain");
    }
    else
    {
        toggleLayer('anchorImg', 'loginLayer', obj.offsetLeft, obj.offsetTop, lu);
    }        
    return false;    
}

var submitRating = function(obj, rating, reviewIndex, reviewID, callbackID, lu)
{
    if(_sns_isLoggedIn == 1)
    {        
        for(var i = 0; i < 5; i++)
        {
            var star = document.getElementById("star" + reviewIndex + "_" + i)
            star.onclick = null;
            star.onmouseover = null;
            star.className += " arwCursor";
        }

        var appID = escape(document.getElementById("cmmt_appID").value);
        var category = escape(document.getElementById("cmmt_category").value);
        var assetType = escape(document.getElementById("cmmt_assetType").value);
        var objectURI = escape(document.getElementById("cmmt_uri").value);

        var objId = obj.id;
	var rate_id = "cmt_rate"+reviewIndex;
        var urlStr = serverName() + "/ajax/trri/rateComment.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&rating=" + rating + "&reviewIndex=" + reviewIndex + "&reviewID=" + reviewID + "&callbackID=" + callbackID;
        startXhrRequest(urlStr, handleCallbackResp, "text/plain");
    }
    else
    {
        if(is_IE)
	        toggleLayer('anchorImg', 'loginLayer', obj.offsetParent.offsetLeft+obj.offsetLeft+182, obj.offsetParent.offsetTop+obj.offsetTop+211+50, lu);
	else
		toggleLayer('anchorImg', 'loginLayer', obj.offsetLeft, obj.offsetTop, lu);
    }
    return false;    
}

var handleSubmitCommentResp = function()
{
    if(xmlHttp.readyState == 4)
    {
        if(xmlHttp.status == 200)
        {
            document.getElementById("addcmnt").innerHTML = xmlHttp.responseText;
            try
            {
                $("#capchaCode").slideDown(TRRI_SLIDE_SPEED);
            }
            catch(e) {} //do nothing            
        }
    }
}

var handleAddCommentResp = function()
{
    if(xmlHttp.readyState == 4)
    {
        if(xmlHttp.status == 200)
        {
            document.getElementById("addcmnt").innerHTML = xmlHttp.responseText;
            try
            {
                $("#capchaCode").slideDown(TRRI_SLIDE_SPEED);
                $("#pstdCmt").slideDown(TRRI_SLIDE_SPEED);
            }
            catch(e) {} //do nothing
        }
    }
}

var newComment = function()
{
    var appID = escape(document.getElementById("cmmt_appID").value);
    var category = escape(document.getElementById("cmmt_category").value);
    var assetType = escape(document.getElementById("cmmt_assetType").value);
    var objectURI = escape(document.getElementById("cmmt_uri").value);

    var urlStr = serverName() + "/ajax/trri/newComment.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID;
    try
    {
        $("#pstdCmt").slideUp(TRRI_SLIDE_SPEED);
    }
    catch(e) {} //do nothing      
    startXhrRequest(urlStr, handleAddCommentResp, "text/plain");    
}

var editComment = function()
{
    var appID = escape(document.getElementById("cmmt_appID").value);
    var category = escape(document.getElementById("cmmt_category").value);
    var assetType = escape(document.getElementById("cmmt_assetType").value);
    var objectURI = escape(document.getElementById("cmmt_uri").value);
    var text = escape(document.getElementById("addCommentHere").value);

    var urlStr = serverName() + "/ajax/trri/newComment.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&posted=edit&text=" + text;
    try
    {
        $("#pstdCmt").slideUp(TRRI_SLIDE_SPEED);
    }
    catch(e) {} //do nothing      
    startXhrRequest(urlStr, handleAddCommentResp, "text/plain");    
}

var displayComments = function(startCount, sortType)
{
    var appID = escape(document.getElementById("cmmt_appID").value);
    var category = escape(document.getElementById("cmmt_category").value);
    var assetType = escape(document.getElementById("cmmt_assetType").value);
    var objectURI = escape(document.getElementById("cmmt_uri").value);

    if(startCount < 0) {startCount = 0; }
    var urlStr = serverName() + "/ajax/trri/comments.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&startCount=" + startCount + "&sortType=" + sortType;
    try
    {
        $("#pstdCmt").slideUp(TRRI_SLIDE_SPEED);
    }
    catch(e) {} //do nothing      
    startXhrRequest(urlStr, handleCommentsResp, "text/plain");
}

var handleCallbackResp = function()
{
    if(xmlHttp.readyState == 4)
    {
        if(xmlHttp.status == 200)
        {
            var responseText = xmlHttp.responseText;
            if(responseText.length > 0)
            {
                eval(responseText);
            }
        }
    }
}

var addCommentKeypress = function(e, obj, captchaReference, lu, startCount)
{
    var characterCode = "";
    if(e && e.which) { characterCode = e.which; }
    else { characterCode = event.keyCode; }
    if(characterCode == 13)
    {
        postComment(obj, captchaReference, lu, startCount);
    }
    return false;
} 

var postComment = function(obj, captchaReference, lu, startCount)
{
    if(_sns_isLoggedIn == 1)
    {
        var appID = escape(document.getElementById("cmmt_appID").value);
        var category = escape(document.getElementById("cmmt_category").value);
        var assetType = escape(document.getElementById("cmmt_assetType").value);
        var objectURI = escape(document.getElementById("cmmt_uri").value);

        var captchaCode = document.getElementById("capchaCodeArea").value;
        if(captchaCode.length > 0)
        {
            var text = escape(document.getElementById("addCommentHere").value);
            var urlStr = serverName() + "/ajax/trri/addComment.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&startCount="+startCount+"&text=" + text + "&captchaReference=" + captchaReference + "&captchaCode=" + captchaCode;        
            try
            {
                $("#capchaCode").slideUp(TRRI_SLIDE_SPEED);
            }
            catch(e) {} //do nothing                            
            startXhrRequest(urlStr, handleCommentsResp, "text/plain");
        }
    }
    else
    {
        toggleLayer('anchorImg', 'loginLayer', obj.offsetLeft, obj.offsetTop, lu);
    }
    return false;    
}

var submitComment = function(obj, lu, startCount)
{
    if(_sns_isLoggedIn == 1)
    {
        var appID = escape(document.getElementById("cmmt_appID").value);
        var category = escape(document.getElementById("cmmt_category").value);
        var assetType = escape(document.getElementById("cmmt_assetType").value);
        var objectURI = escape(document.getElementById("cmmt_uri").value);

        var text = document.getElementById("addCommentHere").value;

        if((text.length > 0) && (text != initialCommentBoxText))
        {        
            var escapedText = escape(text);
            var urlStr = serverName() + "/ajax/trri/submitComment.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&startCount=" + startCount + "&text=" + escapedText;
            try
            {
                $("#capchaCode").slideUp(TRRI_SLIDE_SPEED);
            }
            catch(e) {} //do nothing      
            startXhrRequest(urlStr, handleSubmitCommentResp, "text/plain");

        }
    }
    else
    {
        toggleLayer('anchorImg', 'loginLayer', obj.offsetLeft, obj.offsetTop, lu);
    }
    return false;    
}

var rateCmt = function(obj, collapsed)
{
    var id = obj.id;
    var name = id.substring(0, id.length - 1);
    var index = id.substring(id.length - 1,id.length)
    for(i=0;i<=index;i++)
    {
        var a= name + i;
        var img_obj = document.getElementById(a);
        if(collapsed){img_obj.className='pinkstarGray';}
	else {img_obj.className='pinkstar';}
    }
}

var addyourComment = function(startCount, bool, sortType)
{
	if(bool == false)
		hideComments (startCount, bool, sortType, true);
	 else 
		window.location = '#commentBottom';
}

var  handleCommentsResp = function()
{
    if(xmlHttp.readyState == 4)
    {
        if(xmlHttp.status == 200)
        {
            document.getElementById("cmmntBox").innerHTML = xmlHttp.responseText;
            try
            {
                $("#pstdCmt").slideDown(TRRI_SLIDE_SPEED);
                $("#capchaCode").slideDown(TRRI_SLIDE_SPEED);
            }
            catch(e) {} //do nothing 
            var response = xmlHttp.responseText;
	    if(response.indexOf("commentCountStart") != -1 && response.indexOf("commentCountEnd") != -1)
	    {
		var startcountIdx = response.indexOf("commentCountStart");
                var endcountIdx = response.indexOf("commentCountEnd");
		var totalComments = response.substring(parseInt(startcountIdx)+17,parseInt(endcountIdx));
		document.getElementById("ArtCmtCnt").innerHTML = totalComments;
	    }  
        }
    }
}

var hideComments = function(startCount, bool, sortType, addCmnt)
{
    var appID = escape(document.getElementById("cmmt_appID").value);
    var category = escape(document.getElementById("cmmt_category").value);
    var assetType = escape(document.getElementById("cmmt_assetType").value);
    var objectURI = escape(document.getElementById("cmmt_uri").value);

    if(true == bool)
    {
        document.getElementById("cmntOnOff").className="cmntOn";
    }
    else
    {
        document.getElementById("cmntOnOff").className="cmntOff";        
    }
    var hide = (true == bool) ? "true" : "false";
    var urlStr = serverName() + "/ajax/trri/hideComments.jsp?trriObjectURI=" + objectURI + "&trriCategory=" + category + "&trriAssetType=" + assetType + "&trriAppID=" + appID + "&hideComments=" + hide + "&startCount=" + startCount + "&sortType=" + sortType;
    if(bool == false && addCmnt == true)
	startXhrRequest(urlStr, handleAddYourCommentsResp, "text/plain");
    else
	startXhrRequest(urlStr, handleCommentsResp, "text/plain");
}

var  handleAddYourCommentsResp = function()
{
    if(xmlHttp.readyState == 4)
    {
        if(xmlHttp.status == 200)
        {
            document.getElementById("cmmntBox").innerHTML = xmlHttp.responseText;
	    window.location = '#commentBottom';
        }
    }
}

var loadCommentBox = function()
{
  var obj = document.addComment.addCommentHere;
  
  if(obj.value != 'Type your own comment here')
	obj.className =  'clickcmmntTxtArea';
}

function maxlength(obj, max)
{
    if (obj.value.length > max)
{
        obj.value = obj.value.substr(0, max);
    }
}
/* TRRI JS Ends */
