function ShowActor(id,isNew,lang)
{
	window.location="?actor="+id+"&new="+isNew+"&lang="+lang;
}

function ShowActorEdit()
{	
	$("#ActorName").show();
	$("#ActorSurname").show();
	$("#ActorFather").show();
	$("#ActorBirthDay").show();
	$("#ActorBirthMonth").show();
	$("#ActorBirthYear").show();
	$("#SaveActor").show();
	$("#CancleActor").show();
	$("#ActorAbout").show();
	$("a[id=DeleteRole]").show();
	$("img[id=DeletePicture]").show();		
	$("input[id=AltPicture]").show();		
	$("input[id=radio]").show();
	$("#Divform").show();
	$("#AddRole").show();
	$("#ActorAboutDiv").show();
	$("#ShowOn").show();
	$("#Rang").show();
	
	$("#Name").hide();
	$("#Surname").hide();
	$("#FatherName").hide();
	$("#BirthDay").hide();
	$("#EditActor").hide();
	$("#About").hide();
	}

function DeleteActor(id)
{
//if (ShowConfirm()==true)
//if (confirm("Are you sure?")==true)
	{
		$.post("ajax/deleteActor.php",{id:id},function () {window.location="actors.php";})
	}
}

function CancleActor()
{
//if (ShowConfirm()==true)
//if (confirm("Are you sure?")==true)
	{
	$("#ActorName").hide();
	$("#ActorSurname").hide();
	$("#ActorFather").hide();
	$("#ActorBirthDay").hide();
	$("#ActorBirthMonth").hide();
	$("#ActorBirthYear").hide();
	$("#SaveActor").hide();
	$("#CancleActor").hide();
	$("#ActorAbout").hide();
	$("a[id=DeleteRole]").hide();
	$("#AddRole").hide();
	$("img[id=DeletePicture]").hide();
	$("input[id=radio]").hide();
	$("#Divform").hide();
	$("#ActorAboutDiv").hide();
	$("#ShowOn").hide();
	$("#Rang").hide();
	$("input[id=AltPicture]").hide();	
	
	$("#About").show();
	$("#Name").show();
	$("#Surname").show();
	$("#FatherName").show();
	$("#BirthDay").show();
	$("#EditActor").show();
	$("#About").show();
	
	}
}


function SaveActor(lang)
{
//if (ShowConfirm()==true)
//if (confirm("Are you sure?")==true)
	{
		var editor_data = CKEDITOR.instances.AboutText.getData();
		$("#AboutText").text(editor_data);
		
		query = $('#Actor').serialize();
		query += '&text='+editor_data;
		query += '&lang='+lang;
		$.post("ajax/editActor.php",query,function (data) {window.location="actors.php?actor="+$("#HiddenID").attr("value")+"&new=no&lang="+lang;})
	}
}

function AddNew(lang)
{
	$.post("ajax/AddNew.php",{tablename:"actors"},function (data) {ShowActor(data,"yes",lang);});
}


