function GetScript(url, callback, remove){
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
if(callback !== false){
var func = (function(h, s, c, r){
return function(){
if(c !== undefined){
c();
}
if(r === undefined || r === true){
h.removeChild(s);
}
};
})(head, script, callback, remove);
script.onreadystatechange = (function(f){
return function(){
if(this.readyState === 'loaded' || this.readyState === 'completed'){
f();
}
};
})(func);
script.onload = func;
}
head.appendChild(script);
}
function addEvent(evt, func, obj){
if(obj.attachEvent) obj.attachEvent('on' + evt, func);
else if(obj.addEventListener) obj.addEventListener(evt, func, false);
}
function UpdateHelpful(id, help){
getHelp = 'no'
if(help)
getHelp = 'yes';
GetScript('https://www.kingwebtools.com/no_key/kwm_qa_system/updatehelpful.php?id='+id+'&help='+getHelp, false, true);
var he = document.getElementById('helpful' + id);
var un = document.getElementById('unhelpful' + id);
var lhe = document.getElementById('linkhelpful' + id);
var lun = document.getElementById('linkunhelpful' + id);
var newNum = 0;
if(help){
he.style.color = 'green';
newNum = parseInt(he.innerHTML) + 1;
he.innerHTML = newNum;
}
else{
un.style.color = 'red';
newNum = parseInt(un.innerHTML) + 1;
un.innerHTML = newNum;
}
lhe.href = 'javascript:void(0)';
lun.href = 'javascript:void(0)';
}
var expandInt = 0;
var expandTotal = 0;
function QAExpandInit(){
var o = document.getElementById('kwm_question');
QAInputFocus(o);
expandTotal = o.offsetHeight;
if(document.getElementById('kwm-qa-submit-form').offsetHeight < 140){ // start the drop-down animation
expandInt = setInterval(QAExpand, 40);
}
}
function QAExpand(){
var o = document.getElementById('kwm-qa-submit-form');
if(expandTotal >= 140){
var finalHeight = 140;
if(isIE())
finalHeight += 20;
o.style.height = finalHeight + 'px';
clearInterval(expandInt);
return;
}
expandTotal += 10;
o.style.height = expandTotal + 'px';
}
function QAInputBlur(o){
if(o.value == ''){
o.value = o.defaultValue;
o.style.color = '#909090';
}
}
function QAInputFocus(o){
if(o.defaultValue == o.value){ // clear out the font and set to black if empty
o.style.color = '#000000';
o.value = '';
}
}
// Found function -- returns tallest height of the three possible height members
function getElemHeight(D) {
return Math.max(
Math.max(D.scrollHeight),
Math.max(D.offsetHeight),
Math.max(D.clientHeight)
);
}
function isIE(){
return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}
var kwm_read_qas_text = 'Read Questions and Answers';
var kwm_write_qa_text = 'Ask a question';
var kwm_folder = 'no_key';
document.write(' ');document.getElementById('kwm-sr-qa').style.display = 'none';