﻿var SoditajiPub={
	version:'1.0'
};
SoditajiPub.comments = {
	music_info: {
		commentAdd: function(value, t, tid){
			$("#comaddbt").attr("disabled","disabled");
			$("#com_text").attr("disabled","disabled");
			$.post("post/comment.php", { doo:'new_com', val: value, type: t, typeid: tid});
			SoditajiPub.comments.music_info.postOk(t,tid);
		},
		
		postOk: function(par1, par2){
		document.getElementById('com_box').innerHTML = "<img src='images/loader_4.gif'/>";
		setTimeout("SoditajiPub.comments.music_info.loadNew('"+par1+"','"+par2+"')", 1500);
		},
		 
		loadNew: function(p1, p2){
		$("#com_text").attr("value","");
		$("#com_text").attr("disabled","");
		$("#comaddbt").attr("disabled","");
		$.get("info/com/comments.php", { t:p1, tid:p2, tdir:'../../' },
  			function(data){
			document.getElementById('com_box').innerHTML = data;
			});

		}
	},
	gallery : {
		picture :{
			commentAdd: function(value, t, tid){
			$.post("post/comment.php", { doo:'new_com', val: value, type: t, typeid: tid});
			SoditajiPub.comments.gallery.picture.postOk(t,tid);
		},
		
			postOk: function(par1, par2){
				document.getElementById('com_box').innerHTML = "<img src='images/loader_5.gif'/>";
				setTimeout("SoditajiPub.comments.gallery.picture.loadNew('"+par1+"','"+par2+"')", 1500);
			},
		 
			loadNew: function(p1, p2){
				$.get("info/com/comments.php", { t:p1, tid:p2, tdir:'../../' },
  					function(data){
					document.getElementById('com_box').innerHTML = data;
				});
			}
		}
	}
};
