function notLogin(){
showMessageWindow('Um die Funktion nutzen zu können, musst Du eingeloggt sein.','Hinweis');
//document.location.href='http://www.bookrix.com/login_or_register.html';
}
function SMessage(text,header,class2){
if (class2) class2=' '+class2; else class2='';
if (header) text="
"+text;
showWinHtml('message',text+"» schließen
");
}
function showMessageWindow(text,header){
$('#message_header').html('');
$('#message').html('');
$('#message_header').html(header);
$('#message').html(text);
document.getElementById('message_big').style.display='block';
}
function mouseOverMainMenu(tdid){
tdid.parentNode.className='active_button';
}
function mouseOutMainMenu(tdid){
tdid.parentNode.className='not_active_button';
}
///deleting books in user Shelf
function deleteShelfRecord(bookid,param_delete){
$.getJSON("index.php?opt=regal&task=delete&bookid="+bookid+"¶m_delete="+param_delete+"&no_html=1", deleteComplete);
}
function deleteBookList(varname,countrows,param_delete){
deletearr=Array();
var lengtharr=0;
for (var i=0;i0) $.getJSON("index.php?opt=regal&task=delete&bookid="+deletearr+"¶m_delete="+param_delete+"&no_html=1", deleteComplete);
}
function deleteComplete(json){
var rowsarray=json.id.split(',');
for( var i=0;ioldvote;i--) {
if (!document.getElementById(idbook+'_'+i)) continue;
var stri=document.getElementById(idbook+'_'+i).src;
document.getElementById(idbook+'_'+i).src=stri.replace(/star_on.gif/,'star_off.gif');
//document.getElementById(i).src='star_off.gif';
}
}
function setVoting(idbook,rank){
$.getJSON("index.php?opt=regal&task=voting&bookid="+idbook+"&rank="+rank+"&no_html=1", voteComplete);
}
function voteComplete(json){
star(json.vote,json.book);
list[json.book]=json.vote;
off(json.book,json.vote);
$('#vote'+json.book).html(json.all_vote);
}
function showDiv(id){
$('#'+id).show();
}
function hideDiv(id){
$('#'+id).hide();
}
function showDivParam (id, id_book, returnurl) {
$.getJSON("index.php?opt=status&task=all&id_book="+id_book+"&no_html=1&returnurl="+returnurl+" ",successChangedStatus);
}
function successChangedStatus(json){
showMessageWindow(json.res,'');
}
function checkEditForm(value,id){
if (id!='' && value!='')
//$.getJSON("index.php?opt=regal&task=save_edited&shelf="+id+"&no_html=1&new_shelf_name_for_editing="+value,successChangedShelf);
$.ajax({
url:"index.php",
dataType : 'json',
cache : false,
success : successChangedShelf,
type:'POST',
data: {
opt:"regal",
task:"save_edited",
shelf:id,
no_html:1,
new_shelf_name_for_editing:value}
});
///old
///document.editShelfForm.submit();
}
function successChangedShelf(json){
if (json.shelf){
if ($('#shelf_header_name')) {
document.getElementById('shelf_header_name').innerHTML=json.name;
}
if ($('#shelf_name_'+json.shelf)) document.getElementById('shelf_name_'+json.shelf).innerHTML=json.name;
}
hideDiv('message_big');
if (document.editShelfForm.new_shelf_name_for_editing) document.editShelfForm.new_shelf_name_for_editing.value='';
if (document.delete_shelf_form.shelf_id) changeOptionWithValue(document.delete_shelf_form.shelf_id,json.shelf,json.name);
}
function removerOptionWithValue(optionName,optionValue){
if(optionName) {
for(var i = 0; i < optionName.length; i++) {
if(optionName[i].value == optionValue) {
optionName.removeChild(optionName[i]);
}
}
}
}
function changeOptionWithValue(optionName,optionValue,newName){
if(optionName) {
for(var i = 0; i < optionName.length; i++) {
if(optionName[i].value == optionValue) {
optionName[i].innerHTML=newName;
}
}
}
}
function getScrollTop(){
/*Width,Height*/
if (window.innerWidth){
InnerWidth=window.innerWidth;
InnerHeight=window.innerHeight;
}
else
if (document.documentElement.offsetWidth){
InnerWidth=document.documentElement.offsetWidth;
InnerHeight=document.documentElement.offsetHeight;
}
else {
InnerWidth=document.body.offsetWidth;
InnerHeight=document.body.offsetHeight;
}
/*Scroll left,top*/
if (window.pageXOffset || window.pageYOffset){
ScrollLeft=window.pageXOffset;
ScrollTop=window.pageYOffset;
}
else
if (document.documentElement.scrollLeft || document.documentElement.scrollTop){
ScrollLeft=document.documentElement.scrollLeft;
ScrollTop=document.documentElement.scrollTop;
}
else
if (document.body.scrollLeft || document.body.scrollTop){
ScrollLeft=document.body.scrollLeft;
ScrollTop=document.body.scrollTop;
}
return ScrollTop;
}
function setScrollTop(toppos){
/*Scroll left,top*/
if (window.pageYOffset){
window.scrollTo(0,toppos);
}
else
if (document.documentElement.scrollTop){
document.documentElement.scrollTop=toppos;
}
else
if (document.body.scrollTop){
document.body.scrollTop=toppos;
}
window.scrollTo(0,toppos);
}
function tellAFriend(id){
window.open('index.php?opt=recommend_book&task=form&no_html=1&id_book='+id, 'SizeChart', 'width=650, height=450, location=no, menubar=no,resizeable=1,scrollbars=no,toolbar=0,top=10,left=100');
}