function selectall(){
	$(".view_contact_Id").each(function() {
		$(this).attr("checked",true);
	});
}

function selectnone(){
	$(".view_contact_Id").each(function() {
		$(this).attr("checked",false);
	});
}

function view_contact_del() {
	document.view_contact.submit();
}

function view_user_status(userid,status){
	var path=$("#"+userid+"_status").attr("modulepath");
	var rpath=$("#"+userid+"_status").attr("urlpath");	
	
	jQuery.ajax({ 
		type: "POST",
		url: path+"php/update_userprofile.php",
		data: "Status_id="+userid+"&status="+status,
		cache: false, 
		beforeSend: function() {
			$.showAlert({message:"Processing..."});
		},
		complete: function() {
			$.hideAlert();
		},
		success: function(t) { 
			var tobj = eval("(" + t + ")");
			if(tobj.status==1) {
				status=1;
				$("#"+tobj.userid+"_status").html("Active");
				//setTimeout("location.reload(true);",500);
				
			} else {
				status=0;
				$("#"+tobj.userid+"_status").html("Inactive");
				//setTimeout("location.reload(true);",500);
			}
			$.hideAlert();
		}
						  
	});
}

function search_view_contact() {
	jQuery(".searchBox").show("slow");
}
function search_hide_contact() {
	jQuery(".searchBox").hide("slow");
}

function cust_toggle(conid,imgpath) {
	if(jQuery("#_cust_showHide"+conid).children().children().attr("src")== imgpath+"images/plus.gif"){
		var id = conid;
		$("#_show_custDetail"+id).show();			 				 	
		jQuery("#_cust_showHide"+id).children().children().attr("src",imgpath+"images/minus.gif");
	} else { 
		var id = conid;
		$("#_show_custDetail"+id).hide();
		jQuery("#_cust_showHide"+id).children().children().attr("src",imgpath+"images/plus.gif");
	}
}

function readTerms(imgpath,flag) {
	jQuery("#acceptTC").val(0);
	var pkgTxt= "";
				pkgTxt+="<div  align='left' style='background-color:white; height:220px; width:500px;padding-top:15px;'><div id='_billing_addpackageUtility' align='center' style='background-color:white; height:220px; width:500px;'><textarea rows=13 cols=55 readonly='readonly' >Warrant Of Services, All our services will serve their intended functions.Payment Processing We ensure accuracy in our billing as all our transactions are automatically processed. We will not entertain any cancellations once the order is confirmed and submitted by the customer.Confirmation of Orders Upon confirmation of online ordered customer will received an electronic acknowledgement order detail via email. Exchange & Refunds Refund will be given at the discretion of the company management.Feedback.</textarea>";
				pkgTxt+=" </div></div>";
				
				var lyr1 = $('<div class="alertUIBlockerpackUtill" style="z-index:1000;background-color:#404040; opacity:.7; 		cursor:wait;border:none;margin:0;padding:0;width:100%;height:900px;;top:0;left:0;position:absolute;"></div>');
				
				var button ='<div style="float:right;padding:0px 10px 2px 0px;width:14px;height:20px;"><button type="button" 		class="_billingpackUtill_click_hide"><img src="'+imgpath+'/tab_close-on.gif" alt="Close" title="Close" border="0"/></button></div>';
				
				var lyr2 = $('<div class="_trans_billingPackUtill_hide" style="width:500px; height:220px; padding-top:10px; display:block; position:absolute;	z-index:1001;"><div style="float:left; height:20px; width:100%; color:white; background-color: #A09AEF;"><div style=" float:left; padding:2px 0px 2px 2px;"><b>Terms and Conditions</b></div>'+button+'</div><div style="clear:both; float:left;">'+pkgTxt+'</div></div>');
							
				
				lyr2.css({top: ($(document).height()/2)-100,left: ($(document).width()/2)-225});
				
				
				$([lyr1[0],lyr2[0]]).appendTo('body');
				//$("#_billing_addpackageUtility").html(t);
				jQuery("#readtrems").click(function() {
					if($(this).val()==1) {
						jQuery("#acceptTC").val(1);	
						jQuery('._trans_billingPackUtill_hide').remove();
						jQuery('.alertUIBlockerpackUtill').remove();
					} else {
						alert("Now you Are not Accept T & C. if you want to accept please click the Check box");
					}
				});
				jQuery('._billingpackUtill_click_hide').click(function() {
					jQuery('._trans_billingPackUtill_hide').remove();
					jQuery('.alertUIBlockerpackUtill').remove();
					//jQuery("#acceptTC").val(1);	
					//_trns_billing_chPack();
				});
	
}
