function refreshCAPTCHA(elmId) 
{
	var img = document.getElementById(elmId);
	
	img.src = siteHttp  + '/index.php?act=CAPTCHA&' + Math.random();
}

function abuse_comment(comment_id)
{
	var pars = 'id=' + comment_id;
	var url = siteHttp  + "/index.php?plugin=news&act=abuse&";
	var myAjax = new Ajax.Request(
	url, 
	{
		method: 'get', 
		parameters: pars, 
		onComplete: alert("شكراً لإبلاغك عن التعليق...")
	});
}

function popup(URLStr , width, height , scrollbars )
{
  var popUpWin=0;
  
  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrollbars+',resizable=no,copyhistory=yes,width='+width+',height='+height+'');
}

// JavaScript Document

function show( obj )
{
	obj.style.display = 'block';	
}

function addF() 
{

 title = "Webpage Title"; 
  // Blogger - Replace with <$BlogItemTitle$> 
  // MovableType - Replace with <$MTEntryTitle$>

 url = "Webpage URL";
  // Blogger - Replace with <$BlogItemPermalinkURL$> 
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>
	if( window.external ) 
	{ // IE Favorite
		window.external.AddFavorite( url, title); 
	}else 
	if (window.sidebar)
	{ // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} 
	
	else if(window.opera && window.print) 
	{ // Opera Hotlist
		return true; 
	}
 }

function get_From_Server(request,object){
		try{ 
			Answer = new XMLHttpRequest();
		}catch(error)
		{
		try{
			Answer = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(error){ Answer = null; return false;
			}
		}

		Answer.onreadystatechange = change_when_have_info;
		Answer.object = object;
		Answer.open("POST", request);
		Answer.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		Answer.send(null);
	}

function change_when_have_info(object){
	if (Answer.readyState == 4){
		if(Answer.status == 200){
				document.getElementById(Answer.object).innerHTML = Answer.responseText;
		}
	}
}
