

function addComment (articleId, title, username, comment, email,form){
	
    var actionName = 'addComment';
		new Ajax.Request('./imageArray?actionName=addComment&title=wafaa&articleId='+articleId+'&username='+username+'&comment='+comment+'&email='+email, {
		  onSuccess: function(response){
		//getComment(response);
		alert("شكراً لك، لقد تم إرسال تعليقك");
		//clearText(form);
	}
	});
}

function loadVedio (vedioID){


    var actionName = 'loadVedio';
		new Ajax.Request('./imageArray?actionName=loadVedio&vedioID=' + vedioID + '&gallery=index', {
		  onSuccess: function(response){
		  setVedioUrl(response);
	}
	});
}


function setVedioUrl(response){
	var vediosInfo = response.responseXML.getElementsByTagName('vediosInfo');
	
	var width = vediosInfo[0].getAttribute('width');
	var height = vediosInfo[0].getAttribute('height');
	var file = vediosInfo[0].getAttribute('vedioUrl');
	var image = vediosInfo[0].getAttribute('vedioImage');
	var title = vediosInfo[0].getAttribute('vedioTitle');
	
	var s1 = new SWFObject("mediaplayer.swf","mediaplayer",width,height,"7");
	s1.addParam("allowfullscreen","true");
	s1.addParam("wmode","transparent");
	s1.addVariable("width",width);
	s1.addVariable("height",height);
	s1.addVariable("file",file);
	s1.addVariable("image",image);
	s1.write("vedio-box");

	document.getElementById('vedioTitle').innerHTML = title;
}



function clearText(form){
	
     var obj = document.getElementsByTagName('INPUT');

    for(var i = 0; i < obj.length; i++) {        
          if(obj[i].type == 'text') 
           obj[i].value='';   
     }
	 
	form.comment.value='';

}