function window_opener(url, width, height) {
   height = height ? height : 550;
   width = width ? width : 600;
   window.open(url,'_blank','alwaysRaised=yes,dependent=yes,height='+height+',width='+width+',menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
   return false;
}

function trim(str) {
     s = str.replace(/^(\s)*/, '');
     s = s.replace(/(\s)*$/, '');
     return s;
}

function confirm_url(new_url,qtext)
{
	if(confirm(qtext))
	{
		window.location=new_url;
	}
}

// edit_coupon.tpl
function check_coupon_import(str)
{	
	str = trim(str);
	
	if(str.length<=0) {
		alert(('A beviteli mezö üres!'));
		return false;
	}
	else {
		return true;
	}	
}

// course_gradueted.tpl
$(document).ready( function() {  
   /*
   // Select all
   $("#checkinvers").click( function() {
       $("INPUT[@name=certificate]").attr('checked', true);
       return false;
   });         
  
   // Select none
   $("#checkinvers").click( function() {
       $("INPUT[@name=certificate]").attr('checked', false);
       return false;
   });
   */

   // Invert selection
   $("#checkinvers").click( function() {
       $("input[@rel=certificate]").each( function() {
           $(this).attr('checked', !$(this).attr('checked'));
       });
       return false;
   });
   
   // Select/unselect 
	$("#checkselect").click(function()				
	{
		var checked_status = this.checked;
		$("input[@rel=certificate]").each(function()
		{
			this.checked = checked_status;
		});
	});         
});