var maxCommentLen=2000;var emptyImagePath=null;var yellowStarImagePath=null;var greenStarImagePath=null;var imageList=new Array();var currentIndex=0;var handleYesOnComplete=function(isYesAllowedElem){if(document.getElementById(isYesAllowedElem)!=null&&document.getElementById(isYesAllowedElem).value=="true"){applyMask("reviewYesNoWarningPopup");
}else{displayReviewConfMsg();}};var handleNoOnComplete=function(isNoAllowedElem){if(document.getElementById(isNoAllowedElem)!=null&&document.getElementById(isNoAllowedElem).value=="true"){applyMask("reviewYesNoWarningPopup");}else{displayReviewConfMsg();}};var displayReviewConfMsg=function(){applyMask("reviewConfirmPopup");
return false;};var initYesNoAction=function(action,reviewId,isLoggedIn){if(isLoggedIn!="true"){if(action=="yes"){fdwToLoginOnYes(reviewId);}else{fdwToLoginOnNo(reviewId);}}else{if(action=="yes"){handleYesAction(reviewId,action);}else{handleNoAction(reviewId,action);}}return false;};var forwardToLoginPage=function(urlToFwdTo){window.location.href=urlToFwdTo;
};var hideShowReplyList=function(revId,shouldExpand){var divElem=document.getElementById(revId+"_replydiv");var linkElem=jQuery("#"+revId+"_cmtlink");var curLnkStyl=divElem.style.display;if(curLnkStyl==shouldExpand){return false;}if(curLnkStyl=="none"){linkElem.removeClass("comment-closed");linkElem.addClass("comment-open");
divElem.style.display="block";}else{linkElem.removeClass("comment-open");linkElem.addClass("comment-closed");divElem.style.display="none";}return false;};var showListingDeatilTab=function(tabName){var tabLinkElem=document.getElementById(tabName);if(tabLinkElem!=null){if(tabLinkElem.dispatchEvent){var clickevent=document.createEvent("MouseEvents");
clickevent.initEvent("click",true,true);tabLinkElem.dispatchEvent(clickevent);}else{if(tabLinkElem.fireEvent){tabLinkElem.fireEvent("onclick");}else{tabLinkElem.onclick();}}}};var trim=function(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"");};var charCounterById=function(commentTextId,commentCharTextId,commentLen,charsLeftText,thousandsDelimiter){charCounter(document.getElementById(commentTextId),commentCharTextId,commentLen,charsLeftText,thousandsDelimiter);
};var showHideCommentPopup=function(show,labelCharactersLeft){if(show){applyMask("comment");}else{hideMask();document.getElementById("noOfCharsInCommentTxt").innerHTML=maxCommentLen+labelCharactersLeft.replace("{0}","");document.getElementById("commentTextArea").value="";}};var showStars=function(show){if(show){var resourcePath=document.getElementById("resourcePath");
emptyImagePath=resourcePath.value+"/img/gray_star.gif";yellowStarImagePath=resourcePath.value+"/img/star-big.gif";greenStarImagePath=resourcePath.value+"/img/star-green.gif";}};var displayStars=function(imgElemName,num,imagePath){for(var i=1;i<=num;i++){var starElem=document.getElementById(imgElemName+i);
starElem.src=imagePath;}};var clearAllStars=function(imgElemName){for(var i=1;i<=5;i++){var starElem=document.getElementById(imgElemName+i);starElem.src=emptyImagePath;}};var handleOtherStarMouseOut=function(imgElemName){showStars(true);handleStarMouseOut(imgElemName,greenStarImagePath);};var handleOtherStarMouseOver=function(imgElem,imgElemName){showStars(true);
handleStarMouseOver(imgElem,imgElemName,greenStarImagePath);};var handleOtherStarClick=function(imgElem,imgElemName){showStars(true);handleStarClick(imgElem,imgElemName,greenStarImagePath);};var handleOverallStarMouseOut=function(imgElemName){showStars(true);handleStarMouseOut(imgElemName,yellowStarImagePath);
};var handleOverallStarMouseOver=function(imgElem,imgElemName){showStars(true);handleStarMouseOver(imgElem,imgElemName,yellowStarImagePath);};var handleOverallStarClick=function(imgElem,imgElemName){showStars(true);handleStarClick(imgElem,imgElemName,yellowStarImagePath);};var handleStarMouseOut=function(imgElemName,imagePath){var noOfStars=document.getElementById(imgElemName+"stars").value;
clearAllStars(imgElemName);displayStars(imgElemName,noOfStars,imagePath);};var handleStarMouseOver=function(imgElem,imgElemName,imagePath){var emlName=imgElem.id;var num=imgElem.id.charAt(imgElem.id.length-1);displayStars(imgElemName,num,imagePath);};var handleStarClick=function(imgElem,imgElemName,imagePath){var emlName=imgElem.id;
var num=imgElem.id.charAt(imgElem.id.length-1);var noOfStars=document.getElementById(imgElemName+"stars").value;clearAllStars(imgElemName);if(noOfStars!=num){displayStars(imgElemName,num,imagePath);document.getElementById(imgElemName+"stars").value=num;}else{document.getElementById(imgElemName+"stars").value=0;
}};function showGoldenStars(oStar,eStar,vStar,sStar){var resourcePath=document.getElementById("resourcePath");var yellowStarImagePath=resourcePath.value+"/img/star-big.gif";var greenStarImagePath=resourcePath.value+"/img/star-green.gif";if(oStar!=null||oStar!=0){document.getElementById("img_over_stars").value=oStar;
displayStars("img_over_",oStar,yellowStarImagePath);}if(eStar!=null||eStar!=0){document.getElementById("img_euse_stars").value=eStar;displayStars("img_euse_",eStar,greenStarImagePath);}if(vStar!=null||vStar!=0){document.getElementById("img_value_stars").value=vStar;displayStars("img_value_",vStar,greenStarImagePath);
}if(sStar!=null||sStar!=0){document.getElementById("img_supp_stars").value=sStar;displayStars("img_supp_",sStar,greenStarImagePath);}}function initYesNoForAReview(revId,type,isLoggedIn){applyMask(99);initYesNoActionForAReview(type,revId,isLoggedIn);}function initYesNoActionForAReview(action,reviewId,isLoggedIn){var f;
if(isLoggedIn!="true"){fdwToLogin();}else{if(action=="yes"){f="handleYesAction_"+reviewId;}else{f="handleNoAction_"+reviewId;}eval(f+'("'+reviewId+'", "'+action+'")');}return false;}function handleYesNoComplete(hasReview){hideMask();if(hasReview=="true"){applyMask("reviewYesNoWarningPopup");}else{displayReviewConfMsg();
}}function pickEnvironment(show,section,input,sel){document.getElementById(input).checked=true;var radios=document.getElementById(section).getElementsByTagName("input");document.getElementById(sel).value=input;for(e in radios){if(radios[e].id!=input){radios[e].checked=false;}}if(show=="yes"){document.getElementById(section).parentNode.nextSibling.style.display="block";
resetRadios(document.getElementById(section).parentNode.nextSibling);}else{if(show=="no"){document.getElementById(section).parentNode.nextSibling.style.display="none";resetRadios(document.getElementById(section).parentNode.nextSibling);if(document.getElementById(section).parentNode.nextSibling.nextSibling!=null){document.getElementById(section).parentNode.nextSibling.nextSibling.style.display="none";
resetRadios(document.getElementById(section).parentNode.nextSibling.nextSibling);}}}}function resetRadios(element){var radios=element.getElementsByTagName("input");for(a in radios){radios[a].checked=false;}}function isChecked(element){return element!=null&&element.checked;}
