function toggle_accept()
{
	var element = document.getElementById("accept").disabled;
	if( element == true)
		document.getElementById("accept").disabled = false;
	else
		document.getElementById("accept").disabled = true;
}

function resetForm(formName)
{
var myForm = document.getElementById(formName);  		
  myForm.reset();
  return false;
}

function popup(URLStr,width, height)
{
  var popUpWin=0;
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;

  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function sc_popup(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function closeWin(valueToBeParsed) {
window.opener.document.data_form.filename.value=valueToBeParsed;
self.close();
}

function closeWin2(valueToBeParsed) {
window.opener.document.data_form.filename2.value=valueToBeParsed;
self.close();
}

function closeWin3(valueToBeParsed) {
window.opener.document.data_form.imagedir.value=valueToBeParsed;
self.close();
}
function closeWin4(valueToBeParsed) {
window.opener.document.data_form.filename.value=valueToBeParsed;
self.close();
}

function backvalue(filename)
{
		window.opener.document.frm_info.txt_videos_id.value=filename;

		window.close() ;

}

function ref_code(value_code)
{
		window.opener.document.frm_info.txt_ref_code.value=value_code;

		window.close() ;

}

function ref_code2(value_code)
{
		window.opener.document.frm_info_update.txt_ref_code.value=value_code;

		window.close() ;

}

<!--
function confirmSubmit()
{

if (confirm("Are you sure you wish to continue?")) { 
	return true ;
}else{
	return false ;
}
}
// -->
// Check delete file
function checkDelFile()
{

if (confirm("Are you sure you delete old file? And you sure you need to replace the file?")) { 
	return true ;
}else{
	return false ;
}
}


function loadPage(page) {
	$(document).ready(function(){
			$('#contentArea').append('<center><span id="load"><img src="../images/line-loading.gif"></span></center>');
			$("#contentArea").load(page);
		});
	}

//  -------------------------Begin : Enable Clip Owner -----------------------------------

function act_enable_clip(id,type) {

	  if (confirm("Are you sure you want to enable this item ?")) { 	
	$('img#loading'+id).show();
		$.ajax({
			type: "GET",
			url: "process.php",
			data: "gmode=enable_clip&ck_id=" + id +"&type="+type,
			success: function(msg) { 
				if(msg.indexOf("failed") == -1) {			
					$('img#loading'+id).hide(); 
					$('img#check'+id).show();
					$('img#uncheck'+id).hide();
					//$('div#statusMsg').html(msg); 
	
					t = setTimeout("clearStatusMsg()", 5000);
				} else {
					$('img#loading'+id).hide();					
					$('img#check'+id).show();
					$('img#uncheck'+id).hide();
					//$('div#statusMsg').html(msg); 
					t = setTimeout("clearStatusMsg()", 3000);
				}
			}
		});
	}
}

//  -------------------------Begin : Disable Clip Owner -----------------------------------

function act_disable_clip(id,type) {

	  if (confirm("Are you sure you want to deactivate this item ?")) { 	
	$('img#loading'+id).show();
		$.ajax({
			type: "GET",
			url: "process.php",
			data: "gmode=disable_clip&ck_id=" + id +"&type="+type,
			success: function(msg) { 
				if(msg.indexOf("failed") == -1) {			
					$('img#loading'+id).hide(); 
					$('img#uncheck'+id).show();
					$('img#check'+id).hide();
					
					//$('div#statusMsg').html(msg); 
	
					t = setTimeout("clearStatusMsg()", 5000);
				} else {
					$('img#loading'+id).hide();					
					$('img#uncheck'+id).show();
					$('img#check'+id).hide();
					//$('div#statusMsg').html(msg); 
					t = setTimeout("clearStatusMsg()", 3000);
				}
			}
		});
	}
}

//  -------------------------Begin : Enable Member Owner -----------------------------------

function act_enable_member(id,type) {

	  if (confirm("Are you sure you want to activate this item ?")) { 	
	$('img#loading'+id).show();
		$.ajax({
			type: "GET",
			url: "process.php",
			data: "gmode=enable_member&ck_id=" + id +"&type="+type,
			success: function(msg) { 
				if(msg.indexOf("failed") == -1) {			
					$('img#loading'+id).hide(); 
					$('img#check'+id).show();
					$('img#uncheck'+id).hide();
					//$('div#statusMsg').html(msg); 
	
					t = setTimeout("clearStatusMsg()", 5000);
				} else {
					$('img#loading'+id).hide();					
					$('img#check'+id).show();
					$('img#uncheck'+id).hide();
					//$('div#statusMsg').html(msg); 
					t = setTimeout("clearStatusMsg()", 3000);
				}
			}
		});
	}
}

//  -------------------------Begin : Disable Member Owner -----------------------------------

function act_disable_member(id,type) {

	  if (confirm("Are you sure you want to deactivate this item ?")) { 	
	$('img#loading').show();
		$.ajax({
			type: "GET",
			url: "process.php",
			data: "gmode=disable_member&ck_id=" + id +"&type="+type,
			success: function(msg) { 
				if(msg.indexOf("failed") == -1) {			
					$('img#loading').hide(); 
					$('img#uncheck'+id).show();
					$('img#check'+id).hide();
					
					//$('div#statusMsg').html(msg); 
	
					t = setTimeout("clearStatusMsg()", 5000);
				} else {
					$('img#loading').hide();					
					$('img#uncheck'+id).show();
					$('img#check'+id).hide();
					//$('div#statusMsg').html(msg); 
					t = setTimeout("clearStatusMsg()", 3000);
				}
			}
		});
	}
}

function act_add_to_friend(user_id,user_channel) {

	$('img#loading').show();
		$.ajax({
			type: "POST",
			url: "public_actions.php",
			data: "pmode=add_friend&user_id=" + user_id +"&user_channel="+user_channel,
			success: function(msg) { 
				if(msg.indexOf("failed") == -1) {			
					$('img#loading').hide(); 
					$('input#bt_addfriend').attr("disabled", true); 
					$('div#statusMsg').html(msg); 
					t = setTimeout("clearStatusMsg()", 5000);
				} else {
					$('img#loading').hide();					
					$('input#bt_addfriend').show();

					t = setTimeout("clearStatusMsg()", 3000);
				}
			}
		});
}

function act_reportSpam(comment_id,type) {

	$('img#loading2').show();
		$.ajax({
			type: "POST",
			url: "public_actions.php",
			data: "pmode=reportSpam&comment_id=" + comment_id +"&type="+type,
			success: function(msg) { 
				if(msg.indexOf("failed") == -1) {			
					$('img#loading2').hide(); 
					$('div#statusMsg2').html(msg); 
					t = setTimeout("clearStatusMsg2()", 5000);
				} else {
					$('img#loading2').hide();					
					t = setTimeout("clearStatusMsg2()", 3000);
				}
			}
		});
}

//  -------------------------Begin : Enable Advertisement -----------------------------------

function act_enable_ads(id,type) {

	  if (confirm("Are you sure you want to enable this item ?")) { 	
	$('img#loading').show();
		$.ajax({
			type: "GET",
			url: "process.php",
			data: "gmode=enable_advertise&ck_id=" + id +"&type="+type,
			success: function(msg) { 
				if(msg.indexOf("failed") == -1) {			
					$('img#loading').hide(); 
					$('img#check'+id).show();
					$('img#uncheck'+id).hide();
					//$('div#statusMsg').html(msg); 
	
					t = setTimeout("clearStatusMsg()", 5000);
				} else {
					$('img#loading').hide();					
					$('img#check'+id).show();
					$('img#uncheck'+id).hide();
					//$('div#statusMsg').html(msg); 
					t = setTimeout("clearStatusMsg()", 3000);
				}
			}
		});
	}
}

//  -------------------------Begin : Disable Advertisement -----------------------------------

function act_disable_ads(id,type) {

	  if (confirm("Are you sure you want to disable this item ?")) { 	
	$('img#loading').show();
		$.ajax({
			type: "GET",
			url: "process.php",
			data: "gmode=disable_advertise&ck_id=" + id + "&type="+type ,
			success: function(msg) { 
				if(msg.indexOf("failed") == -1) {			
					$('img#loading').hide(); 
					$('img#uncheck'+id).show();
					$('img#check'+id).hide();
					
					//$('div#statusMsg').html(msg); 
	
					t = setTimeout("clearStatusMsg()", 5000);
				} else {
					$('img#loading').hide();					
					$('img#uncheck'+id).show();
					$('img#check'+id).hide();
					//$('div#statusMsg').html(msg); 
					t = setTimeout("clearStatusMsg()", 3000);
				}
			}
		});
	}
}


//----------------------Begin : Clear Status-----------------------------------------------
function clearStatusMsg($obj) {
	if($('#statusMsg').html() != "") {
		$('#statusMsg').html('');
	}
}

function clearStatusMsg2($obj) {
	if($('div#statusMsg2').html() != "") {
		$('div#statusMsg2').html('');
	}
}

//----------------------Begin : Check All-----------------------------------------------
	var i_status;
	var c_status;
	var o_status;
	
	function selectAll(formObj, isInverse) {

		if(c_status != 1){
			for (var i=0;i < formObj.length;i++){
		      fldObj = formObj.elements[i];
		      if (fldObj.type == 'checkbox')
		      {
			      fldObj.checked = true;			      
		      }
	      }
	      c_status = 1;
		}
		else {
			for (var i=0;i < formObj.length;i++){
		      fldObj = formObj.elements[i];
		      if (fldObj.type == 'checkbox')
		      {
			      fldObj.checked = false;
			      
			  }
		    }
		    c_status = 0;
		}  
	}
	
	function submitform(formObj)
	{
	  document.formObj.submit();
	}
	
	//==============Delete Data=======================
	function delete_data(mode) {

		var agree=confirm("Are you sure you would like to delete the selected items?");
		if (agree) {
			document.frm_list.method='post';
			document.frm_list.action = "process.php?pmode=" + mode;
			document.frm_list.submit();
			
		}
		else {
			false
		}
	}
		
	function enable_data(mode) {

		var agree=confirm("Are you sure you would like to enable the selected items?");
		if (agree) {
			document.frm_list.method='post';			
			document.frm_list.action = "process.php?pmode=" + mode;
			document.frm_list.submit();
		}
		else {
			false
		}
	}	
	
	function disable_data(mode) {
	
		var agree=confirm("Are you sure you would like to disable the selected items?");
		if (agree) {
			document.frm_list.method='post';			
			document.frm_list.action = "process.php?pmode=" + mode;
			document.frm_list.submit();
		}
		else {
			false
		}
	}		
	
	
	//==============Type Delete Data=======================
	function bdelete_data(mode,type) {

		var agree=confirm("Are you sure you would like to delete the selected items?");
		if (agree) {
			document.frm_list.method='post';
			document.frm_list.action = "process.php?gmode=" + mode + "&type=" + type;
			document.frm_list.submit();
			
		}
		else {
			false
		}
	}
		
	function benable_data(mode,type) {

		var agree=confirm("Are you sure you would like to enable the selected items?");
		if (agree) {
			document.frm_list.method='post';			
			document.frm_list.action = "process.php?gmode=" + mode + "&type=" + type;
			document.frm_list.submit();
		}
		else {
			false
		}
	}	
	
	function bdisable_data(mode,type) {
	
		var agree=confirm("Are you sure you would like to disable the selected items?");
		if (agree) {
			document.frm_list.method='post';			
			document.frm_list.action = "process.php?gmode=" + mode + "&type=" + type;
			document.frm_list.submit();
		}
		else {
			false
		}
	}			
	
	
	function action_data(mode) {

		var agree=confirm("Are you sure you would like to selected items?");
		if (agree) {
			document.frm_list.submit();
		}
		else {
			false
		}
	}	
