var hostinstalldir='http://'+window.location.hostname+'/vote/';
$(document).ready(function(){
$('#broqch').load(hostinstalldir+'dldcnt.php');
/*
$('#sreda').ajaxStart(function(){
try{
$('input[name="s1"]').css('display','none');
}
catch(err){}
});
$('#sreda').ajaxStop(function(){
try{
$('input[name="s1"]').css('display','block');
}
catch(err){}
});
*/
$('#dldcnt').click(function(){
setTimeout("$('#broqch').load(hostinstalldir+'dldcnt.php')",1500);
/*
var i=parseInt($('#broqch').text().replace(/[^\d]+/g,''))+1;
try{
$('#broqch').load(hostinstalldir+'dldcnt.php');
}
catch(err){
$('#broqch').html('total downloads '+i);
}
*/
return true;
});
/*
$('select[name="select1"]').change(function(){
if ($.cookie('Votid'+$(this).val())!=null){
alert('You have already voted in past 24h.');
$('select[name="select1"] option').removeAttr('selected');
$('select[name="select1"] option:eq(0)').attr('selected','selected');
return false;
}
});
*/
$('input[name="s1"]').click(function(){
if (!parseInt($('select[name="select1"]').val())){
alert('Please, choose product');
$(this).focus();
return false;
}
$(this).hide('fast');
try{
$(this).show('slow');
}
catch(err){}
var tmp=parseInt($('input[name="radio1"]:checked').val());
if (tmp==0){
alert('Please, choose your vote');
return false;
}
$.post(hostinstalldir+'php/voted.php',{'product':escape($('select[name="select1"]').val()),'vot':escape(tmp)},function(data){
alert(data);
// if (data=='Your vote has been submitted. Thank you'){
var bla = escape($('select[name="select1"]').val());
$('#sreda').empty();
/*
$('#sreda').append('
Vote for other product
');
*/
$('#sreda').load(hostinstalldir+'php/check.php?prodid='+bla);
// }
});
// (parseInt($('select:eq(0)').val())==0) ? alert('bla'+$('input[name="radio1"]').val()):alert('OK+'+$('input[name="radio1"]').val());
});
});