
    function preview(){
             if(document.addnews.short_story.value == '' || document.addnews.title.value == ''){ alert('Your article must have at least Title and Short Story'); }
             else{
                  dd=window.open('','prv','height=400,width=750,resizable=1,scrollbars=1')
                  document.addnews.mod.value='preview';document.addnews.target='prv'
                  document.addnews.submit();dd.focus()
                  setTimeout("document.addnews.mod.value='addnews';document.addnews.target='_self'",500)
             }
    }

    function increaseTextarea(area){
             if (document.getElementById(area).style.height == '') {
                 document.getElementById(area).style.height = '300px';
             }
             else{
                  var pattern = new RegExp("\\d+",'ig');
                  var currHeight = document.getElementById(area).style.height.match(pattern);
                  var newHeight = +currHeight + 100;
                  document.getElementById(area).style.height = newHeight + 'px';
             }


    }


function submitForm() {
        updateRTE('description');
		updateRTE('extras');
        return true;
}

    function increaseTextareaBug() 
	{
		var area = 'full_story';
             if (document.getElementById(area).style.height == '')
			 {
                 document.getElementById(area).style.height = '250px';
             }
             else
			 {
                  var pattern = new RegExp("\\d+",'ig');
                  var currHeight = document.getElementById(area).style.height.match(pattern);
                  var newHeight = +currHeight + 1;
                  document.getElementById(area).style.height = newHeight + 'px';
             }
	}

    onload=focus;function focus(){document.forms[0].title.focus();
}
