function articlePaginate( url ) 
{

var myAjax = new Ajax.Updater('desc' , url,
        {asynchronous:true,method: 'post' ,  onComplete:function() { adjustBg(); } }   );

    makeAd(); 

}


function adjustBg() 
{

		$("article_bg").style.height = ($("article").offsetHeight-15)+"px";
		$("article_bg_inner").style.height = ($("article").offsetHeight-15)+"px";
}

function setWaiterComments(content_id,waiter_id){
    var ypos = ( ( $(content_id).offsetHeight-$(waiter_id).offsetHeight ) / 2 ) + 50;

    $(waiter_id).style.top = ypos+"px";
    expCol( content_id, 'opacity');
    $(waiter_id).style.visibility='visible';

}



function getQvGB(url,element_name){

var rcount=randomnumber=Math.floor(Math.random()*50000);

var myAjax = new Ajax.Updater(element_name, url, {asynchronous:true,method: 'post' } );
}
function makeVid( stream , title){ 
    var data = stream + "|" + title; 
    so.addParam("flashVars", "playlistPath=/xml/viewlist.php?v=" + data );          
    so.write("flashcontent");
}


function view_cache_images ( arr )
{
    var holder = new Image();
    for (var i=0 ; i < arr.length; ++i   ) {
        holder.src =  arr[i];
    }
}


// *** submit comment ***

var captcha_msg;
    function ajxSubmitComment(frmId){
        new Ajax.Updater('comment_wrap', 
            '/a/moliview/', 
            { asynchronous:true, parameters:Form.serialize(frmId)});  
            $("message_area").value = null;
	     hide_balloon();
            return false;
    }
    //player 

			function setFlashWidth( w ){
				document.getElementById('main').style.width=w+'px';
			}

//******************************************************************************************
// function section_viewall (maxheight, content object, background object, minimum height)
// Anthony Carcelli
//
// maxheight is calculated during the php loop to build the content.
// contentObj is the HTML element id for the text container
// bgObj is the HTML element id for the alpha background
// minheight is to set the height of the default number of rows that appear before expanding
//
// It checks to find the offsetHeight of the content object, if it is larger than minheight,
// it is set to minheight. the -20 is there just for safety due to browsers handling 
// padding differently.
//******************************************************************************************

function section_viewall (maxheight ,contentObj , bgObj, minheight ) {
    if (maxheight == null || (!contentObj && !bgObj) ) {
        return;
    }

    var offsetH = $(contentObj).offsetHeight ;

    if (offsetH >= (maxheight-20) ) {
        maxheight = minheight ;
    }

    (bgObj)? $(bgObj).style.height = maxheight + 'px' : '' ;
    $(contentObj).style.height = maxheight + 'px';
}
