function showtop(){document.write('<div style="text-align:center;margin-top:6px;"><span style="padding:9px;font-size:1.4em;font-weight:normal;color:#313131;"><a href="/submit.html" title="FREE listing your business" rel="nofollow">FREE listing your business Online</a><br /><a href="/submit.html" title="FREE listing your business" rel="nofollow">Company Profile, Products, TradeLeads</a></span></div></div>');document.write('<div class="toptext"><ul><li><a href="http://twitter.com/home?status='+encodeURIComponent(document.URL+' '+document.title)+'" title="Share to Twitter" rel="nofollow">Share to Twitter</a></li><li><a href="http://www.google.com/bookmarks/mark?op=edit&bkmk='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'" title="Share to Google Bookmarts" rel="nofollow">Share to Google</a></li><li><a href="http://www.facebook.com/sharer.php?u='+encodeURIComponent(document.URL)+'&t='+encodeURIComponent(document.title)+'" title="Share to Facebook" rel="nofollow">Share to Facebook</a></li><li><a href="http://www.delicious.com/post?url='+encodeURIComponent(document.URL)+'&title='+encodeURIComponent(document.title)+'" title="Share to del.icio.us" rel="nofollow">Share to Delicious</a></li></ul>');}
function showtoplink(){document.write('<a href="http://www.amazon.com/?tag=tradepad-en-20" rel="nofollow"><u>Shop Now and Save at Amazon.com!</u></a>');}
function showlink(){document.writeln('[<a href="/report.html" title="Report Abuse" rel="nofollow">Report Abuse</a>] [<a href="/claim.html.html" title="Claim it" rel="nofollow">Claim This</a>] [Submit: <a href="/submit.html" title="Submit Company" rel="nofollow">Company</a> <a href="/trade-submit.html" title="Post Trade Leads" rel="nofollow">TradeLeads</a> <a href="/product-submit.html" title="Submit Products" rel="nofollow">Products</a>]');}
function showleft(){document.writeln('<script type="text/javascript"><!--');document.writeln('google_ad_client = "pub-1012989206850949";');document.writeln('/* 336x280 */');document.writeln('google_ad_slot = "4737487676";');document.writeln('google_ad_width = 336;');document.writeln('google_ad_height = 280;');document.writeln('//-->');document.writeln('</script>');document.writeln('<script type="text/javascript"');document.writeln('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');document.writeln('</script>');}
function showlist(){document.writeln('<script type="text/javascript"><!--');document.writeln('google_ad_client = "pub-1012989206850949";');document.writeln('/* 728x90 */');document.writeln('google_ad_slot = "2394732008";');document.writeln('google_ad_width = 728;');document.writeln('google_ad_height = 90;');document.writeln('//-->');document.writeln('</script>');document.writeln('<script type="text/javascript"');document.writeln('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');document.writeln('</script>');}
function showblink(keyword){document.writeln('<div class="amazonb"><a href="http://www.amazon.com/gp/search?ie=UTF8&keywords='+keyword+'&tag=tradepad-en-20&index=blended" rel="nofollow">Buy now on sale at Amazon.com</a></div>');}
function showtip(tip){var ajax=document.getElementById("ajax");ajax.innerHTML="<span style=\"color:#0000ff;\">"+tip+"</span>";if(tip!='')alert(tip);return true;}
function showtipb(tip){var commform=document.getElementById("commform");commform.innerHTML="<span style=\"color:#0000ff;\">"+tip+"</span>";return true;}
function checkusername(){var username=document.getElementById("username");if(!isLengthBetween(username.value,4,24)){showtip("Your name should be 4~24 letters in length");return false;}return true;}
function checkrating(){var rating=document.getElementById("rating");if(rating.value>5||rating.value<1){showtip("Invalid rating; ");return false;}return true;}
function checkcomment(){var comment=document.getElementById("comment");if(!isLengthBetween(comment.value,18,1024)){showtip("Comment should be 18~1024 letters in length");return false;}return true;}
function _submit(cid){var comment=document.getElementById("comment");var username=document.getElementById("username");var rating=document.getElementById("rating");isExist=trim(sendRequest("/ajax.php?cid="+encodeURIComponent(cid)+"&username="+encodeURIComponent(username.value)+"&rating="+encodeURIComponent(rating.value)+"&comment="+encodeURIComponent(comment.value)));if(isExist=="true"){showtip("we have received your review, and it would be checked in 24 hours.");showtipb("");return true;}if(isExist=="resubmit"){showtip("we have received your review, and it would be checked in 24 hours.");showtipb("");return true;}showtip(isExist);return false;}
function _comment(cid){if(!checkusername())return false;if(!checkrating())return false;if(!checkcomment())return false;if(!_submit(cid))return false;return true;}
function isLengthBetween(value,minLength,maxLength){value=trim(value);if(maxLength>0)return(value.replace(/[^\x00-\xff]/g,"**").length>(minLength-1)&&value.replace(/[^\x00-\xff]/g,"**").length<(maxLength+1));else return(value.replace(/[^\x00-\xff]/g,"**").length>(minLength-1));}
function trim(value){if(value.length==0)return value;return ltrim(rtrim(value));}
function ltrim(value){if(value.length==0)return value;var re=/^\s*/;return value.replace(re,'');}
function rtrim(value){if(value.length==0)return value;var re=/\s*$/;return value.replace(re,'');}
function sendRequest(url){return send_request(url,false);}
function send_request(url,isAsynchronous){var xmlHttp=false;if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();if(xmlHttp.overrideMimeType){xmlHttp.overrideMimeType("application/xml");}}else if(window.ActiveXObject){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}if(!xmlHttp){return false;}xmlHttp.open("GET",url,isAsynchronous);xmlHttp.send(null);if(!isAsynchronous){return xmlHttp.responseText;}}
