Ako upraviť tento JavaScript aby ukazoval aj diakritiku?
Keď je užívateľ zaregistrovaný s interpunkčnými znamienkami a vykoná akciu jeho užívateľské meno sa rozhádže.
// declare new variables for each new div that you add, and link to the div by ID
// var region_div = document.getElementById("region_div");
var doc = null;
function ajax() {
// Make a new XMLHttp object
if (window.XMLHttpRequest) {
try {
doc = new XMLHttpRequest();
} catch(e) {}
} else if (window.ActiveXObject) {
try {
doc = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
doc = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {}
}
}
}
var All_product=0;
var All_running_list=0;
var All_running=0;
function Update_Bid_Detail(Runngin_list,product_id)
{
var doc=null;
if (window.XMLHttpRequest) {
try {
doc = new XMLHttpRequest();
} catch(e) {}
} else if (window.ActiveXObject) {
try {
doc = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
doc = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {}
}
}
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
doc.open('GET', "./location.php?section=update_bid&Runngin_list="+Runngin_list, true);
doc.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
doc.onreadystatechange = function()
{
if (doc.readyState == 4)
{
if (doc.status == 200)
{
if(product_id!='')
Update_bid_table(product_id);
//alert(doc.responseText);
if(doc.responseText!=0)
{
var arraylist2=doc.responseText.split("=#=");
var All_String="";
var arraylist1=arraylist2.split("|@|");
var arraylist4=Runngin_list.split(",");
var Bid_array =arraylist2.split(",");
for(l=0;l
{
var arraylist=arraylist1.split("**");
var pro_id =(parseInt(arraylist));
var bid_counter_array =arraylist4.split("|@|");
var bid_counter =(parseInt(bid_counter_array));
var new_bid_counter_array =Bid_array.split("|@|");
var new_bid_counter =(parseInt(new_bid_counter_array));
if(bid_counter!=new_bid_counter && All_running_list!='')
{
Extend_timer=arraylist;
document.getElementById('price_index_div_'+pro_id).style.backgroundColor = '#fa0000';
document.getElementById('price_index_div_'+pro_id).innerHTML = arraylist;
document.getElementById('winner_index_div_'+pro_id).innerHTML = arraylist;
setTimeout('document.getElementById("price_index_div_'+pro_id+'").style.backgroundColor = ""', 5000);
}
}
All_running_list=arraylist2;
}
}
}
};
if(All_running_list!=0)
Runngin_list=All_running_list;
setTimeout('Update_Bid_Detail("'+Runngin_list+'","'+product_id+'")', 3000);
doc.send(null);
}
function Get_Bidder_list(Runngin_list,Pagename,product_id){
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
var doc=null;
if (window.XMLHttpRequest) {
try {
doc = new XMLHttpRequest();
} catch(e) {}
} else if (window.ActiveXObject) {
try {
doc = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
doc = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {}
}
}
Auto_bidbutler();
doc.open('GET', "./location.php?section=max_bidder&Pagename="+Pagename+"&Runngin_list="+Runngin_list+"&product_id="+product_id, true);
doc.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
doc.onreadystatechange = function() {
if (doc.readyState == 4) {
if (doc.status == 200) {
if(doc.responseText!='')
{
var arraylist2=doc.responseText.split("=#=");
var All_String="";
var All_Price="";
var arraylist1=arraylist2.split("|@|");
for(var l=0;l
{
var arraylist=arraylist1.split("**");
var pro_id =(parseInt(arraylist));
if(arraylist!="NN" && arraylist!="NP")
{
if(arraylist=="P")
{
if(pro_id==product_id)
{
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
-- : -- : --";
}
else
{
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
PAUSE";
}
}
else
{
var diff =parseInt(arraylist);
Extend_timer=diff;
if(diff>0)
{
if(l==0)
All_String=pro_id+"**E**"+arraylist;
else
All_String=All_String+"|@|"+pro_id+"**E**"+arraylist;
document.getElementById('bid_btn_'+pro_id).innerHTML = arraylist;
if(pro_id==product_id)
document.getElementById('flashing_index_div_'+pro_id).innerHTML = arraylist;
}
else
{
if(arraylist=='S')
{
if(pro_id==product_id)
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
else
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
VYHRAL";
}
else
{
if(pro_id==product_id)
document.getElementById('bid_btn_'+pro_id).innerHTML = "";
else
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
OVERUJEM";
Expire_extend_bid(pro_id,product_id);
}
}
}
}
else if(arraylist=="NP")
{
if(pro_id==product_id)
{
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
-- : -- : --";
}
else
{
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
PAUSE";
}
}
else if(arraylist=="NN")
{
var diff =parseInt(arraylist);
Extend_timer=diff;
if(l==0)
All_String=pro_id+"**N";
else
All_String=All_String+"|@|"+pro_id+"**N";
document.getElementById('bid_btn_'+pro_id).innerHTML = arraylist;
}
if(pro_id==product_id)
{
var arraylist3=arraylist2.split("*@*");
if(arraylist3=="L")
{
document.getElementById('place_bid_div_'+pro_id).innerHTML = arraylist3;
if(arraylist3!="I")
document.getElementById("bid_from").value = arraylist3;
if(arraylist3!="R")
Update_bid_table(pro_id);
}
else
{
if(arraylist3!="R")
Update_bid_table(pro_id);
}
document.getElementById('price_index1_div_'+pro_id).innerHTML = arraylist3;
document.getElementById('price_save_div_'+pro_id).innerHTML = arraylist3;
}
}
if(All_String!="")
{
All_product=arraylist2;
Update_bidder_timer(All_String,1,Pagename,arraylist2,product_id);
}
}
}
}
};
if(All_product!=0)
Runngin_list=All_product;
setTimeout('Get_Bidder_list("'+Runngin_list+'","'+Pagename+'","'+product_id+'")', 10000);
doc.send(null);
}
function Update_bidder_timer(All_String,Timer,Pagename,Runngin_list,product_id)
{
var arraylist1=All_String.split("|@|");
for(l=0;l
{
if(arraylist1!="")
{
var arraylist=arraylist1.split("**");
var pro_id =(parseInt(arraylist));
var diff=Extend_timer;
var timer_color=arraylist;
diff=parseInt((diff-Timer));
if(diff>0)
{
if(arraylist=="E")
{
if(timer_color!='')
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
" + calc_counter_from_time_short(diff) + "";
else
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
" + calc_counter_from_time_short(diff) + "";
}
else if(arraylist=="N")
document.getElementById('counter_index_div_'+pro_id).innerHTML = '' + calc_counter_from_time(diff);
}
else
{
if(arraylist=="N")
Expire_home_bid(pro_id);
else
{
if(pro_id==product_id)
document.getElementById('bid_btn_'+pro_id).innerHTML = "";
else
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
OVERUJEM";
}
}
}
}
Timer=Timer+1;
Timer=parseInt(Timer);
if(Timer<=10)
setTimeout('Update_bidder_timer("'+All_String+'",'+Timer+',"'+Pagename+'","'+Runngin_list+'","'+product_id+'")', 1000);
}
function Valid_username(login){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=username&login="+login, false);
doc.send(null);
return doc.responseText;
}
}
function CheckAvail(id_region){
var avail=document.getElementById(id_region).value;
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
//destination.innerHTML = "Loading data...";
doc.open("GET", "location1.php?section=tutoring&avail="+avail, false);
doc.send(null);
// Write the response to the div
//document.getElementById('user_available').innerHTML = doc.responseText;
//alert(arraylist);
if(doc.responseText==1)
{
alert(document.getElementById('username_already_exist').innerHTML+"n");
return false;
}
else if(doc.responseText==2)
{
alert(document.getElementById('this_username_available').innerHTML+"n");
return false;
}
else if(doc.responseText==3)
{
alert(document.getElementById('please_enter_username').innerHTML+"n");
return false;
}
else
return true;
}
}
function CheckEmail(id_region){
var emailadd=document.getElementById(id_region).value;
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
//destination.innerHTML = "Loading data...";
doc.open("GET", "location1.php?section=availmail&emailadd="+emailadd, false);
doc.send(null);
// Write the response to the div
//document.getElementById('email_available').innerHTML = doc.responseText;
if(doc.responseText==1)
{
alert(document.getElementById('email_already_exist').innerHTML+"n");
return false;
}
else if(doc.responseText==2)
{
alert(document.getElementById('this_email_available').innerHTML+"n");
return false;
}
else if(doc.responseText==3)
{
alert(document.getElementById('please_enter_email').innerHTML+"n");
return false;
}
else
return true;
}
}
function Valid_mobile(tel){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=mobile&tel="+tel, false);
doc.send(null);
return doc.responseText;
}
}
function Edit_Valid_mobile(tel){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=edit_mobile&tel="+tel, false);
doc.send(null);
return doc.responseText;
}
}
function Edit_Valid_username(login){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=edit_username&login="+login, false);
doc.send(null);
return doc.responseText;
}
}
function Valid_email(email){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=email&email="+email, false);
doc.send(null);
return doc.responseText;
}
}
function Edit_Valid_email(email){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=edit_email&email="+email, false);
doc.send(null);
return doc.responseText;
}
}
function Admin_Valid_username(login){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=admin_username&login="+login, false);
doc.send(null);
return doc.responseText;
}
}
function Admin_Valid_mobile(tel){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=admin_mobile&mobile="+mobile, false);
doc.send(null);
return doc.responseText;
}
}
function Admin_Edit_Valid_mobile(mobile,edit_id){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=admin_edit_mobile&mobile="+mobile+"&user_id="+edit_id, false);
doc.send(null);
return doc.responseText;
}
}
function Admin_Edit_Valid_username(login,edit_id){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=admin_edit_username&login="+login+"&user_id="+edit_id, false);
doc.send(null);
return doc.responseText;
}
}
function Admin_Valid_email(email){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=admin_email&email="+email, false);
doc.send(null);
return doc.responseText;
}
}
function Admim_Edit_Valid_email(email,edit_id){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=admin_edit_email&email="+email+"&user_id="+edit_id, false);
doc.send(null);
return doc.responseText;
}
}
function bid_list(item_id,table_type)
{
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?section=bid_list_table&item_id="+item_id+"&table_type="+table_type, false);
doc.send(null);
document.getElementById('bidlist_table_div').innerHTML = doc.responseText;
if(table_type=='B')
Update_bid_table(item_id);
}
}
function bidbutler_list(item_id,table_type)
{
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?section=book_bidbutler_table&item_id="+item_id+"&table_type="+table_type, false);
doc.send(null);
document.getElementById('book_bidbutler_table_div').innerHTML = doc.responseText;
}
}
function get_info_drop_dowm(promotion_id){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=promotion&promotion_id=" + promotion_id, false);
doc.send(null);
// Write the response to the div
document.getElementById('info_div').innerHTML = doc.responseText;
}
}
function Auto_bid_expire()
{
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=autobid_expire", false);
doc.send(null);
}
}
function Start_Bid() {
var doc=null;
if (window.XMLHttpRequest) {
try {
doc = new XMLHttpRequest();
} catch(e) {}
} else if (window.ActiveXObject) {
try {
doc = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
doc = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {}
}
}
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
doc.open('GET', "./location.php?section=start_bid", true);
doc.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
doc.onreadystatechange = function()
{
if (doc.readyState == 4)
{
if (doc.status == 200)
setTimeout('Start_Bid();',10000);
else
setTimeout('Start_Bid();',10000);
}
}
doc.send(null);
}
function Show_advert()
{
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?Response=show_advert", false);
doc.send(null);
document.getElementById('advert_div').innerHTML = doc.responseText;
}
}
function Update_bid_table(product_id){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?section=update_bid_table&product_id="+product_id, false);
doc.send(null);
// Write the response to the div
document.getElementById('bid_table_div1').innerHTML = doc.responseText;
}
}
function Update_bid_auction()
{
var doc=null;
if (window.XMLHttpRequest) {
try {
doc = new XMLHttpRequest();
} catch(e) {}
} else if (window.ActiveXObject) {
try {
doc = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
doc = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {}
}
}
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
doc.open('GET', "./location.php?section=update_auction", true);
doc.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');
doc.onreadystatechange = function()
{
if (doc.readyState == 4)
{
if (doc.status != 200)
setTimeout('Update_bid_auction();',10000);
}
}
doc.send(null);
}
function Update_session()
{
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=update_session", false);
doc.send(null);
}
}
function Auto_bidbutler() {
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?section=auto_bidbutler", false);
doc.send(null);
}
}
function Expire_home_bid(pro_id) {
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?section=expire_bid&pro_id=" + pro_id, false);
doc.send(null);
}
}
function Expire_extend_bid(pro_id,product_id) {
var doc=null;
if (window.XMLHttpRequest) {
try {
doc = new XMLHttpRequest();
} catch(e) {}
} else if (window.ActiveXObject) {
try {
doc = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
doc = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {}
}
}
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
doc.open('GET', "./location.php?section=expire_extend&pro_id="+pro_id, true);
doc.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');
doc.onreadystatechange = function()
{
if (doc.readyState == 4)
{
if (doc.status == 200)
{
if(doc.responseText!='')
{
var pro_id =(parseInt(doc.responseText));
document.getElementById('counter_index_div_'+pro_id).innerHTML = "
VYHRAL" ;
if(pro_id==product_id)
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
else
document.getElementById('bid_btn_'+pro_id).innerHTML = "
";
setTimeout('Update_bid_auction()', 5000);
if(pro_id==product_id)
Congratulation_auction(pro_id);
}
}
else
{
setTimeout('Expire_extend_bid('+pro_id+','+product_id+');',10000);
}
}
}
doc.send(null);
}
function Start_auction() {
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=start_auction", false);
doc.send(null);
}
}
function add_to_watchlist(item_id){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=add_to_watchlist&item_id=" + item_id, false);
doc.send(null);
if(doc.responseText==1)
alert("This product to be add in your watchlist successfully.");
}
}
function calc_counter_from_time(diff)
{
if (diff > 0) {
days=Math.floor(diff / (3600*24))
hours=Math.floor((diff / 3600)-(days*24))
minutes=Math.floor((diff / 3600 - hours -(days*24)) * 60)
seconds=Math.round((((diff / 3600 - hours-(days*24)) * 60) - minutes) * 60)
} else {
days=0;
hours = 0;
minutes = 0;
seconds = 0;
}
if (seconds == 60) {
seconds = 0;
}
if (minutes < 10) {
if (minutes < 0) {
minutes = 0;
}
minutes = '0' + minutes;
}
if (seconds < 10) {
if (seconds < 0) {
seconds = 0;
}
seconds = '0' + seconds;
}
if (hours < 10) {
if (hours < 0) {
hours = 0;
}
hours = '0' + hours;
}
return hours + " : " + minutes + " : " + seconds;
}
function calc_counter_from_time_short(diff) {
if (diff > 0) {
hours=Math.floor(diff / 3600)
minutes=Math.floor((diff / 3600 - hours) * 60)
seconds=Math.round((((diff / 3600 - hours) * 60) - minutes) * 60)
} else {
hours = 0;
minutes = 0;
seconds = 0;
}
if (seconds == 60) {
seconds = 0;
}
if (minutes < 10) {
if (minutes < 0) {
minutes = 0;
}
minutes = '0' + minutes;
}
if (seconds < 10) {
if (seconds < 0) {
seconds = 0;
}
seconds = '0' + seconds;
}
if (hours < 10) {
if (hours < 0) {
hours = 0;
}
hours = '0' + hours;
}
return minutes + " : " + seconds;
}
function Add_bid(pro_id) {
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?section=add_bid&pro_id="+pro_id, false);
doc.send(null);
if(parseInt(doc.responseText)==99999)
document.location="index.php?show=login";
else
{
var mainarraylist=doc.responseText.split("**");
if(mainarraylist.length>1)
{
document.getElementById('price_index_div_'+parseInt(pro_id)).innerHTML = mainarraylist;
document.getElementById('winner_index_div_'+parseInt(pro_id)).innerHTML = mainarraylist;
document.getElementById('div_blance').innerHTML = mainarraylist;
}
else
alert(doc.responseText);
}
}
}
function check_bid(pro_id,Ptype,Pagename) {
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?section=check_bid&pro_id="+pro_id+"&Pagename="+Pagename+"&Ptype="+Ptype, false);
doc.send(null);
if(parseInt(doc.responseText)==99999)
document.location="index.php?show=login";
else
{
var mainarraylist=doc.responseText.split("***");
if(mainarraylist==1)
{
window.open(mainarraylist,'subwindow','toolbar=no, location=no, directories=no, status=no, top=200, left=350, scrollbars=yes, menubar=no, resizable=no, maximize=no, width=300, height=160');
}
else
alert(doc.responseText);
}
}
}
function showdisplay(item_id){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=show_detail&item_id=" + item_id, false);
doc.send(null);
//alert(doc.responseText);
document.getElementById('auction_detail_'+parseInt(item_id)).innerHTML = doc.responseText;
}
}
function hidedisplay(item_id){
document.getElementById('auction_detail_'+parseInt(item_id)).innerHTML = '';
}
function Congratulation_auction(item_id)
{
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location.php?section=congratulation_auction&item_id="+item_id, false);
doc.send(null);
document.getElementById('congratulation_auction_div_'+parseInt(item_id)).innerHTML = doc.responseText;
}
}
function showzoomdisplay(item_id){
ajax();
// Load the result from the response page
// ** As far a I know firefox will only load a document on the SAME domain!!
if (doc){
doc.open("GET", "./location1.php?section=showzoomdisplay&item_id=" + item_id, false);
doc.send(null);
//alert(doc.responseText);
document.getElementById('zoom_img_'+parseInt(item_id)).innerHTML = doc.responseText;
}
}
function hidezoomdisplay(item_id){
document.getElementById('zoom_img_'+parseInt(item_id)).innerHTML = '';
}
17. 4. 2011 14:42:34