function checkCommentForm(){
$comment = $('#commentar');
$list = $("
");
error = false;
if($.trim($comment.val()) == ""){error = true; $list.append('- Bitte einen Kommentar eingeben.
');}
if($comment.val().match(//i)){error = true; $list.append('- Sie haben unzulässiges JavaScript in Ihrem Kommentar! Bitte entfernen Sie dieses.
');}
if($.trim($('#name').val()) == ""){error = true; $list.append('- Es wurde kein Name angegeben!
');}
if(error){$('#comment_error').html($list).show(); return false;}
else{return true;}
}
function DelComment(CommentId,PicId,cid){
url = 'gallery_viewpic.php?cid='+cid+'&pid='+PicId+'&dc='+CommentId+'#com';
$.get(url, function(data) {});
setTimeout("location.reload()",200);
}
function checkForScript(){
if($("#commentar").val().match(//i)){$('#comment_error').html('- Sie haben unzulässiges JavaScript in Ihrem Kommentar! Bitte entfernen Sie dieses.
').show();}
else{$('#comment_error').hide();}
}
function doUpload(inpId){
url='/admin/fileupload.php?x=1000000&y=10000000';
file = $('#'+inpId).val();
$postvars = {'xyz':'formpost1','des_img':'1','uploadfile':file};
$.post(url,$postvars,function(res){
alert($(res).find("#uploaded_code_url").html());
});
}
function setOption(val,el){
inp = document.getElementById('delchoice');
inp.value=val;
for(var i=0;i<=4;i++){
try{
opt = document.getElementById('delOption'+i);
if(opt==el){opt.setAttribute('class',"delOption del_active");}
else{opt.setAttribute('class',"delOption del_inactive");}
}
catch(e){}
}
}
function hideSaved() {
document.getElementById('data_saved').style.display='none';
}
var timer;
function fadeIn(el) {document.getElementById(el).style.display='block';}
function fadeOut(el) {document.getElementById(el).style.display='none';}
function addInput(){
var inpDiv = document.getElementById('upInputs');
br = document.createElement('br');
newInp = document.createElement('input');
newInp.setAttribute('type','file');
newInp.setAttribute('name','pic_file[]');
inpDiv.appendChild(br);
inpDiv.appendChild(newInp);
}
function manageImageUpload() {
var limit = false;
$html5 = $('#html5Upload');
$html = $('#htmlUpload');
$img = $('#imageUpload');
/*if(limit){$('#imageUpload').html('').append($('#upload_limit')).show();$('#upload_limit').show();return;}*/
inp = document.createElement('input');
inp.setAttribute('multiple','multiple');
if(inp.multiple==true){html5 = true;}
else{html5=false;}
if($img.css('display') == 'block')
{$img.css('borderColor', '#608E46');}
if(html5){$html5.show();$img.show();$html.hide();}
else{$html5.hide();$img.show();$html.show();}
}
function checkForm(el,url){
var size = 0;
errordiv = document.getElementById('imUploadError');
for (var i=0; i 20971520) {
var mb = Math.round(size/1024/1024);
if (mb==20){mb=21;}
errordiv.innerHTML = "Die Größe der ausgewählten Bilder beträgt insgesamt " + mb + "Mb.
Bitte wählen Sie maximal 20Mb für den Upload";
errordiv.style.display="block";}
else {
errordiv.style.display="none";
hpm_upload_start_progress(url, 'progressmeter','upstats');
submitForm();}}
function upstats(percent){
document.getElementById('progressmeter').style.width = (percent*2+20)+'px';
}
function submitForm() {
try{
document.getElementById('imageUpload').style.display='none';
$('.pages').hide();
document.getElementById('progress').style.display='block';
document.getElementById('cats_wrap').style.display='none';
document.getElementById('gallCatPicContent').style.display='none';}
catch(e){}
document.picupload.submit();}
function checkEmpty(url){
var img = false;
var inputs = document.getElementById('upInputs').getElementsByTagName('input');
for(var i=0;iEs existiert bereits eine Kategorie mit diesem Namen!");
$("#cat_name").css("border", "1px solid #a71111");
check = false;
}
else {
$("#cat_name").css("border", "1px solid #d5d5d5");
$.ajax({
type: "POST",
dataType: 'json',
async: 0,
url: 'ajax/handler.php',
data: {name:catname,method:'checkCatname',zid:cid},
success: function(res){
if(res.ok == false){
$("#errcat").html("Der Name des Albums ist bereits vergeben!");
$("#errcat").css("display", "block");
$("#cat_name").css("border", "1px solid #a71111");
check = false;
}
else {
$("#errcat").css("display", "none");
$("#cat_name").css("border", "1px solid #d5d5d5");
check = true;
}
}
});
}
return check;
}