
function load()
{
	var y;
	if (self.innerHeight) // all except Explorer
	{
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
	{
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		y = document.body.clientHeight;
	}
	var scrollDiv = document.getElementById("right-scroll");
	var tdRight = document.getElementById("td-right");
	
	if ( y > 700 ) {
		scrollDiv.style.height = y - 20  + 'px';
		tdRight.style.height = y - 20 + 'px';
	} else {
		scrollDiv.style.height = 700+ 'px';
		tdRight.style.height = 700 + 'px';
	}
}

String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };

function toggleExpandBlog(blog_id,atag_id)
{
	var blog_id=document.getElementById(blog_id);
	var comments_ob=blog_id.getElementsByTagName('div');
	var atag_obj=document.getElementById(atag_id);
	for (var a=0; a<comments_ob.length;a++)
	{
			if (comments_ob[a].className=='blog-article')
				comments_ob[a].style.display=comments_ob[a].style.display=="none" ? "block" : "none";
	}		
	atag_obj.className=atag_obj.className=="minus" ? "plus" : "minus";	
}

function submitAddCommentForm() {
	var author_name = document.getElementById("name").value.trim();
	var author_email = document.getElementById("email").value.trim();
	var content = document.getElementById("content").value.trim();
	if ( author_name == "" || author_email == "" || content == "" ) {
		alert("Bitte füllen Sie alle Pflichtfelder (*) aus.");
		return false;
	}
	
 	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;   
   	if(reg.test(author_email) == false) {
		alert("Bitte überprüfen Sie die Schreibweise Ihrer Email-Adresse.");
      	return false;
   	}	
	
	return true
}


function limitText(limitField,  limitNum) {
	if (limitField.value.length > limitNum) 
		limitField.value = limitField.value.substring(0, limitNum);
}