function $(){var C=new Array();for(var B=0;B<arguments.length;B++){var A=arguments[B];if(typeof A=="string"){A=document.getElementById(A)}if(arguments.length==1){return A}C.push(A)}return C}var timer;function ShowLanguageBannerWithTimeout(A){timer=setTimeout(function(){ShowLanguageBanner()},A)}function ShowLanguagePicker(){clearTimeout(timer);$("banner_img").style.visibility="hidden";$("lang_picker").style.visibility="";$("lang_banner").style.cursor=""}function ShowLanguageBanner(){$("banner_img").style.visibility="";$("lang_banner").style.cursor="pointer";$("lang_picker").style.visibility="hidden"}var SimpleTags={bold:"b",italic:"i",underline:"u",ul:"ul",ol:"ol",li:"li",strike:"strike"};function AddSimpleTags(E,C){var H=$(E);if(document.selection){H.focus();sel=document.selection;range=sel.createRange();var G=range.text;var I="<"+SimpleTags[C]+">"+range.text+"</"+SimpleTags[C]+">";range.text=I;range.moveStart("character",-I.length+2+SimpleTags[C].length);range.moveEnd("character",-SimpleTags[C].length-3);if(G!=""){range.select()}}else{if(H.selectionStart||H.selectionStart=="0"){var F=H.selectionStart;var A=H.selectionEnd;var B=H.scrollTop;var D=H.scrollLeft;var I="<"+SimpleTags[C]+">"+H.value.substring(F,A)+"</"+SimpleTags[C]+">";H.value=H.value.substring(0,F)+I+H.value.substring(A,H.value.length);H.selectionStart=F+2+SimpleTags[C].length;H.selectionEnd=A+2+SimpleTags[C].length;H.scrollTop=B;H.scrollLeft=D}}H.focus()}var SingleTags={more:"<!--more-->",hr:"<hr/>"};function AddSingleTags(E,A){var B=$(E);if(document.selection){B.focus();sel=document.selection;range=sel.createRange();var H=SingleTags[A];range.text=H}else{if(B.selectionStart||B.selectionStart=="0"){var D=B.selectionStart;var C=B.selectionEnd;var F=B.scrollTop;var G=B.scrollLeft;var H=SingleTags[A];B.value=B.value.substring(0,D)+H+B.value.substring(C,B.value.length);B.selectionStart=D+H.length;B.selectionEnd=B.selectionStart;B.scrollTop=F;B.scrollLeft=G}}B.focus()}var SingleDifficultTags0={vzo:"vzo",youtube:"youtube"};function AddSingleDifficultTags(J,E,C){var H=$(E);if(document.selection){H.focus();sel=document.selection;range=sel.createRange();var F=range.text==""?prompt(J,""):range.text;if(!F||F==""){return }F=RemoveSpaces(F);F=ReplaceVZO(F);var I="["+SingleDifficultTags0[C]+"="+F+"]";range.text=I;range.moveStart("character",-F.length-1);range.moveEnd("character",-1);range.select()}else{if(H.selectionStart||H.selectionStart=="0"){var G=H.selectionStart;var A=H.selectionEnd;var B=H.scrollTop;var D=H.scrollLeft;var F=H.value.substring(G,A);if(F==""){F=prompt(J,"")}if(!F||F==""){return }F=RemoveSpaces(F);F=ReplaceVZO(F);var I="["+SingleDifficultTags0[C]+"="+F+"]";H.value=H.value.substring(0,G)+I+H.value.substring(A,H.value.length);H.selectionStart=G+2+SingleDifficultTags0[C].length;H.selectionEnd=H.selectionStart+F.length;H.scrollTop=B;H.scrollLeft=D}}H.focus()}function AddLink(I,D){var G=$(D);if(document.selection){G.focus();sel=document.selection;range=sel.createRange();var E=range.text==""?prompt(I,""):range.text;if(!E||E==""){return }E=RemoveSpaces(E);var H='<a href="'+E+'">'+E+"</a>";range.text=H;range.moveStart("character",-E.length-4);range.moveEnd("character",-4);range.select()}else{if(G.selectionStart||G.selectionStart=="0"){var F=G.selectionStart;var A=G.selectionEnd;var B=G.scrollTop;var C=G.scrollLeft;var E=G.value.substring(F,A);if(E==""){E=prompt(I,"")}if(!E||E==""){return }E=RemoveSpaces(E);E=ReplaceVZO(E);var H='<a href="'+E+'">'+E+"</a>";G.value=G.value.substring(0,F)+H+G.value.substring(A,G.value.length);G.selectionStart=F+11+E.length;G.selectionEnd=G.selectionStart+E.length;G.scrollTop=B;G.scrollLeft=C}}G.focus()}function AddImage(I,D){var G=$(D);if(document.selection){G.focus();sel=document.selection;range=sel.createRange();var E=range.text==""?prompt(I,""):range.text;if(!E||E==""){return }E=RemoveSpaces(E);var H='<img src="'+E+'" title="" alt=""/>';range.text=H}else{if(G.selectionStart||G.selectionStart=="0"){var F=G.selectionStart;var A=G.selectionEnd;var B=G.scrollTop;var C=G.scrollLeft;var E=G.value.substring(F,A);if(E==""){E=prompt(I,"")}if(!E||E==""){return }E=RemoveSpaces(E);E=ReplaceVZO(E);var H='<img src="'+E+'" title="" alt=""/>';G.value=G.value.substring(0,F)+H+G.value.substring(A,G.value.length);G.selectionStart=F+H.length;G.selectionEnd=G.selectionStart;G.scrollTop=B;G.scrollLeft=C}}G.focus()}function AddQuote(D){var A=$(D);var G="";if(document.selection){G=document.selection.createRange().text}else{if(window.getSelection){G=window.getSelection()}else{if(document.getSelection){G=document.getSelection()}}}G="[blockquote]"+G+"[/blockquote]";if(document.selection){A.focus();sel=document.selection;range=sel.createRange();range.text=G;range.moveStart("character",-G.length+12);range.moveEnd("character",-13);range.select()}else{if(A.selectionStart||A.selectionStart=="0"){var C=A.selectionStart;var B=A.selectionEnd;var E=A.scrollTop;var F=A.scrollLeft;if(G=="[blockquote][/blockquote]"){G="[blockquote]"+A.value.substring(C,B)+"[/blockquote]"}A.value=A.value.substring(0,C)+G+A.value.substring(B,A.value.length);A.selectionStart=C+12;A.selectionEnd=A.selectionStart-25+G.length;A.scrollTop=E;A.scrollLeft=F}}A.focus()}function AddSmile(E,C){var H=$(E);if(document.selection){H.focus();sel=document.selection;range=sel.createRange();var G=range.text;var I=C;range.text=I;range.moveStart("character",-I.length+C.length)}else{if(H.selectionStart||H.selectionStart=="0"){var F=H.selectionStart;var A=H.selectionEnd;var B=H.scrollTop;var D=H.scrollLeft;var I=C;H.value=H.value.substring(0,F)+I+H.value.substring(A,H.value.length);H.selectionStart=F+C.length;H.selectionEnd=H.selectionStart;H.scrollTop=B;H.scrollLeft=D}}H.focus()}function AddBlogTag(B,A){object=$(B);var C=object.value.split(",");tempTag=(new String(A)).toLowerCase();for(i in C){str=new String(C[i]);str=RemoveSpaces(str);if(str.toLowerCase()==tempTag){return }}object.value=C;object.value=RemoveSpaces(object.value);if(object.value.match(/,$/)){object.value+=" "+A}else{if(object.value.match(/,[\s]*$/)){object.value+=A}else{if(object.value==""){object.value=A}else{object.value+=", "+A}}}}function RemoveSpaces(A){return A.replace(/^\s+/,"").replace(/\s+$/,"")}function ReplaceVZO(A){return A.replace(/http:\/\/.*?\/profile\/([^\/]+)\/?/ig,"$1")}function AddItemFromSelectToText(C,E){var A=$($(C).innerHTML);if(A.selectedIndex==0){return }var B=$($(E).innerHTML);var D=A.length-1;if(D==A.selectedIndex){for(i=1;i<D;i++){if(B.value.indexOf(A.options[i].text)>-1){continue}if(B.value!=""){B.value+=","}B.value+=A.options[i].text}}else{AddSelectingItem(C,E)}}function AddSelectingItem(B,C){var A=$(B);AddBlogTag(C,A.options[A.selectedIndex].text)}function HideHints(A,B){if(A.value==B){A.value=""}A.style.color="#999999"}function ShowHints(A,B){if(A.value==""){A.value=B}A.style.color="#888888"}var DesignVotingTimer;var DriverVotingTimer;var PictureVotingTimer;var designVotingCounter;var driverVotingCounter;var pictureVotingCounter;function VoteFillObjectEvent(A){$(A+"Rating").onmouseover=function(){VoteOnMainOver(A)};$(A+"Vote").onmouseout=function(){VoteOnMainOutWithTimer(A)};$(A+"Vote").onclick=function(){VoteOnClick(A)}}function VoteOnMainOver(A){$(A+"Vote").style.display="block";$(A+"Rating").style.display="none"}function VoteOnMainOutWithTimer(A){switch(A){case"design":DesignVotingTimer=setTimeout(function(){VoteOnMainOut(A)},200);break;case"driver":DriverVotingTimer=setTimeout(function(){VoteOnMainOut(A)},200);break;case"picture":PictureVotingTimer=setTimeout(function(){VoteOnMainOut(A)},200);break}}function VoteOnMainOut(A){$(A+"Vote").style.display="none";$(A+"Rating").style.display="block";switch(A){case"design":designVotingCounter=0;break;case"driver":driverVotingCounter=0;break;case"picture":pictureVotingCounter=0;break}for(var B=0;B<=4;B++){$(A+"_ghost_"+B).style.backgroundColor="#FFFFFF"}}function VoteOnOver(D){var B=D.id.replace(/^([a-z]*)(_.*)$/,"$1");var C=new Number(D.id.replace(B+"_ghost_",""));switch(B){case"design":clearTimeout(DesignVotingTimer);designVotingCounter=C+1;break;case"driver":clearTimeout(DriverVotingTimer);driverVotingCounter=C+1;break;case"picture":clearTimeout(PictureVotingTimer);pictureVotingCounter=C+1;break}for(var A=0;A<=4;A++){if(A<=C){$(B+"_ghost_"+A).style.backgroundColor="#FFFF66"}else{$(B+"_ghost_"+A).style.backgroundColor="#FFFFFF"}}}function VoteOnClick(A){$(A+"Rating").onmouseover="";$(A+"Vote").onmouseout="";$(A+"Vote").style.display="none";$(A+"Rating").style.display="block";switch(A){case"design":SendXMLHttpRequest(ServerURL+"/voting.aspx?type="+A+"&id="+CameraID+"&vote="+designVotingCounter);break;case"driver":SendXMLHttpRequest(ServerURL+"/voting.aspx?type="+A+"&id="+CameraID+"&vote="+driverVotingCounter);break;case"picture":SendXMLHttpRequest(ServerURL+"/voting.aspx?type="+A+"&id="+CameraID+"&vote="+pictureVotingCounter);break}$(A+"Vote").onclick="";$(A+"Result").innerHTML=txt_gratitude;$("divDescription").style.visibility="visible"}function SendXMLHttpRequest(A){if(window.XMLHttpRequest){client=new XMLHttpRequest()}else{if(window.ActiveXObject){client=new ActiveXObject("Microsoft.XMLHTTP")}}if(client!=null){client.open("GET",A,true);client.setRequestHeader("Content-Type","text/plain;charset=UTF-8");client.send(null)}else{alert("Your browser does not support XMLHTTP.")}};
