// This function makes tabs on the product administration page. a_ (div id) is the tab id of the respective table id
function actprodtabs(divid)
{
		var divArray = ['general', 'download', 'screenshot', 'comments', 'awards', 'publisher', 'related', 'files'];
		for (var index = 0; index < divArray.length; ++index) {
			var buttonName = 'a_'+divArray[index];
			if(divid == divArray[index]){
				if($(divArray[index])){
					$(divArray[index]).show();
					if ($(buttonName)) $(buttonName).addClassName('title11pxsel');
					if ($(buttonName)) $(buttonName).removeClassName('title11pxunsel');
				}
			}
			else{
				if($(divArray[index])){
					$(divArray[index]).hide();
					if ($(buttonName)) $(buttonName).removeClassName('title11pxsel');
					if ($(buttonName)) $(buttonName).addClassName('title11pxunsel');
				}
			}
		}
}
function addStar(starID,type){

  for(var i=1; i<=10; i++){
    if(i>starID) $(type+'_'+i).innerHTML = '<img src="/images/patrat_g.jpg" />';
	else $(type+'_'+i).innerHTML = '<img src="/images/patrat_v.jpg" />';
  }

  $('u_'+type).value = starID;
}
function addFianlStar(starID,type){
	for(var i=1; i<=10; i++){
    if(i>starID) $(type+'_'+i).innerHTML = '<img src="/images/patrat_g.jpg" />';
	else $(type+'_'+i).innerHTML = '<img src="/images/patrat_v.jpg" />';
  }
  addStar(starID,'general');
  addStar(starID,'usability');
  addStar(starID,'stability');
  addStar(starID,'installation');
  addStar(starID,'functionality');
  addStar(starID,'appearance');

}



function sendRating(URL){
	var opt = {
		method: 'post',
		parameters:'sendrating=yes' + '&general=' + $F('u_general') + '&usability=' + $F('u_usability') + '&stability=' + $F('u_stability') + '&installation=' + $F('u_installation') + '&functionality=' + $F('u_functionality') + '&appearance=' + $F('u_appearance'),
		onSuccess: function(transport) {
			$('ratingtable').update(transport.responseText);
			
		},
		onFailure: function(t) {
			alert('Error ' + t.status + ' -- ' + t.statusText + '\n'+SiteLang['Contact_Sys_Admin']);

		}
	}
	new Ajax.Request(URL, opt);

}
var newwindow;
function winPopUp(url,width,height)
{
	newwindow=window.open(url,'popup','height='+height+',width='+width+',status=yes,resizable=yes');
	if (window.focus) {newwindow.focus()}
}