function delSchieber(){

    jq('a.upldelete').live('click',function(){
        if(confirm('Möchtens Sie das Bild wirklich entfernen')){
          jq(this).parent('div').hide(1);
          var rep = jq(this).attr('rel');
          var list = jq('#images').val();
          arrlist = list.split(" ");

          var cnt= arrlist.length

          for(i=0; i<=cnt-1; i++){
          if(arrlist[i]==rep){
          arrlist.splice(i,1);
          }
          }
          arrlist = arrlist.join(" ")
          jq('#images').val(arrlist);

        return false;
        }
            return false;
        })

}

function imgLoads(imgSrc){

    }
	
function messanger(type, message, duration){
	var messageBox=jq('<div></div>').css({'display':'none'}).attr('id',type).html(message);
	jq('#main2').prepend(messageBox);
	jq('html, body').animate({scrollTop:0}, 'slow');
	jq(messageBox).fadeIn().delay(duration).fadeOut();
	//Aufruf: jq(function(){messanger("tippOk", "bla bla", 3000);})
}

function chgselect() {
	document.kform.submit();
}

function printPage() {
    if (window.print) {
        jetzt = confirm('Diese Seite jetzt drucken ?');
        if (jetzt) window.print();
    }
}

function go2(link) {
    window.location.href = link;
}

function CountMax(maxnach, id) {
    var txtref = document.getElementById("txtarea" + id);
	var wert = maxnach - txtref.value.length;
    var ref = document.getElementById("maxzeichen");
    if (wert < 0) {
        txtref.value = txtref.value.substring(0, maxnach);
    }
    wert = maxnach - txtref.value.length;
    ref.innerHTML = wert;
}

function chgimage(img, toID, aimg, aID) {
    var imgto = document.getElementById(toID);
    var ato = document.getElementById(aID);
    var image = document.getElementById("image0");
    var video = document.getElementById("video0");
	video.style.display = "none";
	image.style.display = "inline";
	imgto.src = img;
	ato.href = aimg;
}

function viewvideo(vID) {
    var vto = document.getElementById(vID);
    var image = document.getElementById("image0");
    var video = document.getElementById("video0");
	image.style.display = "none";
	video.style.display = "inline";
}


jq(function(){
	setNumbers({
	'idSrc':'[name="user[land]"]',
	'idPhone':'[name="user[telefonland]"]',
	'idMobile':'[name="user[mobilland]"]'
	})
})

function setNumbers(opt){
	jq(opt.idSrc).bind('change',function(i){
		jq(opt.idPhone+' , '+opt.idMobile).val("+" + jq(this).val().replace("fsel_land_", ""));
		})
}

function frageSave(theLink, confirmMsg) {
if (confirmMsg == '') {
return true;
}
var is_confirmed = confirm(confirmMsg);
if (is_confirmed) {
theLink.href += '#1';
}
return is_confirmed;
} 
