qhub_ask_widget = new Object(); qhub_ask_widget.title = typeof qhub_ask_title == 'string' ? unescape(qhub_ask_title) : 'Ask a Question'; qhub_ask_widget.width = typeof qhub_ask_width == 'string' ? qhub_ask_width : '200px'; qhub_ask_widget.header_col = typeof qhub_ask_header_col == 'string' ? qhub_ask_header_col : '#000'; qhub_ask_widget.background = typeof qhub_ask_background == 'string' ? qhub_ask_background : '#fff'; qhub_ask_widget.border = typeof qhub_ask_border == 'string' ? qhub_ask_border : '#e0e0e0'; qhub_ask_widget.hard_link = typeof qhub_ask_css_name == 'string' ? qhub_ask_css_name : 'askossian_qhub_com'; document.write(''); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write('

'); document.write(''); document.write(' Ask a Question

'); document.write(''); document.write('

'); document.write(''); document.write(' at Ask Ossian'); document.write(''); document.write('

'); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write(' '); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write(' '); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write('

'); document.write(''); document.write(' '); document.write(''); document.write('

'); document.write(''); document.write('
'); document.write(''); document.write('
 
'); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write(''); (function($) { var width_parsed = parseInt(qhub_ask_widget.width); width_parsed = width_parsed - 18; if (width_parsed <= 335) { tag_width = width_parsed - 35 } else { tag_width = 300 } var textbox_width = width_parsed - 10; var scalewidth = Math.min(width_parsed,300); var scale = scalewidth / 250 + 0.2; var header = Math.round(scale*16); var bodysize = Math.round(scale*12); var tagsize = Math.min(bodysize,13); var bodysize = Math.min(bodysize,20); var container_div = $('div#qhub_ask_widget_container_126282'); container_div .css({'width': width_parsed+'px', 'background-color': qhub_ask_widget.background, 'border': '1px solid '+qhub_ask_widget.border}); container_div.find('p#qhub_ask_header') .html(qhub_ask_widget.title) .css({'color': qhub_ask_widget.header_col, 'font-size': header+'px'}); container_div.find('p#qhub_ask_subheader') .css({'color': qhub_ask_widget.header_col, 'font-size': tagsize+'px'}); container_div.find('p#qhub_ask_subheader a') .css({'color': qhub_ask_widget.header_col, 'font-size': tagsize+'px'}); container_div.find('textarea#qhub_ask_question') .css({'width': textbox_width+'px', 'font-size': bodysize+'px'}); container_div.find('input#tags_126282') .css({'width': tag_width+'px', 'font-size': tagsize+'px'}); container_div.find('button#qhub_ask_btn') .css('font-size', tagsize+'px'); var hard_link = $('#'+qhub_ask_widget.hard_link+'_link'); if (hard_link) { hard_link.css('width', qhub_ask_widget.width) } $(document).ready(function() { var hub_tags_cnt = {"captions music video":"1","advertising in a recession":"1","video production cost":"1","government video production":"1","video advertising laws standards":"1","web 3.0":"1","web video help":"1","photographer video production":"1","corporate video":"1","music video costs price":"1","video production":"1","video optimisation":"1","html5":"1","editing":"1","viral advertising":"1","online web video":"1","subtitles closed captions":"1","using a professional videographer production compa":"1"}; var hub_tags = ["captions music video","advertising in a recession","video production cost","government video production","video advertising laws standards","web 3.0","web video help","photographer video production","corporate video","music video costs price","video production","video optimisation","html5","editing","viral advertising","online web video","subtitles closed captions","using a professional videographer production compa"]; function qhub_trim (str) { return str.replace(/^\s+|\s+$/g,""); } container_div.find('ul#qhub_tags_autosuggest_126282 li').live("click",function() { qhub_input = container_div.find('input#tags_126282'); $(this).find('strong').remove(); qhub_txt=""; qhub_tags = qhub_input.val().split(','); qhub_tags.pop(); qhub_tags.push($(this).html()); for(i=0;i < qhub_tags.length;i++) { qhub_txt += qhub_trim(qhub_tags[i])+", "; } qhub_input.val(qhub_txt).focus(); $(this).parent().html(' '); return false; }); function qhub_showSuggestions(txt) { if(!hub_tags.length) return ''; if(!txt) return ''; html = ''; currentTags = txt.split(','); currentTag = qhub_trim(currentTags.pop()); if(!currentTag) return html; currentLetter = currentTag.charAt(currentTag.length-1); currentLength = currentTag.length; matches = new Array(); /** * Search hub_tags for text */ myregexp = new RegExp('^'+currentTag,'i'); for (i = 0; i < hub_tags.length; i++) { _tag = hub_tags[i]; mymatch = myregexp.test(_tag); if(mymatch) { match = true; for (key in currentTags) { if (currentTags[key] == _tag) match = false; } if(match) matches.push(_tag); } } /** * Display matches */ end = (matches.length > 4)?5:matches.length; for (i = 0; i < end; i++) { liclass = i==end-1?' class="last"':''; html += ''+hub_tags_cnt[matches[i]]+'' + matches[i] + ''; } return html; } $.fn.qhub_tag_suggest = function(ev) { ul =''; switch(ev.keyCode) { case 59: case 107: case 109: case 188: case 190: case 191: case 192: case 219: case 220: case 221: case 222: html = ''; break; default: id = 'ul#qhub_tags_autosuggest_126282'; if(!$(id).length) { this.after(''); } ul = $(id); ul.addClass('autosuggest'); txt = this.attr('value'); html = qhub_showSuggestions(txt); break; } if(ul.length) ul.html(html).show(); } container_div.find('input#tags_126282') .unbind().keyup(function(event) { $(this).qhub_tag_suggest(event); }) .blur(function() { $('ul#qhub_tags_autosuggest_126282') .animate({ display:'none' },500); }); }); })(jQuery);