
function baAppParseCountTotal(responseTxt){var resultOut="";var mainBlock=gebi("baAppCountBlock");var contents=gebi("baAppTotalCount");if(contents){contents.style.visibility='hidden';contents.innerHTML='';try{var resultList=JSON.parse(responseTxt);var itemsFound=resultList.EntityList.itemsFound;resultOut="<b class=\"small\">Total Solaris 10 Applications: </b> <span class=\"small\">"+__formatNumAddCommas(itemsFound)+"</span>";}catch(baAppParseResultError){resultOut="<i class=\"red\">Unable to retrieve application count.</i>";}
mainBlock.style.visibility='visible';contents.innerHTML=resultOut;contents.style.visibility='visible';}}
function baAppParseCountSparc(responseTxt){var resultOut="";var contents=gebi("baAppTotalCountSparc");if(contents!=null){contents.style.visibility='hidden';contents.innerHTML='';try{var resultList=JSON.parse(responseTxt);var itemsFound=resultList.EntityList.itemsFound;resultOut="<b class=\"small\">SPARC: </b> <span class=\"small\">"+__formatNumAddCommas(itemsFound)+"</span>";}catch(baAppParseResultError){resultOut="";}
contents.innerHTML=resultOut;contents.style.visibility='visible';}}
function baAppParseCountIntel(responseTxt){var resultOut="";var contents=gebi("baAppTotalCountX86");if(contents!=null){contents.style.visibility='hidden';contents.innerHTML='';try{var resultList=JSON.parse(responseTxt);var itemsFound=resultList.EntityList.itemsFound;resultOut="<b class=\"small\">x86/x64: </b> <span class=\"small\">"+__formatNumAddCommas(itemsFound)+"</span>";}catch(baAppParseResultError){resultOut="";}
contents.innerHTML=resultOut;contents.style.visibility='visible';}}
function baAppParseResult(responseTxt){var resultOut="";var resultList;var entityList;var itemsReturned;var itemsFound;var totalItems;var resultHeader="<b></b>";var itemNumber=0;var rowClass="grey1";var paginationString="";var contents=getDocObject(BA_APP_RESULT_BLOCK);contents.innerHTML="";try{resultList=JSON.parse(responseTxt);entityList=resultList.EntityList;itemsReturned=entityList.itemsReturned;itemsFound=entityList.itemsFound;totalItems=entityList.totalItems;itemNumber=currentStartNumber;if(itemsReturned>0){paginationString+=baAppResultsPagination(itemsReturned,itemsFound,currentStartNumber,BA_APP_RESULT_NUM_RETURNS);resultOut+=paginationString;resultOut+=getBaAppResultsTableHeader();for(var i=0;i<itemsReturned;i++){var entityType=entityList.items[i].entity.entityType;var entityName=__utf8_decode(entityList.items[i].entity.name);var fullTS=entityList.items[i].entity.updatedAt;var url=entityList.items[i].entity.url;var publisherName=__utf8_decode(entityList.items[i].entity.publisherName);var resourceID=entityList.items[i].entity.id;var publisherID=entityList.items[i].entity.publisherID;var description=entityList.items[i].entity.description;var urlString="";if(itemNumber%2==0){rowClass="grey1";}else{rowClass="grey2";}
itemNumber++;resultOut+="<tr class=\""+rowClass+"\">";resultOut+="<td class=\"small\"><span style=\"float:left;padding-bottom:3px;padding-right:2px;\">"+itemNumber+".</span> ";if(entityType=="software"){resultOut+="<a class=\"searchListName\" href=\"#\" onClick=\"return getAppDetails('"+resourceID+"');\">"+entityName+"</a>";}else{resultOut+="<a class=\"searchListName\" href=\"#"+entityList.items[i].entity.id+"\" onClick=\"return getPubDetails('"+entityList.items[i].entity.id+"');\">"+entityName+"</a>";}
resultOut+="</td>";resultOut+="<td class=\"small\" valign=\"top\">";if(entityType=="software"){resultOut+="<a href=\"#"+publisherID+"\" onClick=\"return getPubDetails('"+publisherID+"');\">"+publisherName+"</a>";}else if(entityType=="publisher"){if(description.length>0){resultOut+=__getListingDescription(description,75)+"... ";}
resultOut+=" <a href=\"#\" style=\"font-size:x-small;\" onClick=\"return getPubDetails('"+resourceID+"');\">(More Info)</a>";}
resultOut+="</td>";resultOut+="<td class=\"small\">";if(entityType=="software"){if(description.length>0){resultOut+=__getListingDescription(description)+"... <br />";}
resultOut+="<a href=\"#\" style=\"font-size:x-small;\" onClick=\"return getAppDetails('"+resourceID+"');\">(More Info)</a>";}else{resultOut+="<a href=\"#"+resourceID+"\" onClick=\"return submitAppQueryByPubID('"+resourceID+"');\">List Software <img src=\"/im/arrow_right_blue.gif\" width\"9\" height=\"9\" alt=\"List\" border=\"0\"></a>";}
resultOut+="</td>";resultOut+="</tr>";}
resultOut+=getBaAppResultsTableFooter();resultOut+=paginationString+"<br clear=\"all\"/>";}else{resultOut+="<tr><td colspan=\"3\">";resultOut+=getInformationBlock(BA_INFO_TYPE_ALERT,"There were no results from  your search.</p>");resultOut+="</td></tr>";}}catch(baAppParseResultError){if(resultOut==""){resultOut=resultHeader;}
resultOut+=getInformationBlock(BA_INFO_TYPE_ERROR,"There was an error with your request: "+baAppParseResultError);}
resultOut+=getOmnitureCode();contents.innerHTML=resultOut;contents.style.display="block";}
function baAppParseResultApps(responseTxt){var resultOut="";var resultList;var softwareList;var itemsReturned;var itemsFound;var totalItems;var resultHeader="<b></b>";var itemNumber=0;var rowClass="grey1";var paginationString="";var contents=getDocObject(BA_APP_RESULT_BLOCK);contents.innerHTML="";try{resultList=JSON.parse(responseTxt);softwareList=resultList.SoftwareList;itemsReturned=softwareList.itemsReturned;itemsFound=softwareList.itemsFound;totalItems=softwareList.totalItems;itemNumber=currentStartNumber;if(itemsReturned>0){paginationString+=baAppResultsPagination(itemsReturned,itemsFound,currentStartNumber,BA_APP_RESULT_NUM_RETURNS);resultOut+=paginationString;resultOut+=getBaAppResultsTableHeader();for(var i=0;i<itemsReturned;i++){var entity=softwareList.items[i].entity;var entityName=entity.name;var appDescription=entity.description;var fullTS=entity.updatedAt;var url=entity.url;var publisher=entity.publisher;var publisherName=publisher.name;var resourceID=entity.id;var publisherID=publisher.id;var urlString="";if(itemNumber%2==0){rowClass="grey1";}else{rowClass="grey2";}
itemNumber++;resultOut+="<tr class=\""+rowClass+"\">";resultOut+="<td class=\"small\"><span style=\"float:left;padding-bottom:3px;padding-right:2px;\">"+itemNumber+".</span> ";resultOut+="<a class=\"searchListName\" href=\"#\" onClick=\"return getAppDetails('"+resourceID+"');\">"+entityName+"</a>";resultOut+="</td>";resultOut+="<td class=\"small\">";resultOut+="<a href=\"#"+publisherID+"\" onClick=\"return getPubDetails('"+publisherID+"');\">"+publisherName+"</a>";resultOut+="</td>";resultOut+="<td class=\"small\">";if(appDescription.length>0){resultOut+=__getListingDescription(appDescription)+"... "+"<br /><a href=\"#\" style=\"font-size:x-small;\" onClick=\"return getAppDetails('"+resourceID+"');\">(More Info)</a>";}
resultOut+="</td>";resultOut+="</tr>";}
resultOut+=getBaAppResultsTableFooter();resultOut+=paginationString+"<br clear=\"all\"/>";}else{resultOut+="<tr><td colspan=\"3\">";resultOut+=getInformationBlock(BA_INFO_TYPE_ALERT,"There were no results from  your search.</p>");resultOut+="</td></tr>";}}catch(baAppParseResultError){if(resultOut==""){resultOut=resultHeader;}
resultOut+=getInformationBlock(BA_INFO_TYPE_ERROR,"There was an error with your request: "+baAppParseResultError);}
resultOut+=getOmnitureCode();if(is.ie6){contents.style.height="500px";}
contents.innerHTML=resultOut;contents.style.display="block";}
function baAppParseResultDetail(responseTxt){var resultOut="";var itemNumber=0;var contents=gebi(BA_APP_RES_DETAIL_WIN);if(!contents){resultOut=getInformationBlock(BA_INFO_TYPE_ERROR,"There has been an error getting the description block.");}else{contents.style.visibility='hidden';contents.innerHTML='';try{var resultList=JSON.parse(responseTxt);resultOut+=baBuildAppDetails(resultList);}catch(baAppParseResultError){resultOut=getInformationBlock(BA_INFO_TYPE_ERROR,"There was an error with your request. Please try again later."+"<br/><i class=\"small\">"+baAppParseResultError+"</i>");}}
resultOut+=getOmnitureCode();contents.innerHTML=resultOut;contents.style.visibility='';if(baBuildReviews&&baBuildReviewsURL!=""){makeHttpRequest(baBuildReviewsURL,'baAppParseResultDetailReview',false,getDocObject(BA_APP_DETAIL_REVIEWS_ID));baBuildReviews=false;baBuildReviewsURL="";}}
function baAppParseResultDetailReview(responseTxt){var resultOut="";var reviewsBlock=gebi(BA_APP_DETAIL_REVIEWS_ID);reviewsBlock.style.visibility='hidden';reviewsBlock.innerHTML='';try{var resultList=JSON.parse(responseTxt);var reviewList=resultList.ReviewList;var itemsReturned=reviewList.itemsReturned;var itemsFound=reviewList.itemsFound;var totalItems=reviewList.totalItems;if(itemsReturned>0){resultOut+="<ol>";for(var i=0;i<itemsReturned;i++){var entity=reviewList.items[i].entity;var reviewName=entity.name;var reviewDescription=entity.description;var screenName=entity.screenName;resultOut+="<li class=\"listPadBottom\">";resultOut+="<b class=\"small\">"+reviewName+"</b><br />";resultOut+="<span class=\"small\">"+reviewDescription+"</span>";if(screenName!=null&&screenName!=''){resultOut+="<br /><i class=\"small\">by "+screenName+"</i>";}
resultOut+="</li>";}
resultOut+="</ol>";}}catch(baAppParseResultError){if(resultOut==""){resultOut=resultHeader;}
resultOut+=getInformationBlock(BA_INFO_TYPE_ERROR,"There was an error with your request (reviews): "+baAppParseResultError);}
reviewsBlock.innerHTML=resultOut;reviewsBlock.style.visibility='';}
function baAppParseResultPubDetail(responseTxt){var resultOut="";var contents=gebi(BA_APP_RES_DETAIL_WIN);if(!contents){resultOut=getInformationBlock(BA_INFO_TYPE_ERROR,"There has been an error getting the publisher description block.");}else{contents.style.visibility='hidden';contents.innerHTML='';try{var resultList=JSON.parse(responseTxt);resultOut+=baBuildPubDetails(resultList);}catch(baAppParseResultError){resultOut=getInformationBlock(BA_INFO_TYPE_ERROR,"There was an error with your request. Please try again later."+"<br/><i class=\"small\">"+baAppParseResultError+"</i>");}}
resultOut+=getOmnitureCode();if(is.ie6){contents.style.height="500px";}
contents.innerHTML=resultOut;contents.style.visibility='';if(baBuildReviews&&baBuildReviewsURL!=""){makeHttpRequest(baBuildReviewsURL,'baAppParseResultDetailReview',false,getDocObject(BA_APP_DETAIL_REVIEWS_ID));baBuildReviews=false;baBuildReviewsURL="";}}
function baAppResultsPagination(itemsReturned,itemsFound,begin,maxNumReturns){var returnString="";var maxNumLinkPages=5;var totalCount=0;var beginIndex=0;var endIndex=0;var currentPage=0;var numberOfPages=0;var pageOverage=0;var loopStart=1;var loopCount=numberOfPages;var nextIndex;var prevIndex;var totalItemsReturned=parseInt(itemsReturned);var totalItemsFound=parseInt(itemsFound);if((totalItemsFound>totalItemsReturned&&totalItemsFound>maxNumReturns)||totalItemsReturned==totalItemsFound){totalCount=totalItemsFound;}else{totalCount=totalItemsReturned;}
beginIndex=parseInt(begin);endIndex=beginIndex+parseInt(maxNumReturns);numberOfPages=parseInt(totalCount/maxNumReturns);pageOverage=totalCount%maxNumReturns;if(beginIndex<maxNumReturns){currentPage=1;}else{currentPage=parseInt(begin/maxNumReturns)+1;}
if(endIndex>totalCount)endIndex=totalCount;if(pageOverage>0){numberOfPages+=1;}
if(numberOfPages>5){if((currentPage+5)>numberOfPages){loopStart=numberOfPages-4;loopCount=numberOfPages;}else if(currentPage==1){loopStart=1;loopCount=5;}else if(currentPage<=2){loopStart=1;loopCount=currentPage+3;}else{loopStart=currentPage-2;loopCount=currentPage+2;}}else{loopStart=1;loopCount=numberOfPages;}
returnString+='<!-- BEGIN G8 COMPONENT V.0 --><div class="g8 g8v0"><div class="g8w1">';returnString+='<h6 class="g8results">Page '+currentPage+' of '+numberOfPages+' ('+(beginIndex+1)+'-'+endIndex+' of '+totalCount+' results)</h6>';returnString+='<div class="g8pages">';returnString+='<ul>';if(beginIndex>(maxNumReturns-1)){prevIndex=beginIndex-maxNumReturns;returnString+='<li class="g8prev"><a href="#" onClick="submitAppQuery('+prevIndex+','+baAppCurrentPublisher+');return false;">Previous</a></li>';}else if(numberOfPages>1){returnString+='<li class="g8prev">Previous</li>';}
for(var tmpCount=loopStart;tmpCount<=loopCount;tmpCount++){var linkNum=parseInt(maxNumReturns*(tmpCount-1));if(numberOfPages>1){if(currentPage==1&&tmpCount==currentPage){returnString+='<li class="g8first g8current">'+tmpCount+'</li>';}else if(currentPage==tmpCount){returnString+='<li class="g8current">'+tmpCount+'</li>';}else if(tmpCount==loopStart){returnString+='<li class="g8first"><a href="#'+linkNum+'" onClick="submitAppQuery('+linkNum+','+baAppCurrentPublisher+');return false;">'+tmpCount+'</a></li>';}else{returnString+='<li><a href="#'+linkNum+'" onClick="submitAppQuery('+linkNum+','+baAppCurrentPublisher+');return false;">'+tmpCount+'</a></li>';}}}
if(endIndex<totalCount){nextIndex=endIndex-1;nextIndex++;returnString+='<li class="g8next"><a href="#" onClick="submitAppQuery('+nextIndex+','+baAppCurrentPublisher+');return false;">Next</a></li>';}else if(numberOfPages>1){returnString+='<li class="g8next">Next</li>';}
returnString+='</ul>';returnString+='</div></div></div><!-- END G8 COMPONENT V.0 -->';return returnString;}
function baAppsCloseDetailsWin(){var baAppResourceBackDiv=gebi('baAppResourceBack');if(baAppResourceBackDiv){document.body.removeChild(baAppResourceBackDiv);}
var baAppResourceBackie6bg=gebi('baAppResourceBackie6bg');if(baAppResourceBackie6bg){document.body.removeChild(baAppResourceBackie6bg);}
if(is.ie6){var fields=gebi('searchType');fields.style.visibility='';fields=gebi('searchTextType');fields.style.visibility='';}
return false;}
function baAppsDisplayDetailsWin(){var baAppDetailsView;var winClass=elem('div#baAppResDetailWin');var tmpContent="";baAppsCloseDetailsWin();winClass.style.visibility='hidden';winClass.centerOnScreen=function(){if(!this.viewportHeight){this.viewportHeight=(window.innerHeight)?window.innerHeight:document.documentElement.clientHeight;}
if(!this.viewportWidth){this.viewportWidth=(window.innerWidth)?window.innerWidth:document.documentElement.clientWidth;}
var thisHeight=this.offsetHeight;var thisWidth=this.offsetWidth;var distance=((this.viewportHeight/2)-(thisHeight/2))*.666;if(distance<0){distance=0;this.style.height=(this.viewportHeight-5)+'px';this.style.overflow='auto';}
if(thisWidth>this.viewportWidth){this.style.width=(this.viewportWidth-40)+'px';this.style.overflow='auto';}
this.style.marginTop=distance+"px";};winClass.style.visibility='';baAppDetailsView=elem('div#baAppResourceBack',{},winClass);if(is.ie6){var baAppResourceBackie6bg=elem('div#baAppResourceBackie6bg');document.body.appendChild(baAppResourceBackie6bg);}
document.body.appendChild(baAppDetailsView);if(is.ie6){var fields=gebi('searchType');fields.style.visibility='hidden';fields=gebi('searchTextType');fields.style.visibility='hidden';}
return winClass;}
function baBuildAppDetails(jsonRes){var returnDetails="";var tmpDetail="";try{var softwareList=jsonRes.SoftwareList;var softwareEntity=softwareList.items[0].entity;var softwareName=softwareEntity.name;var softwareURL=softwareEntity.url;var reviewCount=parseInt(softwareEntity.reviewCount);var ratingCount=parseInt(softwareEntity.ratingCount);var fAverageRating=parseFloat(softwareEntity.averageRating);var ratingPercentage=0;var publisher=softwareEntity.publisher;var publisherURL=publisher.url;var publisherLogo=false;var publisherLogoURL=publisher.imageURL;if(publisherLogoURL!=null&&publisherLogoURL!=""){publisherLogo=true;}
if(isNaN(reviewCount)){reviewCount=0;}
if(isNaN(fAverageRating)){ratingPercentage=0.0;}else{ratingPercentage=fAverageRating/5.0}
if(isNaN(ratingPercentage)){ratingPercentage=0.0;}
returnDetails=getBaDetailsHeader(BA_RESULTS_DETAIL_TYPE_SOFTWARE);if(publisherLogo){returnDetails+="<div align=\"right\"><a href=\""+publisherURL+"\" target=\"_new\">";returnDetails+="<img src=\""+publisherLogoURL+"\" class=\"baAppLogoResize\" alt=\"Company Logo\" border=\"0\">";returnDetails+="</a></div>";}
returnDetails+="<div class=\"pc2\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-left:5px;\">";returnDetails+="<tr><td class=\"tcell\">Software Name</td><td class=\"dcell\" colspan=\"3\">";returnDetails+=__utf8_decode(softwareName);if(softwareURL!=''){returnDetails+="&nbsp;&nbsp;&nbsp;<a href=\""+softwareURL+"\" target=\"_new\" class=\"small\">";returnDetails+="[Visit Publisher Page]";returnDetails+="</b></a>";}
returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";returnDetails+="<tr><td class=\"tcell\">By Publisher</td><td class=\"dcell\" colspan=\"3\">";returnDetails+="<a href=\"#"+publisher.id+"\"onClick=\"return getPubDetails('"+publisher.id+"',"+softwareEntity.id+");\"><b>"+__utf8_decode(publisher.name)+"</b></a>";returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";returnDetails+="<tr><td class=\"tcell\">Description</td><td class=\"dcell\" colspan=\"3\">"+__utf8_decode(softwareEntity.description)+"</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";returnDetails+="<tr><td class=\"tcell\">Average Rating</td><td class=\"dcell\" colspan=\"3\">";returnDetails+="<div class=\"baAppReviewBar\"><div style=\"width:"+(ratingPercentage*100)+"%\"></div></div>";returnDetails+="<i style=\"font-size:small;\">&nbsp;(Based on "+ratingCount+" ratings)</i>";returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";var versions=softwareEntity.versions;tmpDetail="";if(versions.length>0){tmpDetail+="<ul>";for(var i=0;i<versions.length;i++){tmpDetail+="<li>";tmpDetail+=versions[i].name+" ";tmpDetail+="</li>";}
tmpDetail+="</ul>";returnDetails+="<tr><td class=\"tcell\">Versions</td><td class=\"dcell\" colspan=\"3\">";returnDetails+=tmpDetail;returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";}
var platforms=softwareEntity.platforms;returnDetails+="<tr><td class=\"tcell\">Supported Platforms</td><td class=\"dcell\" colspan=\"3\">";tmpDetail="";if(platforms.length>0){tmpDetail+="<ul>";for(var i=0;i<platforms.length;i++){tmpDetail+="<li class=\"listPadBottom\">";tmpDetail+=platforms[i].name+" version "+platforms[i].version;if(platforms[i].softwareVersion){tmpDetail+="<br/><b class=\"small\">Version: </b> "+platforms[i].softwareVersion.name+"&nbsp;";}
if(platforms[i].url&&platforms[i].url!=''){tmpDetail+="&nbsp;<a class=\"small\" href=\""+platforms[i].url+"\" target=\"_new\">[info]</a>";}
if(platforms[i].downloadUrl&&platforms[i].downloadUrl!=''){tmpDetail+="&nbsp;<a class=\"small\" href=\""+platforms[i].downloadUrl+"\" target=\"_new\">[download]</a>";}else{tmpDetail+="&nbsp;<br/><a class=\"small\" href=\"";tmpDetail+=publisherURL;tmpDetail+="\" target=\"_new\">[download: Contact Publisher]</a>";}
tmpDetail+="</li>";}
tmpDetail+="</ul>";}
returnDetails+=tmpDetail;returnDetails+="</td></tr>";returnDetails+="<tr class=\"titlebar\"><th colspan=\"4\"><a name=\"Reviews\"></a><div>Reviews</div></th></tr>";returnDetails+="<tr><td class=\"tcell\">Reviews</td><td class=\"dcell\" colspan=\"3\">";if(reviewCount>0){baBuildReviews=true;baBuildReviewsURL=BA_APPS_QUERY_PROXY+"?appQueryType=queryTypeAppReviews&appID="+softwareEntity.id;returnDetails+="<span class=\"small\">There are currently '"+reviewCount+"' review(s).</span><hr class=\"light\" />";tmpDetail="<div id=\""+BA_APP_DETAIL_REVIEWS_ID+"\"></div>";returnDetails+=tmpDetail;}else{baBuildReviews=false;baBuildReviewsURL="";returnDetails+="<p class=\"small\">There are currently no reviews.</p>";}
returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";returnDetails+="</table></div>";}catch(baAppException){returnDetails=getBaDetailsHeader("Error")+getInformationBlock(BA_INFO_TYPE_ERROR,"Application Details Error."+"<br/><i class=\"small\">"+baAppException+"</i>");}
return returnDetails;}
function baBuildPubDetails(jsonRes){var returnDetails="";var tmpDetail="";try{var publisherList=jsonRes.PublisherList;var publisherEntity=publisherList.items[0].entity;var publisherID=publisherEntity.id;var publisherName=__utf8_decode(publisherEntity.name);var publisherURL=publisherEntity.url;var ratingCount=publisherEntity.ratingCount;var reviewCount=publisherEntity.reviewCount;var attributes=publisherEntity.attributes;var imageURL=publisherEntity.imageURL;var fAverageRating=parseFloat(publisherEntity.averageRating);var ratingPercentage=0;var fDisplayLogo=false;var fPartnerAdv=false;if(imageURL!=null&&imageURL!=""){fDisplayLogo=true;}
if(attributes!=null&&attributes.length>0){for(var i=0;i<attributes.length;i++){if(attributes[i].name!=null&&attributes[i].name=="SID"){if(attributes[i].value!=null&&attributes[i].value!=""){fPartnerAdv=true;}}}}
if(isNaN(reviewCount)){reviewCount=0;}
if(isNaN(fAverageRating)){ratingPercentage=0.0;}else{ratingPercentage=fAverageRating/5.0}
if(isNaN(ratingPercentage)){ratingPercentage=0.0;}
returnDetails=getBaDetailsHeader(BA_RESULTS_DETAIL_TYPE_PUBLISHER);if(fDisplayLogo||fPartnerAdv){if(fPartnerAdv){}
if(fDisplayLogo){returnDetails+="<div align=\"right\">";if(publisherURL!=''){returnDetails+="<a href=\""+publisherURL+"\" target=\"_new\">";}
returnDetails+="<img src=\""+imageURL+"\" class=\"baAppLogoResize\" alt=\"Company Logo\" border=\"0\">";if(publisherURL!=''){returnDetails+="</a>";}
returnDetails+="</div>";}}
returnDetails+="<div class=\"pc2\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-left:5px;\">";returnDetails+="<tr><td class=\"tcell\">Publisher Name</td><td class=\"dcell\" colspan=\"3\">";returnDetails+=publisherName+" ";if(publisherURL!=''){returnDetails+="&nbsp;&nbsp;&nbsp;<a href=\""+publisherURL+"\" target=\"_new\" class=\"small\">";returnDetails+="[Visit Publisher Page]";returnDetails+="</a>";}
returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";returnDetails+="<tr><td class=\"tcell\">Software by Publisher</td><td class=\"dcell\" colspan=\"3\">";returnDetails+="<a href=\"#\" onClick=\"submitAppQueryByPubID('"+publisherID+"');return false;\">List all software from this publisher <img src=\"/im/arrow_right_blue.gif\" width\"9\" height=\"9\" alt=\"List\" border=\"0\"></a>";returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";returnDetails+="<tr><td class=\"tcell\">Description</td><td class=\"dcell\" colspan=\"3\">"+__utf8_decode(publisherEntity.description)+"</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";returnDetails+="<tr><td class=\"tcell\">Average Rating</td><td class=\"dcell\" colspan=\"3\">";returnDetails+="<div class=\"baAppReviewBar\"><div style=\"width:"+(ratingPercentage*100)+"%\"></div></div>";returnDetails+="<i style=\"font-size:small;\">&nbsp;(Based on "+ratingCount+" ratings)</i><br />";returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";var resources=publisherEntity.resourceCollection;if(resources!=null&&resources.length>0){returnDetails+="<tr><td class=\"tcell\">Resources";returnDetails+="<br/><i style=\"font-style:normal;font-size:small;\">(Will open in new window)</i></td><td class=\"dcell\" colspan=\"3\">";tmpDetail="<ul>";for(var i=0;i<resources.length;i++){tmpDetail+="<li class=\"listPadBottom\">";tmpDetail+="<b class=\"small\"><a target=\"_new\" href=\""+resources[i].url+"\" class=\"small\">"+__utf8_decode(resources[i].name)+"</a></b>";tmpDetail+="<br/><span class=\"small\">"+__utf8_decode(resources[i].description)+"<br/>";tmpDetail+=" ("+resources[i].type+") </span> ";tmpDetail+="</li>";}
tmpDetail+="</ul>";returnDetails+=tmpDetail;returnDetails+="</td></tr>";}
returnDetails+="<tr class=\"titlebar\"><th colspan=\"4\"><a name=\"Reviews\"></a><div>Reviews</div></th></tr>";returnDetails+="<tr><td class=\"tcell\">Reviews</td><td class=\"dcell\" colspan=\"3\">";if(reviewCount>0){baBuildReviews=true;baBuildReviewsURL=BA_APPS_QUERY_PROXY+"?appQueryType=queryTypePubReviews&pubID="+publisherID;returnDetails+="<span class=\"small\">There are currently '"+reviewCount+"' review(s).</span><hr class=\"light\" />";tmpDetail="<div id=\""+BA_APP_DETAIL_REVIEWS_ID+"\"></div>";returnDetails+=tmpDetail;}else{baBuildReviews=false;baBuildReviewsURL="";returnDetails+="<p class=\"small\">There are currently no reviews.</p>";}
returnDetails+="</td></tr>";returnDetails+="<tr><td class=\"line\" colspan=\"4\"><hr /></td></tr>";returnDetails+="</table></div>";}catch(baAppException){returnDetails=getBaDetailsHeader("Error")+getInformationBlock(BA_INFO_TYPE_ERROR,"Publisher details error."+"<br/><i class=\"small\">"+baAppException+"</i>");}
return returnDetails;}
function displayInformationBlock(blockType,message,displayBlock){if(displayBlock==null)return;if(displayBlock.innerHTML!=null){displayBlock.innerHTML=getInformationBlock(blockType,message);}}
function getBaAppCounts(){var queryURL=BA_APPS_QUERY_PROXY+"?appQueryType=queryTypeCount";var parseCallBack="baAppParseResult";var queryAppend="";var sparcCountBlock=gebi("baAppTotalCountSparc");var x86CountBlock=gebi("baAppTotalCountX86");var totalCountBlock=gebi("baAppTotalCount");if(totalCountBlock!=null){makeHttpRequest(queryURL,'baAppParseCountTotal',false,totalCountBlock);}
if(sparcCountBlock!=null){makeHttpRequest(queryURL+"&platform=SPARC",'baAppParseCountSparc',false,sparcCountBlock);}
if(x86CountBlock!=null){makeHttpRequest(queryURL+"&platform=X86",'baAppParseCountIntel',false,x86CountBlock);}}
function getAppDetails(appID){var resultBlock=baAppsDisplayDetailsWin();var queryAppend="";var queryURL=BA_APPS_QUERY_PROXY+"?appQueryType=queryTypeAppDetails";var queryAppend="";var errorString="There was an error with your request. The ID of the resource was not available.";baAppReferringApp=null;if(appID!=null&&appID!=''){queryAppend+="&appID="+appID;queryURL+=queryAppend;resultBlock.style.visibility='';makeHttpRequest(queryURL,'baAppParseResultDetail',false,resultBlock);return false;}else{return false;}}
function getBaAppResultsTableHeader(){var headerDefinitions=BA_RESULTS_TABLE_HEADERS;var headerString="";if(headerDefinitions==null||headerDefinitions.length<1){headerDefinitions=new Array('Name,35%','Publisher,35%','Description,30%');}
headerString='<!-- BEGIN G1 FEATURED CONTENT COMPONENT, VARIATION 1 -->'+'<table border="0" cellpadding="0" cellspacing="0" class="dkgrey1" width="100%">'+'<tr><td>'+'<table border="0" cellpadding="3" cellspacing="1" width="100%" summary="Solaris Apps List" class="vatop">'+'<!-- BEGIN HEADINGS -->'+'<tr>';for(var i=0;i<headerDefinitions.length;i++){var tmpColHeader="    <td nowrap class=\"columncaption\" ";var labelWidth=headerDefinitions[i].split(',');if(labelWidth[1]&&labelWidth[1]!=null&&labelWidth[1]!=''){tmpColHeader+="width=\""+labelWidth[1]+"\"";}
tmpColHeader+=">"+labelWidth[0]+"</td>";headerString+=tmpColHeader;}
headerString+='</tr>'+'<!-- END HEADINGS -->'+'';return headerString;}
function getBaAppResultsTableFooter(){var footerString="";footerString='</table>'+'</td></tr>'+'</table>'+'';return footerString;}
function getBaDetailsHeader(detailsType){var returnHeaderString="";var nameString=""
returnHeaderString+='<div style="float:right;"><a href="javascript:baAppsCloseDetailsWin();" onClick="baAppsCloseDetailsWin(); return false;"><img src="/im/ic_close_win.gif" class="named" width="14" height="14" border="0" alt="" /> Close</a></div>';if(detailsType!=null){returnHeaderString+='<h2 style="color:#E76F00;">'+detailsType+' Details</h2>';if(baAppReferringApp!=null&&baAppReferringApp!=''){returnHeaderString+="<br /><a href=\"#"+baAppReferringApp+"\" onClick=\"return getAppDetails('"+baAppReferringApp+"');\">";returnHeaderString+="<< Return to Application Details</a>";}
returnHeaderString+='<hr class=\"light\"/>';}
return returnHeaderString;}
function getBaResultsTableHeaders(){return BA_RESULTS_TABLE_HEADERS;}
function getInformationBlock(blockType,message){returnString="";if(blockType==null||blockType==""){blockType=BA_INFO_TYPE_NOTIFICATION;}
if(blockType==BA_INFO_TYPE_ERROR){returnString+="<div class=\"g29 g29v0\"><div class=\"g29w1\"><div class=\"g29w2\">";}else if(blockType==BA_INFO_TYPE_ALERT){returnString+="<div class=\"g29 g29v2\"><div class=\"g29w1\"><div class=\"g29w2\">";}else if(blockType==BA_INFO_TYPE_SUCCESS){returnString+="<div class=\"g29 g29v3\"><div class=\"g29w1\"><div class=\"g29w2\">";}else{returnString+="<div class=\"g29 g29v1\"><div class=\"g29w1\"><div class=\"g29w2\">";}
returnString+="<p>"+message+"</p>";returnString+="</div></div></div>";return returnString;}
function getOmnitureCode(){return"<!--stopindex--><script language=\"JavaScript\" src=\"/share/omniture/s_code_remote.js\"></script><!--startindex-->";}
function getPubDetails(pubID,appID){var resultBlock=baAppsDisplayDetailsWin();var queryAppend="";var queryURL=BA_APPS_QUERY_PROXY+"?appQueryType=queryTypePubDetails";var queryAppend="";var errorString="There was an error with your request. The ID of the resource was not available.";if(appID==null){baAppReferringApp=null;}else{baAppReferringApp=appID;}
if(pubID!=null&&pubID!=''){queryAppend+="&pubID="+pubID;queryURL+=queryAppend;resultBlock.style.visibility='';makeHttpRequest(queryURL,'baAppParseResultPubDetail',false,resultBlock);}else{return;}}
function getPubAppInformation(){var resultBlock=baAppsDisplayDetailsWin();getPubAppInfoContent();}
function getPubAppInfoContent(){var resultOut="";var contents=gebi(BA_APP_RES_DETAIL_WIN);if(!contents){resultOut=getInformationBlock(BA_INFO_TYPE_ERROR,"There has been an error getting the Publish App description block.");}else{contents.style.visibility='hidden';contents.innerHTML='';resultOut=getBaDetailsHeader("Add Your Application");resultOut+="<div align=\"right\"><a href=\"http://www.sun.com/partners/library/\" target=\"_new\"><img src=\"/bigadmin/apps/images/logos/sunSoftwareLibrary.jpg\" width=\"400\" height=\"57\" border=\"0\"></a></div><br/>";resultOut+="<p>To promote your Solaris 10 applications, you need to add them to the Sun Software Library. One of the benefits of the Sun Software Library is that you can publish once and be promoted on multiple sites.</p>";resultOut+="<p>For example, applications that are published in the Sun Software Library and list Solaris 10 as a supported platform are also promoted on the Solaris 10 Applications Library.</p>";resultOut+="<p>The Sun Software Library is a great way to market directly to your Sun customers, keep Sun sales personnel updated, and get feedback from customers.</p>";resultOut+="<p>Go to the <a href=\"http://www.sun.com/partners/library/\" target=\"_new\" >Sun Software Library</a> and search for your company. Your information might have already been imported from other catalogs.</p>";resultOut+="<p>If you don't find your company listed, then login to add your company as a publisher, add your software, include details on platforms supported, and resources such as collateral, video clips, etc.</p>";resultOut+="<p>If you find your company information, click on the \"Request to be a content manager\" on the Publisher Details page for your company. Once approved via email within 24 hours, login and update/add your content. </p>";}
resultOut+=getOmnitureCode();if(is.ie6){contents.style.height="500px";}
contents.innerHTML=resultOut;contents.style.visibility='';}
function setBaResultsTableHeaders(newTableHeadersArray){BA_RESULTS_TABLE_HEADERS=newTableHeadersArray;}
function submitAppQuery(startNumber,pubID,checkKeywords){var resultBlock=getDocObject(BA_APP_RESULT_BLOCK);var queryAppend="";var queryURL=BA_APPS_QUERY_PROXY;var parseCallBack="baAppParseResult";var queryAppend="";var platformString="";var errorString="There was an error with your request.";var baAppSearchForm=getDocObject('ba_app_form');var validateKeywords=true;if(startNumber==null){startNumber=0;}
if(checkKeywords!=null){validateKeywords=checkKeywords;}
currentStartNumber=startNumber;resultBlock.style.display="block";queryAppend+=__addToQueryParams(queryAppend)+"start="+startNumber;queryAppend+=__addToQueryParams(queryAppend)+"count="+BA_APP_RESULT_NUM_RETURNS;var appKeywords=getFormObject('appKeywords',baAppSearchForm).value;var searchType=getFormObject('searchType',baAppSearchForm).value;var searchTextType=getFormObject('searchTextType',baAppSearchForm).value;var platformSparc=getFormObject('platformSparc',baAppSearchForm);var platformX86=getFormObject('platformX86',baAppSearchForm);if(searchType=="publisher"&&pubID==null){platformSparc.disabled=true;platformX86.disabled=true;setBaResultsTableHeaders(new Array('Publisher Name,35%','Description,45%','Software By Publisher,10%'));}else{platformSparc.disabled=false;platformX86.disabled=false;setBaResultsTableHeaders(new Array('Software Name,35%','By Publisher,35%','Description,30%'));}
if(platformSparc.checked!=true&&platformX86.checked!=true&&(searchType!="publisher"&&searchType!="both")){displayInformationBlock(BA_INFO_TYPE_ERROR,errorString+" You must choose a platform for your results.",resultBlock);return;}else if(platformSparc.checked==true&&platformX86.checked==true){platformString="both";}else if(platformSparc.checked==true){platformString="sparc";}else if(platformX86.checked==true){platformString="x86";}
if(pubID!=null){queryAppend+=__addToQueryParams(queryAppend)+"appQueryType=queryTypeSearchByPubID";queryAppend+=__addToQueryParams(queryAppend)+"pubID="+pubID;baAppCurrentPublisher=pubID;}else{queryAppend+=__addToQueryParams(queryAppend)+"searchType="+searchType;queryAppend+=__addToQueryParams(queryAppend)+"searchTextType="+searchTextType;baAppCurrentPublisher=null;if(platformString!=""){queryAppend+=__addToQueryParams(queryAppend)+"platform="+platformString;}
if(appKeywords!=null&&appKeywords!=''){queryAppend+=__addToQueryParams(queryAppend)+"appKeywords="+appKeywords;}else if(!validateKeywords&&(appKeywords==null||appKeywords=='')){return;}else if(validateKeywords){displayInformationBlock(BA_INFO_TYPE_ERROR," You must supply keywords to search for.",resultBlock);resultBlock.style.display="block";return;}}
if((escape(queryAppend).replace(/^\s+/g,''))!=""){queryURL+=queryAppend;makeHttpRequest(queryURL,parseCallBack,false,resultBlock);}else{displayInformationBlock(BA_INFO_TYPE_ERROR,errorString,resultBlock);}}
function submitAppQueryByPubID(pubID){baAppsCloseDetailsWin();if(pubID==null){baAppCurrentPublisher=null;}else{baCurrentPublisher=pubID;}
submitAppQuery(null,pubID);}
function submitAppQueryFromOnChange(){return submitAppQuery(null,null,false);}