GetId = function(id){
   if (document.getElementById)
      return document.getElementById(id);
   else if (document.all)
      return document.all[id];
}

ShowDate = function(){
	time=new Date();
	month=time.getMonth();
	year=time.getYear();
	if (year < 1000) year+=1900;
	hour=time.getHours();
	if (hour<10) hour='0'+hour;
	minute=time.getMinutes();
	if (minute<10) minute='0'+minute;
	second=time.getSeconds();
	if (second<10) second='0'+second;
	showtime=dayarray[time.getDay()]+', '+time.getDate()+'-'+montharray[month]+'-'+year
		+' '+hour+':'+minute+':'+second+'&nbsp;&nbsp;';
	
	if (GetId('currDate')!=undefined)
		GetId('currDate').innerHTML=showtime
	temp=setTimeout("ShowDate()",1000)
}

Download = function(id,pref){
	if (!GetId('iframe-loader')){
		var objBody = document.body;	    
		var objIframe = document.createElement('iframe');
			objIframe.setAttribute('src','download.php?id='+id+"&pref="+pref);
			objIframe.setAttribute('style','display:none');
			objIframe.setAttribute('id','iframe-loader');
		objBody.appendChild(objIframe);	
	}
	else{
		GetId('iframe-loader').setAttribute('src','download.php?id='+id+"&pref="+pref);	
	}
	return false;
}

GoBack = function(){
	window.history.back()
	return false;
}

PrintArticle = function(id){
	newWindow = window.open("article_print.php?id_arti="+id,"subWind",
	"status,menubar,height=500,width=700,resizable,scrollbars");
	return false;
}
