// clear search field function doClear(theText) { if (theText.value == theText.defaultValue) { theText.value = "" } } function mymouseover(which,which_link) { // document.getElementById("post_" + which).innerHTML = " Källa: " + which_link; } function mymouseout(which) { // document.getElementById("post_" + which).innerHTML = " "; } // AJAX_SUBMIT function ajax_submit(submit_type, which, submit_value) { var poststr = "&item_id=" + escape(encodeURI( which )); poststr = poststr + "&submit_value=" + escape(encodeURI(submit_value)); poststr = poststr + "&user_id=" + user_id; poststr = poststr + "&secure_password=" + secure_password; var searchstring = "/ajax.php?action=" + submit_type + poststr ; GDownloadUrl(searchstring, function(data, responseCode) { //alert(searchstring); //alert(data); ajax_array = data.split('|'); if(ajax_array[0]=="added_label"){document.getElementById('entry_' + which).style.backgroundColor=ajax_array[1];document.getElementById('label_entry_' + which).innerHTML = "";} else{alert(data);} }); } // FUNCTION TO HASH THE PASSWORD function hash_password() { // Get password var password = document.getElementById('password').value; // Hash password var secure_password = md5(password); // Save hashed password document.getElementById('secure_password').value = secure_password; // Remove plain password password.value = ''; } var snurr=0; var delay=20; var currentChar=0; var versus_value=10; var count_value=0; var count_value_max=0; var print_count_1_20= 0; var print_count_2_20= 0; var print_count_1_40= 0; var print_count_2_40= 0; function type() { if(print_words_array[snurr]=='undefined'){snurr=0;} document.getElementById('textdestination_description').innerHTML=''; document.getElementById('textdestination').style.backgroundColor='#fff'; document.getElementById('textdestination').innerHTML= '' + print_words_array[snurr] + ''; setTimeout("type_print()", 2000); } function type_print() { document.getElementById('textdestination').innerHTML= '' + print_words_array[snurr] + ' ' + print_binding + ' ' + print_sentence_array[snurr].substr(0, currentChar); currentChar++ if (currentChar>print_sentence_array[snurr].length) { setTimeout("colorcode()", 500); } else { setTimeout("type_print()", delay); } } function colorcode() { document.getElementById('textdestination').style.backgroundColor= print_label_array[snurr]; setTimeout("setfact()", 500); } function setfact() { /* document.getElementById('textdestination').innerHTML += ' (' + print_label_text_array[snurr] + ')'; */ snurr++; currentChar=1; setTimeout("type()", 2500); } function versus_type_print_initialize() { document.getElementById('versus_1_link').href = "/om/" + print_words_1_array[snurr].replace(' ','+') + "/"; document.getElementById('versus_2_link').href = "/om/" + print_words_2_array[snurr].replace(' ','+') + "/"; versus_type_print(); } function versus_type_print() { document.getElementById('versus_1').innerHTML= print_words_1_array[snurr].substr(0, currentChar); document.getElementById('versus_2').innerHTML= print_words_2_array[snurr].substr(0, currentChar); currentChar++ if (currentChar>print_words_1_array[snurr].length && currentChar>print_words_2_array[snurr].length) { document.getElementById('versus_1').innerHTML= "" + print_words_1_array[snurr].substr(0, currentChar) + ""; document.getElementById('versus_2').innerHTML= "" + print_words_2_array[snurr].substr(0, currentChar) + ""; setTimeout("document.getElementById('versus_1_image').style.backgroundPosition= '0 -50px';document.getElementById('versus_2_image').style.backgroundPosition= '0 -50px';", (delay*10)); setTimeout("versus_value_count()", (delay*30)); print_count_1_20= print_count_1_array[snurr].split('20:'); print_count_1_20= print_count_1_20[1].split(','); print_count_1_20= print_count_1_20[0]; print_count_1_40= print_count_1_array[snurr].split('40:'); print_count_1_40= print_count_1_40[1].split(','); print_count_1_40= print_count_1_40[0]; print_count_2_20= print_count_2_array[snurr].split('20:'); print_count_2_20= print_count_2_20[1].split(','); print_count_2_20= print_count_2_20[0]; print_count_2_40= print_count_2_array[snurr].split('40:'); print_count_2_40= print_count_2_40[1].split(','); print_count_2_40= print_count_2_40[0]; count_value_max = Math.max(print_count_1_20,print_count_1_40,print_count_2_20,print_count_2_40); } else { setTimeout("versus_type_print()", (delay*3)); } } function versus_value_count() { if (count_value<=print_count_1_20){document.getElementById('versus_1_count_20').innerHTML= count_value;} if (count_value<=print_count_2_20){document.getElementById('versus_2_count_20').innerHTML= count_value;} if (count_value<=print_count_1_40){document.getElementById('versus_1_count_40').innerHTML= count_value;} if (count_value<=print_count_2_40){document.getElementById('versus_2_count_40').innerHTML= count_value;} count_value++; // alert(count_value); if (count_value<=count_value_max) { setTimeout("versus_value_count()", (Math.round(count_value_time/count_value_max))); } else { setTimeout("versus_value_change()", (delay*30)); } } function versus_value_change() { if (versus_value-10<=print_value_1_array[snurr]){document.getElementById('versus_1_image').style.backgroundPosition= "0 -" + (versus_value*5) + "px";} if (versus_value-10<=print_value_2_array[snurr]){document.getElementById('versus_2_image').style.backgroundPosition= "0 -" + (versus_value*5) + "px";} versus_value = versus_value+10; if (versus_value<=110) { setTimeout("versus_value_change()", (delay*10)); } else { setTimeout("versus_value_finish()", (delay*30)); } } function versus_value_finish() { if (print_value_1_array[snurr]>print_value_2_array[snurr]){document.getElementById('versus_1').style.backgroundColor="#AEA";document.getElementById('versus_2').style.backgroundColor="#FAA";} if (print_value_1_array[snurr]snurr+2){setTimeout("versus_value_startover()", (delay*200));} } function versus_value_startover() { snurr++; versus_value=10; currentChar=0; count_value= 0; document.getElementById('versus_1_count_20').innerHTML= 0; document.getElementById('versus_2_count_20').innerHTML= 0; document.getElementById('versus_1_count_40').innerHTML= 0; document.getElementById('versus_2_count_40').innerHTML= 0; document.getElementById('versus_1_image').style.backgroundPosition= "0 -50px" document.getElementById('versus_2_image').style.backgroundPosition= "0 -50px" document.getElementById('versus_1').innerHTML=""; document.getElementById('versus_2').innerHTML=""; document.getElementById('versus_1').style.backgroundColor="#FFF"; document.getElementById('versus_2').style.backgroundColor="#FFF"; setTimeout("versus_type_print_initialize()", (delay*50)); }